Template:CountryTable

From Metabolomics.JP
(Difference between revisions)
Jump to: navigation, search
Line 4: Line 4:
 
<!---{{#repeat:List_Country/inst_rank|1|--->
 
<!---{{#repeat:List_Country/inst_rank|1|--->
 
{{#lua:
 
{{#lua:
   local count = {};
+
   local auCount = {};
 
   local au, inst;
 
   local au, inst;
 
   for au, inst, cy in stdin:gmatch("&?&?([%w\. ]+)&&([%w\., ]+)&&([^\n]+)") do
 
   for au, inst, cy in stdin:gmatch("&?&?([%w\. ]+)&&([%w\., ]+)&&([^\n]+)") do
 
     print(inst .."\n");
 
     print(inst .."\n");
 
     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 18:
 
   local hash = {};
 
   local hash = {};
 
   local list = {};
 
   local list = {};
   for inst, num in pairs(count) do
+
   for inst, num in pairs(auCount) do
 
     table.insert(list, num);
 
     table.insert(list, num);
 
     print(inst .. ":" .. num .."\n");
 
     print(inst .. ":" .. num .."\n");
 
     if (hash[num] == nil) then  
 
     if (hash[num] == nil) then  
 
       hash[num] = inst;
 
       hash[num] = inst;
       count[num] = 1;
+
       auCount[num] = 1;
 
     else
 
     else
 
       hash[num] = hash[num] .. "; " .. inst;
 
       hash[num] = hash[num] .. "; " .. inst;
       count[num] = count[num] + 1;
+
       auCount[num] = auCount[num] + 1;
 
     end
 
     end
 
   end
 
   end
Line 37: Line 37:
 
     if (num == nil) then break; end
 
     if (num == nil) then break; end
 
     inst = hash[num];
 
     inst = hash[num];
     i = i + count[num];
+
     i = i + auCount[num];
 
     output = output .. inst .. " (" .. num .." authors)&&";
 
     output = output .. inst .. " (" .. num .." authors)&&";
 
   end
 
   end

Revision as of 14:02, 15 September 2008

Top 5 institutes in this country


Author Affiliation Country
Personal tools
Namespaces

Variants
Actions
Navigation
metabolites
Toolbox