Module talk:User:Victar/iir-decl-noun

From Wiktionary, the free dictionary
Latest comment: 5 years ago by Victar in topic Collapsible table
Jump to navigation Jump to search

@KarikaSlayer I'm trying to destress the declension suffixes when there is stress on the stem. You know this module better than I do, it being based on the PGmc one. Where should I be applying this? --Victar (talk) 18:02, 1 September 2017 (UTC)Reply

@Victar For the thematic stems at least, the easiest way would be to make decl_data["á-m"] ["á-n"] ["áH-f"] with the stressed endings and have the current a-m a-n aH-f be for unstressed endings. For athematic stems, probably something similar (one decl_data entry per inflection per accent paradigm) could be done. KarikaSlayer (talk) 19:38, 1 September 2017 (UTC)Reply
@KarikaSlayer: Hmm, well, right now I have a destress() gsub function based on the one in Module:ine-common and:
local stem_stressed = false
if mw.ustring.gmatch(stem, "[áíĺḿńŕúā́]") then stem_stressed = true end
So what I need is a place to put if stem_stressed then destress(data.forms[i]) end --Victar (talk) 20:18, 1 September 2017 (UTC)Reply
@Victar: I'm pretty sure destress(data.forms[i]) would destress the stem too. You'd have to add it where the ending is added (e.g. args[1] .. (args.stem_stressed and "ás" or "as")) KarikaSlayer (talk) 20:48, 1 September 2017 (UTC)Reply
@KarikaSlayer: Right, so that's what I'm asking. =) Where specifically can I add it to in that would only affect the declension suffix? --Victar (talk) 22:09, 1 September 2017 (UTC)Reply
@Victar: You'll have to pass each inflectional ending string in the decl_data functions to destress(), e.g. data.forms["nom_sg"] = {args[1] .. destress_if_stressed("ás", args.stem_stressed)}
and then
function destress_if_stressed(ending, stem_stressed)
if stem_stressed then
-- destress() code goes here
end
end
KarikaSlayer (talk) 22:50, 1 September 2017 (UTC)Reply
Thanks @KarikaSlayer:. I'm having the problem now though that it's de-stressing all endings, ex. *yugám. Could you have a look at it when you have a moment? --Victar (talk) 22:23, 2 September 2017 (UTC)Reply
@Victar: Should be fixed now. Apparently it thought the thematic vowel was part of the stem. KarikaSlayer (talk) 23:24, 2 September 2017 (UTC)Reply
@KarikaSlayer: Hey, hey, thanks! --Victar (talk) 23:27, 2 September 2017 (UTC)Reply

Identical nominative ending

[edit]

@KarikaSlayer The masc and fem i-stems have the same nominative ending. I'd like it to default to masc and only require people to add |g=f if it's fem. Is that possible with the current coding, or do I need to pass gender to /data? Thanks. --Victar (talk) 00:23, 7 September 2017 (UTC)Reply

I figured it out. Thanks though. --Victar (talk) 02:41, 7 September 2017 (UTC)Reply

Collapsible table

[edit]

Hi @Erutuon, I'm trying to collapse the vocative and instrumental-locative rows like done in done in Module:ine-nominals. I tried something like (index == 1 or index == 7) and "class=\"vsShow\"" or "class=\"vsHide\"", but no luck. If you have a second, could you have a look? --Victar (talk) 17:51, 8 November 2018 (UTC)Reply

@Victar: Probably what's causing problems with this is operator precedence: concatenation (..) has higher precedence than and or or, so prefix .. x and a or b .. suffix is parsed as ((prefix .. x) and a) or (b .. suffix). You want parentheses around x and a or b: prefix .. (x and a or b) .. suffix. — Eru·tuon 18:57, 8 November 2018 (UTC)Reply
Thanks, @Erutuon, that did the trick! --Victar (talk) 05:08, 9 November 2018 (UTC)Reply