Template:CountryTable

From Metabolomics.JP
(Difference between revisions)
Jump to: navigation, search
 
(40 intermediate revisions by one user not shown)
Line 1: Line 1:
 +
{{#def:namespace|Reference}}
 +
[[Reference:Country|«UP one level]]
 +
<small>To add/edit your information, click the edit tab above, and edit "&&"-separated information. (Remember to use "&&"!)</small>
 
<table>
 
<table>
<th colspan=2>Top 5 institutes in this country</th>
+
<th colspan=2>Top 5 institutes in this country (total {{#count:{{{1|}}}}} authors)</th>
 
<tr><td>
 
<tr><td>
 +
{{#repeat:List_Country/inst_rank|1|
 
{{#lua:
 
{{#lua:
   local count = {};
+
   local auCount = {};
   local au, inst;
+
   for au, inst, cy in stdin:gmatch("&?&?([%w\. ]+)&&([%w\., ]+)&&([^\n]+)") do
  for word in stdin:gmatch("[%w&\._]+") do
+
    au = string.match(word,"([%a\._]+)&&");
+
    print(word .. ":" .. au);
+
 
     if (inst ~= nil) then
 
     if (inst ~= nil) then
       if (count[inst] == nil) then
+
       if (auCount[inst] == nil) then
         count[inst] = 1;
+
         auCount[inst] = 1;
 
       else
 
       else
         count[inst] = count[inst] + 1;
+
         auCount[inst] = auCount[inst] + 1;
 
       end
 
       end
 
     end
 
     end
Line 18: Line 19:
 
   local hash = {};
 
   local hash = {};
 
   local list = {};
 
   local list = {};
   for inst, c in pairs(count) do
+
  local afCount = {};
     table.insert(list, c);
+
   for inst, num in pairs(auCount) do
     if (hash[c] == nil) then  
+
     table.insert(list, num);
       hash[c] = inst;
+
     if (hash[num] == nil) then  
 +
       hash[num] = inst;
 +
      afCount[num] = 1;
 
     else
 
     else
       hash[c] = hash[c] .. ";" .. inst;
+
       hash[num] = hash[num] .. "; " .. inst;
 +
      afCount[num] = afCount[num] + 1;
 
     end
 
     end
 
   end
 
   end
Line 29: Line 33:
 
   local i=0;
 
   local i=0;
 
   local output = "";
 
   local output = "";
   local num;
+
   local num, inst;
 
   while(i < 5) do
 
   while(i < 5) do
 
     num = table.remove(list);
 
     num = table.remove(list);
 
     if (num == nil) then break; end
 
     if (num == nil) then break; end
 
     inst = hash[num];
 
     inst = hash[num];
     i = i + 1;
+
     i = i + afCount[num];
     output = output .. inst .. " (" .. num .." authors);";
+
     output = output .. inst .. " (" .. num .." authors)&&";
 
   end
 
   end
 
   print(output);
 
   print(output);
|{{{1|}}}
+
|{{{1|}}} }}
}}
+
|&&}}
 
</td>
 
</td>
  
Line 53: Line 57:
 
{{#repeatNum: TableRow3/Country|3|
 
{{#repeatNum: TableRow3/Country|3|
 
<!---START OF Author & Affiliation & Country --->
 
<!---START OF Author & Affiliation & Country --->
{{{1|}}}
+
{{#ifeq:{{#substring:{{{1|}}}|0|2}}|&&|{{#cdr:{{{1|}}}|&&}}|{{{1|}}}}}
 
<!---END OF Author & Affiliation & Country --->
 
<!---END OF Author & Affiliation & Country --->
 
|&&}}
 
|&&}}
 
|}
 
|}

Latest revision as of 01:39, 7 December 2010

«UP one level To add/edit your information, click the edit tab above, and edit "&&"-separated information. (Remember to use "&&"!)

Top 5 institutes in this country (total 0 authors)
Author Affiliation Country
Personal tools
Namespaces

Variants
Actions
Navigation
metabolites
Toolbox