45,647
edits
Tag: Undo |
No edit summary Tag: Reverted |
||
Line 599: | Line 599: | ||
end | end | ||
--[[ If language is an etymology language, iterates through | --[==[If the language is an etymology language, this iterates through parents until a regular language or family is found, and the corresponding object is returned. If the language is a regular language, then it simply returns the language.]==] | ||
function export.getNonEtymological() | |||
function export.getNonEtymological( | if not self._nonEtymologicalObject then | ||
local nonEtymologicalCode = self:getNonEtymologicalCode() | |||
local | if nonEtymologicalCode ~= self:getCode() then | ||
self._nonEtymologicalObject = export.getByCode(nonEtymologicalCode, nil, nil, nil, useRequire) | |||
else | |||
self._nonEtymologicalObject = self | |||
end | |||
end | end | ||
return self._nonEtymologicalObject | |||
end | |||
return | function export.getNonEtymologicalCode() | ||
return self._nonEtymologicalCode or self:getCode() | |||
end | |||
function export.getNonEtymologicalName() | |||
if self._nonEtymologicalName == nil then | |||
local nonEtymological = self:getNonEtymological() | |||
if nonEtymological then | |||
self._nonEtymologicalName = nonEtymological:getCanonicalName() | |||
else | |||
self._nonEtymologicalName = false | |||
end | |||
end | |||
return self._nonEtymologicalName or nil | |||
end | end | ||
return export | return export |