Template:Index/formula

From Metabolomics.JP
(Difference between revisions)
Jump to: navigation, search
 
(11 intermediate revisions by one user not shown)
Line 1: Line 1:
<noinclude>名前のインデクス {{{1}}} 原子 {{{2}}} 数 {{{3}}} ページタイトルと名前のリスト(&&区切り){{{4}}} ダミー</noinclude>
+
<noinclude>名前のインデクス {{{1}}} 原子 {{{2}}} 数 {{{3}}} ページタイトル {{{4}}} タイトル候補リスト(&&区切り)</noinclude>
Last updated: {{REVISIONTIMESTAMP}}
+
{{Warning/Persist}}
 +
 
 
{| width=100%
 
{| width=100%
 
|-
 
|-
 
|align=left|
 
|align=left|
{{#repeat:
+
{{#repeat:Index/persist|6|{{#cdr:
{{Index/persist|formula|{{{1}}}|{{{2}}}|Index/formula|{{{3}}}|}}
+
  {{#lua:
 +
  local output = "";
 +
  for id in stdin:gmatch("&&(%w+)") do
 +
    output = output.."%formula%{{{1}}}%{{#expr:{{{2}}}-1}}%Index/formula%"..id.."%{{{4}}}";
 +
  end
 +
  print(output); |{{{4}}} }} |%}}|%}}
 +
|align=center| [[Index:{{{3}}}|<big>Back to Index</big>]]
 
|align=right|
 
|align=right|
{{Index/persist|formula|{{{1}}}|{{{2}}}|Index/formula|{{{3}}}|}}
+
{{#repeat:Index/persist|6|{{#cdr:
 +
  {{#lua:
 +
  local id;
 +
  local output = "";
 +
  for id in stdin:gmatch("&&(%w+)") do
 +
    output = output.."%formula%{{{1}}}%{{#expr:{{{2}}}+1}}%Index/formula%"..id.."%{{{4}}}";
 +
  end
 +
  print(output);|{{{4}}} }} |%}}|%}}
 
|}
 
|}
 
+
<hr>
 
{| class="wikitable" style="width=100%; margin: 1em auto; border-width:0px 0px 0px 0px;"
 
{| class="wikitable" style="width=100%; margin: 1em auto; border-width:0px 0px 0px 0px;"
 
|- style="background:#ccf"
 
|- style="background:#ccf"
 
{{#repeat:IndexTable|1|
 
{{#repeat:IndexTable|1|
 
{{#lua:
 
{{#lua:
   local id, atom, num, pat;
+
   local id, formula;
 +
  local pat = "{{{1|C}}}{{{2|20}}}";
 
   local hash = {};
 
   local hash = {};
 
   local idx = {};
 
   local idx = {};
  local first = true;
 
 
   for id, formula in stdin:gmatch("&&(%w+)&&([%a%d]+)") do
 
   for id, formula in stdin:gmatch("&&(%w+)&&([%a%d]+)") do
     if (first) then ---:はじめの値は元素記号とその数
+
     if (formula.match(formula, pat) ~= null) then
      atom = id;
+
      if (hash[formula] == null)
    num = formula;
+
        then hash[formula] = id;
    first = false;
+
          table.insert(idx, formula);
    pat = id..formula.."[$A-Z]";
+
        else hash[formula] = hash[formula].."&&"..id;
    else
+
      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
 
     end
Line 40: Line 47:
 
   end
 
   end
 
   print(output);
 
   print(output);
|&&{{{1|C}}}&&{{{2|20}}} {{#formula:{{{3|FL1C99}}}}}
+
|{{#formula:{{{3|FL1C99}}}}}
 
}}
 
}}
 
}}
 
}}
 
|}
 
|}

Latest revision as of 03:01, 25 March 2009

名前のインデクス {{{1}}} 原子 {{{2}}} 数 {{{3}}} ページタイトル {{{4}}} タイトル候補リスト(&&区切り) Do not edit! This page is automatically generated using Persist function (Last updated: 20090325030110).

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

Personal tools
Namespaces

Variants
Actions
Navigation
metabolites
Toolbox