Sandbox

From Metabolomics.JP
(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
 
this is sandbox page.
 
this is sandbox page.
  
<!---{{Index/name|F|G|FL|}}
+
{{#lua:
 
+
  local H = {};
{{#persist:FLindex name|name|Index/name|2|a;FL}}---->
+
  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 .. "'''&nbsp;&nbsp; [[" .. id .."]] &nbsp; ";
 +
    end
 +
    ret = ret .. "\n";
 +
  end
 +
  print(ret);
 +
|
 +
{{#SearchLine:Common Name=||FL%}}
 +
}}

Revision as of 02:39, 2 October 2008

this is sandbox page.


Personal tools
Namespaces

Variants
Actions
Navigation
metabolites
Toolbox