Template:Index/name

From Metabolomics.JP
(Difference between revisions)
Jump to: navigation, search
 
(26 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 = stdin:match("%S+");
+
|align=center| [[Index:{{{2}}}|<big>Back to Index</big>]]
  if (id == "aa") then
+
|align=right| {{#persist:{{{2}}}index/name {{PrevLetter|{{{1}}}}}|go to Index {{NextLetter|{{{1}}}}}|Index/name|2|{{NextLetter|{{{1}}}}};{{{2}}}}}
    print("aa");
+
|}
  else if (string.byte(id,2) == 'a') then
+
<hr>
    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 key = stdin:match("%w+");
    end
+
   local H = {};
  end | {{{1|aa}}} }}
+
  local I = {};
|{{#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; table.insert(I, term);
    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(I);
|{{#lua:
+
   local ret = "";
   local id = stdin:match("%S+");
+
   for i=1,table.getn(I) do
   if (id == "aa") then print("zz");
+
    local k = I[i];
   else if (string.byte(id,2) == 'z') then
+
    ret = ret .. "* '''" .. k;
     print(string.char(string.byte(id,1)+1).."a");
+
     for id in string.gmatch(H[k],"%w+") do
  else print(string.sub(id,0,1)..string.char(string.byte(id,2)+1));
+
      ret = ret .. "'''&nbsp;&nbsp; [[" .. id .."]] &nbsp; ";
 
     end
 
     end
 +
    ret = ret .. "\n";
 
   end
 
   end
| {{{2|az}}} }}
+
   print(ret);
|Index/name|{{{3}}}|{{{4|}}}}}
+
|
|}---->
+
{{{1}}} {{#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}}}}}|}}
+
 
}}
 
}}
}}
+
[[#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