Template:CountryTable
From Metabolomics.JP
(Difference between revisions)
Line 4: | Line 4: | ||
<!---{{#repeat:List_Country/inst_rank|1|---> | <!---{{#repeat:List_Country/inst_rank|1|---> | ||
{{#lua: | {{#lua: | ||
− | local | + | 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 ( | + | if (auCount[inst] == nil) then |
− | + | auCount[inst] = 1; | |
else | else | ||
− | + | 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( | + | 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; | ||
− | + | auCount[num] = 1; | |
else | else | ||
hash[num] = hash[num] .. "; " .. inst; | hash[num] = hash[num] .. "; " .. inst; | ||
− | + | 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 + | + | 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 |
---|