Template:Index/formula
From Metabolomics.JP
(Difference between revisions)
| Line 4: | Line 4: | ||
|- | |- | ||
|align=left| | |align=left| | ||
| − | {{#repeat: | + | {{#repeat:Index/persist|6| |
| − | + | {{#lua: | |
| + | local id; | ||
| + | local output = ""; | ||
| + | for id in stdin:gmatch("&&(%w+)") do | ||
| + | output = output.."%formula%{{{1}}}%{{#expr:{{{2}}}-1}}%Index/formula%"..id.."%{{{3}}}"; | ||
| + | end | ||
| + | print(output);|{{{3}}} }} | ||
| + | |%}} | ||
| + | |align=center| [[Index:{{#substring:{{{4}}}|0|2}}|Back to Index]] | ||
|align=right| | |align=right| | ||
| − | {{Index/persist| | + | {{#repeat:Index/persist|5| |
| + | {{#lua: | ||
| + | local id; | ||
| + | local output = ""; | ||
| + | for id in stdin:gmatch("&&(%w+)") do | ||
| + | output = output.."%formula%{{{1}}}%{{#expr:{{{2}}}+1}}%Index/formula%"..id.."%{{{3}}}"; | ||
| + | end | ||
| + | print(output);|{{{3}}} }} | ||
| + | |%}} | ||
|} | |} | ||
| Line 14: | Line 30: | ||
{{#repeat:IndexTable|1| | {{#repeat:IndexTable|1| | ||
{{#lua: | {{#lua: | ||
| − | local id, | + | local id, formula; |
| + | local pat = "{{{1|C}}}".."{{{2|20}}}[$A-Z]"; | ||
local hash = {}; | local hash = {}; | ||
local idx = {}; | local idx = {}; | ||
| − | |||
for id, formula in stdin:gmatch("&&(%w+)&&([%a%d]+)") do | for id, formula in stdin:gmatch("&&(%w+)&&([%a%d]+)") do | ||
| − | + | if (formula.match(formula, pat) ~= null) then | |
| − | + | if (hash[formula] == null) | |
| − | + | then hash[formula] = id; | |
| − | + | table.insert(idx, formula); | |
| − | + | else hash[formula] = hash[formula].."&&"..id; | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
end | end | ||
end | end | ||
| Line 40: | Line 49: | ||
end | end | ||
print(output); | print(output); | ||
| − | | | + | |{{#formula:{{{3|FL1C99}}}}} |
}} | }} | ||
}} | }} | ||
|} | |} | ||
Revision as of 10:51, 2 May 2008
名前のインデクス {{{1}}} 原子 {{{2}}} 数 {{{3}}} ページタイトルと名前のリスト(&&区切り){{{4}}} ダミー Last updated: 20080502105101
| [[Index:{{|Back to Index]] |