Modul:Wikidata/Sorters/rank
Vzhled
require 'Modul:No globals'
local p = {}
local lib = require 'Modul: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