it-noun problem

it-noun problem

Hi there. The {{it-noun}} template always used to generate the headword as a concatenation of positional parameters #1 and #3, but now it seems to just use the pagename. Most of the time this doesn't make any difference, but in the case of multiword nouns, the individual parts are no longer wikified. See tuba di Falloppio as an example. I'm pretty sure that the original Luafied template worked OK. I don't know how to correct it as I can't understand what the module does any more.

SemperBlotto (talk)15:34, 6 September 2013

I fixed it by using head= to specify the headword. I don't really understand why the template's parameters weren't simplified as part of the conversion to Lua. They really don't make much sense.

CodeCat15:38, 6 September 2013

Seems that both it-noun and it-adj have been converted to Lua for the sake of it, with no improvements in the functionality.

Mglovesfun (talk)15:48, 6 September 2013

I thought the idea of converting to Lua was to make them go faster. I could have converted them to be in line with other, more recent templates, without such a conversion. If I was starting from scratch, they would have head=, pl= and such like keyword parameters. Using the {{head}} template instead would mean that the bot wouldn't generate the plural and it would need to be done manually.

SemperBlotto (talk)16:02, 6 September 2013

Lua is definitely not just for speed. It also has a lot more features that make certain tasks much easier. Generating inflected forms is certainly one of those tasks. The current setup, with separate parameters giving the stem and the ending, is really unnecessary for Lua because Lua can do string matching and replacement. The module could easily detect that the page name ends in -o and just replace that with -i to form the plural. So then only one parameter, the gender, would be needed for most nouns.

CodeCat16:11, 6 September 2013
 

I've created two Lua functions and added them to Module:it-head, although they are not used for anything yet. They create a default plural form and feminine.

CodeCat16:32, 6 September 2013

Well, if you are ever going to actually use them, you must take full responsibility for testing them. There are Italian irregular nouns of both genders that end in almost any vowel. You might also like to take over running the bot.

SemperBlotto (talk)16:38, 6 September 2013

If you see what we did with {{fro-noun}}, we changed the automatic defaults and then I removed the redundant parameters manually. For los for example, {{fro-noun|m|los|los}} I changed using AWB to {{fro-noun|m}} (the Lua makes it so the plural of anything ending in s is identical to the singular). Obviously we don't be removing parameters from Italian nouns in the same way, as there are too many of them.

While we're at it, the template should be able to handle invariable nouns, especially anything ending in a consonant and a couple of borrowed words from French ending in -é.

Mglovesfun (talk)16:42, 6 September 2013

I will make sure to test it by using existing entries as the test. I will make it so that the automatically-generated forms are compared to the forms that are currently given in the entries, and only in entries where they match, the extra parameters will be removed as they are redundant then.

For adjectives it could probably be just {{it-adj}} with no parameters at all, which should work for most adjectives. I will use the above method to see which adjectives do not work with the default, and then see what extra parameters are needed to account for the exceptions.

For {{it-noun}} I suggest changing the parameters to: {{it-noun|gender|plural form}}. Most of the time, you would be able to use just {{it-noun|gender}} and use the default, but this lets you account for plurals that don't match the default generated one. Transitioning to the new parameters may be a bit difficult because the gender will shift from the second to the first place. I think I will make that change first, by temporarily letting the template accept the gender and stem in either order. If the first parameter is a valid gender, it would use that and the second for the stem; otherwise swap them and use the first for the stem and the second for the gender. This way, the template remains compatible with existing entries and gives us time to switch over to the new parameter order.

In the function I wrote, it first tries the endings -o, -a, -e. The word ends in none of those, it just gives back the singular form.

CodeCat16:50, 6 September 2013

You can add the following to your default plurals:- 1) for masculine -co => -chi and -go => -ghi 2) for feminine -ca => -che and -ga => -ghe. That should reduce the numbers in your tracking/pl/needed category.

SemperBlotto (talk)15:11, 7 September 2013

The Wikipedia page said that there wasn't really a definite rule for such nouns. Is that wrong?

CodeCat15:17, 7 September 2013