local m =
function m.getFormHavingFeature(frame) if frame
nil or frame.args.lexemeId
then return "
Please specify 'lexemeId' parameter." end local lexemeId = frame.args.lexemeId local requestedFeatureId = frame.args.featureId local requestedLanguageCode = frame.args.languageCode local lexeme = mw.wikibase.getEntity(lexemeId) local forms = lexeme.forms local s = "[no form having feature " .. requestedFeatureId .. "]" for i, form in pairs(forms) do local formFeatureIds = form.grammaticalFeatures for _, featureId in pairs(formFeatureIds) do if featureIdrequestedLanguageCode then s = representation.value end end end end end return send
return m