Template:Index/name
From Metabolomics.JP
(Difference between revisions)
(25 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
<noinclude>名前のインデクス {{{1}}} 値(文字列) {{{2}}} ページタイトル (FL/LB/..)</noinclude> | <noinclude>名前のインデクス {{{1}}} 値(文字列) {{{2}}} ページタイトル (FL/LB/..)</noinclude> | ||
− | + | {{Warning/Persist}} | |
+ | <small>Note: words of less than 4 letters are excluded from the index.</small> | ||
{| width=100% | {| width=100% | ||
|- | |- | ||
− | |align=left| {{#persist: | + | |align=left| {{#persist:{{{2}}}index/name {{PrevLetter|{{{1}}}}}|go to Index {{PrevLetter|{{{1}}}}}|Index/name|2|{{PrevLetter|{{{1}}}}};{{{2}}}}} |
− | |align=center| [[Index:{{{2}}}]] | + | |align=center| [[Index:{{{2}}}|<big>Back to Index</big>]] |
− | |align=right| {{#persist: | + | |align=right| {{#persist:{{{2}}}index/name {{PrevLetter|{{{1}}}}}|go to Index {{NextLetter|{{{1}}}}}|Index/name|2|{{NextLetter|{{{1}}}}};{{{2}}}}} |
|} | |} | ||
− | + | <hr> | |
{{#lua: | {{#lua: | ||
− | |||
local key = stdin:match("%w+"); | local key = stdin:match("%w+"); | ||
local H = {}; | local H = {}; | ||
+ | local I = {}; | ||
for id, name in stdin:gmatch("&&(%w+).Common Name=&&(%S+)") do | for id, name in stdin:gmatch("&&(%w+).Common Name=&&(%S+)") do | ||
name = string.lower(name); | name = string.lower(name); | ||
Line 19: | Line 20: | ||
(string.sub(term,0,1) == key)) then | (string.sub(term,0,1) == key)) then | ||
if (H[term] == nil) then | if (H[term] == nil) then | ||
− | H[term] = id; | + | H[term] = id; table.insert(I, term); |
else | else | ||
H[term] = H[term] .. ";" .. id; | H[term] = H[term] .. ";" .. id; | ||
Line 26: | Line 27: | ||
end | end | ||
end | end | ||
− | table.sort( | + | table.sort(I); |
local ret = ""; | local ret = ""; | ||
− | for | + | for i=1,table.getn(I) do |
− | ret = ret .. "*" .. k; | + | local k = I[i]; |
− | for | + | ret = ret .. "* '''" .. k; |
− | ret = ret .. "[[" .. | + | for id in string.gmatch(H[k],"%w+") do |
+ | ret = ret .. "''' [[" .. id .."]] "; | ||
end | end | ||
ret = ret .. "\n"; | ret = ret .. "\n"; | ||
Line 37: | Line 39: | ||
print(ret); | print(ret); | ||
| | | | ||
− | {{{1 | + | {{{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]] |