Template:Index/name

From Metabolomics.JP
(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
<noinclude>名前のインデクス {{{1}}} 最小値(デフォルトaa) {{{2}}} 最大値(デフォルトab) {{{3}}} ページタイトル {{{4}}}ダミー</noinclude>
+
<noinclude>名前のインデクス {{{1}}} 値(文字列) {{{2}}} ページタイトル (FL/LB/..)</noinclude>
 
Last updated: {{REVISIONTIMESTAMP}}
 
Last updated: {{REVISIONTIMESTAMP}}
  
<!----
 
 
{| width=100%
 
{| width=100%
 
|-
 
|-
|align=left| {{Index/persist|name|{{#lua:
+
|align=left| {{#persist:FLindex (name)|Name|Index/name|2|{{{1}}};FL}}
  local id = stdin:match("%S+");
+
|align=center| [[Index:{{{2}}}]]
  if (id == "aa") then
+
|align=right| {{#persist:FLindex (name)|Name|Index/name|2|{{{1}}};FL}}
    print("aa");
+
|}
  else if (string.byte(id,2) == 'a') then
+
 
    print(string.char(string.byte(id,1)-1).."z");
+
{{#lua:
  else print(string.sub(id,0,1)..string.char(string.byte(id,2)-1));
+
   local common = {"methoxy", "hydroxy", "acid", "acetyl", "amino", "alpha", "acetyloxy", };
    end
+
  local key = stdin:match("%w+");
  end | {{{1|aa}}} }}
+
   local H = {};
|{{#lua:
+
   for id, name in stdin:gmatch("&&(%w+).Common Name=&&(%S+)") do
  local id = stdin:match("%S+");
+
     name = string.lower(name);
  if (id == "zz") then
+
    for term in string.gmatch(name,"(%a+)") do
    print("zz");
+
      if ((string.len(term) > 3) and
  else if (string.byte(id,2) == 'a') then
+
          (string.sub(term,0,1) == key)) then
    print(string.char(string.byte(id,1)-1).."z");
+
        if (H[term] == nil) then
  else print(string.sub(id,0,1)..string.char(string.byte(id,2)-1));
+
          H[term] = id;
    end
+
        else
  end | {{{2|zz}}} }}
+
          H[term] = H[term] .. ";" .. id;
|Index/name|{{{3}}}|{{{4|}}} }}
+
        end
|align=center| [[Index:{{{3}}}
+
      end
|align=right| {{Index/persist|name|{{#lua:
+
   local id = stdin:match("%S+");
+
   if (id == "zz") then print("zz");
+
   else if (string.byte(id,2) == 'z') then
+
     print(string.char(string.byte(id,1)+1).."a");
+
  else print(string.sub(id,0,1)..string.char(string.byte(id,2)+1));
+
 
     end
 
     end
 
   end
 
   end
| {{{1|aa}}} }}
+
   table.sort(H);
|{{#lua:
+
   local ret = "";
   local id = stdin:match("%S+");
+
   for k,v in pairs(H) do
   if (id == "aa") then print("zz");
+
    ret = ret .. "*" .. k;
   else if (string.byte(id,2) == 'z') then
+
     for i in string:gmatch("%w+") do
     print(string.char(string.byte(id,1)+1).."a");
+
      ret = ret .. "[[" .. i .."]] &nbsp; ";
  else print(string.sub(id,0,1)..string.char(string.byte(id,2)+1));
+
 
     end
 
     end
 +
    ret = ret .. "\n";
 
   end
 
   end
| {{{2|az}}} }}
+
   print(ret);
|Index/name|{{{3}}}|{{{4|}}}}}
+
|
|}---->
+
{{{1|a}}} {{#SearchLine:Common Name=||{{{2}}}%}}
 
+
{| class="wikitable" style="width=100%; margin: 1em auto; border-width:0px 0px 0px 0px;"
+
|- style="background:#ccf"
+
{{#repeat:IndexTable|1|
+
{{#lua:
+
  local first = stdin:match("%w+");
+
  local last = stdin:match("%w+");
+
  local hash = {};
+
  local idx = {};
+
  for id, names in stdin:gmatch("&&(%w+).Common Name=&&(%S+)") do
+
   print(names);
+
--  for word in string.gmatch(names,"&&[%(%)%[%]%+%-%d%p\"']*([%a]+)[^&]*") do
+
--      print(word);
+
--      if ((string.sub(word,0,1) == string.sub(first,0,1)) and
+
--        (string.byte(first,2) <= string.byte(word,2)) and
+
--        (string.byte(last,2) >= string.byte(word,2)))
+
--      then hash[word] = id; table.insert(idx,word);
+
--    end
+
--  end
+
  end
+
--  table.sort(idx);
+
--  local output = "";
+
--  for id, val in pairs(idx) do
+
--    output = output .. val .."&&".. hash[val] .. "\n";
+
--  end
+
--  print(output);
+
|{{{1}}} {{{2}}} {{#SearchLine:Common Name=|{{{3}}}}}|}}
+
 
}}
 
}}
}}
 
|}
 

Revision as of 19:23, 1 October 2008

名前のインデクス {{{1}}} 値(文字列) {{{2}}} ページタイトル (FL/LB/..) Last updated: 20081001192351

[[Index:{{{2}}}]]


Personal tools
Namespaces

Variants
Actions
Navigation
metabolites
Toolbox