Sandbox
From Metabolomics.JP
(Difference between revisions)
Line 1: | Line 1: | ||
this is sandbox page. | this is sandbox page. | ||
− | + | {{#lua: | |
− | + | local H = {}; | |
− | {{# | + | local I = {}; |
+ | for id, name in stdin:gmatch("&&(%w+).Common Name=&&(%S+)") do | ||
+ | name = string.lower(name); | ||
+ | for term in string.gmatch(name,"([^&]+)&&") do | ||
+ | if ((string.len(term) > 60)) then | ||
+ | if (H[term] == nil) then | ||
+ | H[term] = id; table.insert(I, term); | ||
+ | else | ||
+ | H[term] = H[term] .. ";" .. id; | ||
+ | end | ||
+ | end | ||
+ | end | ||
+ | end | ||
+ | table.sort(I, function (x,y) return string.len(x)<string.len(y) end); | ||
+ | local ret = ""; | ||
+ | for i=1,table.getn(I) do | ||
+ | local k = I[i]; | ||
+ | ret = ret .. "* '''" .. k; | ||
+ | for id in string.gmatch(H[k],"%w+") do | ||
+ | ret = ret .. "''' [[" .. id .."]] "; | ||
+ | end | ||
+ | ret = ret .. "\n"; | ||
+ | end | ||
+ | print(ret); | ||
+ | | | ||
+ | {{#SearchLine:Common Name=||FL%}} | ||
+ | }} |
Revision as of 02:39, 2 October 2008
this is sandbox page.