Template:Index/name

From Metabolomics.JP
(Difference between revisions)
Jump to: navigation, search
(New page: <noinclude>名前のインデクス {{{1}}} 最小値(デフォルトaa) {{{2}}} 最大値(デフォルトab) {{{3}}} ページタイトル {{{4}}}ダミー</noinclude> Last update...)
 
 
(44 intermediate revisions by one user not shown)
Line 1: Line 1:
<noinclude>名前のインデクス {{{1}}} 最小値(デフォルトaa) {{{2}}} 最大値(デフォルトab) {{{3}}} ページタイトル {{{4}}}ダミー</noinclude>
+
<noinclude>名前のインデクス {{{1}}} 値(文字列) {{{2}}} ページタイトル (FL/LB/..)</noinclude>
Last updated: {{REVISIONTIMESTAMP}}
+
{{Warning/Persist}}
 +
 
 +
<small>Note: words of less than 4 letters are excluded from the index.</small>
 
{| width=100%
 
{| width=100%
 
|-
 
|-
|align=left| {{Index/persist|name|{{#lua:
+
|align=left| {{#persist:{{{2}}}index/name {{PrevLetter|{{{1}}}}}|go to Index {{PrevLetter|{{{1}}}}}|Index/name|2|{{PrevLetter|{{{1}}}}};{{{2}}}}}
  local id = {{{1|aa}};
+
|align=center| [[Index:{{{2}}}|<big>Back to Index</big>]]
  if (id == "aa") then print("aa");
+
|align=right| {{#persist:{{{2}}}index/name {{PrevLetter|{{{1}}}}}|go to Index {{NextLetter|{{{1}}}}}|Index/name|2|{{NextLetter|{{{1}}}}};{{{2}}}}}
  else if (string.byte(id,2) == 'a') then
+
    print(string.char(string.byte(id,1)-1).."z");
+
  else print(string.sub(id,0,1)..string.char(string.byte(id,2)-1));
+
  end
+
|}}|{{#lua:
+
  local id = {{{2|ab}};
+
  if (id == "aa") then print("aa");
+
  else if (string.byte(id,2) == 'a') then
+
    print(string.char(string.byte(id,1)-1).."z");
+
  else print(string.sub(id,0,1)..string.char(string.byte(id,2)-1));
+
  end
+
|}}|Index/name|{{{3}}}|{{{4|}}}}}
+
|align=center| [[Index:{{{3}}}
+
|align=right| {{Index/persist|name|{{#lua:
+
  local id = {{{1|aa}};
+
  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
+
|}}|{{#lua:
+
  local id = {{{2|ab}};
+
  if (id == "aa") 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
+
|}}|Index/name|{{{3}}}|{{{4|}}}}}
+
 
|}
 
|}
 
+
<hr>
{| class="wikitable" style="width=100%; margin: 1em auto; border-width:0px 0px 0px 0px;"
+
|- style="background:#ccf"
+
{{#repeat:IndexTable|1|
+
 
{{#lua:
 
{{#lua:
   local hash = {};
+
   local key = stdin:match("%w+");
   local idx = {};
+
  local H = {};
   for id, names in stdin:gmatch("&&(%w+)&&(.+)") do
+
   local I = {};
     for word in string.gmatch("&&[%(%)%[%]%+%-%d%p"']*([%a]+)[^&]*") do
+
   for id, name in stdin:gmatch("&&(%w+).Common Name=&&(%S+)") do
      if ((string.sub(word,0,1) == string.sub({{{1}}},0,1)) and
+
    name = string.lower(name);
        (string.byte({{{1}}},2) <= string.byte(word,2)) and
+
     for term in string.gmatch(name,"(%a+)") do
         (string.byte({{{2}}},2) >= string.byte(word,2)))
+
      if ((string.len(term) > 3) and
      then hash[word] = id; table.insert(idx,word);
+
          (string.sub(term,0,1) == key)) then
 +
         if (H[term] == nil) then
 +
          H[term] = id; table.insert(I, term);
 +
        else
 +
          H[term] = H[term] .. ";" .. id;
 +
        end
 
       end
 
       end
 
     end
 
     end
 
   end
 
   end
   table.sort(idx);
+
   table.sort(I);
   local output = "";
+
   local ret = "";
   for id, val in pairs(idx) do
+
   for i=1,table.getn(I) do
     output = output .. val .."&&".. hash[val] .. "\n";
+
     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
 
   end
   print(output);
+
   print(ret);
|{{#SearchLine:Common Name=||{{{3}}}}} }}
+
|
 +
{{{1}}} {{#SearchLine:Common Name=||{{{2}}}%}}
 
}}
 
}}
}}
+
[[#top]]
|}
+

Latest revision as of 02:59, 25 March 2009

名前のインデクス {{{1}}} 値(文字列) {{{2}}} ページタイトル (FL/LB/..) Do not edit! This page is automatically generated using Persist function (Last updated: 20090325025941).

Note: words of less than 4 letters are excluded from the index.

[[Index:{{{2}}}|Back to Index]]



#top

Personal tools
Namespaces

Variants
Actions
Navigation
metabolites
Toolbox