Module:Wikidata/Sorters/rank
Εμφάνιση
< Module:Wikidata | Sorters
![](http://178.128.105.246/cars-http-upload.wikimedia.org/wikipedia/commons/thumb/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg/50px-Test_Template_Info-Icon_-_Version_%282%29.svg.png)
--require "Module:No globals"
local p = {}
local lib = require 'Module:Wikidata/lib'
local rankToNumber = {
preferred = -1,
normal = 0,
deprecated = 1,
}
function p.isCompleteStatement(statement)
return true
end
function p.mayCompareStatement(statement)
return true
end
local function getNumber(statement)
return rankToNumber[statement.rank]
end
function p.compareStatements(first, second)
return lib.simpleCompare(getNumber(first), getNumber(second))
end
return p