Module talk:headword

Edit request
[//en.wiktionary.org/w/index.php?title=Module:User:ZxxZxxZ/headword&oldid=20273642] (it is tested) --Z 14:22, 26 April 2013 (UTC)
 * Not done until it is discussed more widely and the issues with the current template have been worked out. This edit affects thousands of pages, and I currently have no guarantee that it will work. "it is tested" is not good enough. 14:28, 26 April 2013 (UTC)
 * But why did you implemented your own change which, as you said, has issues and affected many pages without any disccussion? Btw, I intentionally created it as a subpage of the module so that other people can also work on it. --Z 14:40, 26 April 2013 (UTC)
 * The difference is that I am working to fix all of those issues right at this moment. And what benefit does allowing many people to work on such a critical template have? The fact that you continue to make changes to Module:links makes me very hesitant to use that module. I would rather use something that is stable, mature, well-understood, and not subject to many revisions. That is one of the reasons why I don't feel comfortable making your changes, they change too much and I don't have any guarantees that they will not break something badly. With code that I write myself I do have that guarantee to a significant degree, because I do understand the code that I write. The fact that even my own code still causes problems should be enough of a reason to reject someone else's code that I don't know anything about. 14:50, 26 April 2013 (UTC)
 * Ok, I see. Except this part: "I would rather use something that is stable, mature, well-understood, and not subject to many revisions. ... I don't have any guarantees that they will not break something badly", Module:links is tested and is widely used. --Z 15:16, 26 April 2013 (UTC)

Italicized Tamil when it shouldn't be
E.g. on அக்கினி. Also when in. --Ivan Štambuk (talk) 02:19, 8 August 2013 (UTC)
 * I don't see italics on that page anywhere...? 11:01, 8 August 2013 (UTC)
 * In the headword line, I've tried in three different browsers and in shows in italics. --Ivan Štambuk (talk) 18:28, 8 August 2013 (UTC)
 * The headword line displays in regular style for me. Maybe you need to refresh your CSS? If you have Firefox, can you go to the page and press ctrl+shift+I to open the document inspector. Then click on the headword, and see what styles it assigns to it in the bottom right. 20:11, 8 August 2013 (UTC)
 * Italic for me as well. --Vahag (talk) 20:51, 8 August 2013 (UTC)
 * Normal for me. --Z 21:07, 8 August 2013 (UTC)
 * I'm not sure, but it could be a Windows-only problem. --Ivan Štambuk (talk) 06:13, 9 August 2013 (UTC)

Overriding manual translit
Overriding manual transliteration does not work for this module. --Vahag (talk) 17:02, 30 August 2013 (UTC)
 * It is broken again. --Vahag (talk) 12:41, 13 January 2014 (UTC)
 * Where is it broken? 14:44, 13 January 2014 (UTC)
 * I noticed override isn't working here. and  are fine. --Vahag (talk) 15:00, 13 January 2014 (UTC)
 * I'm not sure what's wrong with the entry. Is the transliteration not correct? 15:06, 13 January 2014 (UTC)
 * The manual transliteration is not correct. It uses a deprecated scheme. There are thousands such entries, found in Category:Terms with manual transliterations different from the automated ones/hy. Overriding the old manual transliteration is necessary here. Until recently used to do that and put the entry into the category I mentioned. But now it does neither. --Vahag (talk) 15:18, 13 January 2014 (UTC)
 * I don't think it was done by a recent change. I'm looking through older revisions of the module but I don't see any code that could override it. I don't think it's actually broken, it was just never done in the first place. 16:23, 13 January 2014 (UTC)
 * Hmmm, now that I think about it, maybe it was never implemented. “overrides” manual transliteration not because it's a feature of, but because I used to supply transliteration as its first parameter and  requires tr= for transliteration, so my wrong transliterations are effectively ignored. --Vahag (talk) 17:19, 13 January 2014 (UTC)
 * If we want this overriding to work, we really need to put it somewhere that all templates and modules can/will use it. But it's kind of kludgey right now, there's a list of languages in the module itself... not really the nicest way to do it. I do have some ideas for now to improve it, but it would need to wait a bit until some current changes have been fully done. We're in the middle of a reorganisation with Module:languages right now. 17:23, 13 January 2014 (UTC)


 * The current list of languages with override_translit is here: Module:links. --Anatoli (обсудить/вклад) 21:57, 13 January 2014 (UTC)
 * I think once the changes have settled down a bit, we can look at how to incorporate transliterations into Module:languages more directly. Then we wouldn't need the "transliterate" function in Module:script utilities anymore. 22:42, 13 January 2014 (UTC)

Variants of an inflection
Is there any support for variants of one inflection? I.e. (neuter #|variant1/#|variant2). --Njardarlogar (talk) 13:16, 1 December 2013 (UTC)
 * You can use "or", like allows.  14:32, 1 December 2013 (UTC)
 * 1 extra character versus 4. If there are e.g. 4 inflections with a variant, that's 16 extra characters compared to 4. Not ideal. --Njardarlogar (talk) 15:03, 1 December 2013 (UTC)
 * Then show four inflections with variants in a declension table below. The headword line isn't made of rubber. --Vahag (talk) 15:08, 1 December 2013 (UTC)
 * Which is why I want to limit the number of extra characters: so that the information will fit. Tables are more complicated to make and maintain; and they are unnecessary for languages with limited inflection. --Njardarlogar (talk) 15:39, 1 December 2013 (UTC)
 * The syntax } seems to work, so that is an alternative. --Njardarlogar (talk) 15:42, 1 December 2013 (UTC)
 * Just because it works doesn't mean it's desirable to do it... 16:23, 1 December 2013 (UTC)
 * Is it likely to become invalid syntax in the future? If not, I don't see the big issue. Nope, it's not desirable. --Njardarlogar (talk) 16:41, 1 December 2013 (UTC)
 * It's not likely to become invalid, but it does obscure the semantics (in template/module terms). That is, the module itself isn't able to "see" that there are really two words there, unless it decides to piece apart the whole thing (splitting the  and / ). For the short term it's not a huge problem, but it can give problems in the long term if we ever want to change things. For example, we could decide, later on, that we want to show something else instead of "or". If you use "or" now, then that's easy to do, but not when you put it all into one parameter. Being more explicit about what you mean and not so explicit about what you want to see is good practice in templates/modules, as well as in web pages generally.  16:55, 1 December 2013 (UTC)
 * What about adding support for arrays? Are slashes frowned upon? I noted that the documentation already talks about using links in the argument (the voorbeelden example), so introducing two of them doesn't seem that terribly revolutionary; even if not the same. --Njardarlogar (talk) 13:10, 7 December 2013 (UTC)
 * I've thought of using arrays/tables but they're not supported in templates, so there would be no gain in that respect anyway. You'd still need to use "or" to signal to that you want both terms to be in the same array.  14:25, 7 December 2013 (UTC)

Sorting
How do you set the sorting key in templates? E.g or, so that entries don't get into Category:Sort key tracking/needed, set in Module:utilities? --Anatoli (обсудить/вклад) 04:09, 3 April 2014 (UTC)
 * That category is added if the sort key was specified, but it didn't match the automatically generated one. I don't know if we still need it though... the main purpose was so that we could find out which languages still needed auto-generation rules, and which entries had sort= parameters that needed to be removed. 12:50, 8 April 2014 (UTC)
 * should sort Mandarin nouns by "pint" (hopefully), as it says on the first line, by the term itself, if it's in Roman script or the Roman spelling of the Han character term. How can the automatically generated sort key be changed, is any change required to the templates? --Anatoli (обсудить/вклад) 13:32, 8 April 2014 (UTC)
 * has a  parameter, so if the templates use, then they can just use that.  14:01, 8 April 2014 (UTC)

linking to same page when it's an inflected form
At [[bonefish]], displays plural  bonefish  rather than the expected plural bonefish as it used to. I guess line 120 here — part = m_links.full_link(not parts.nolink and part.term or nil, part.alt or (parts.nolink and part.term or nil), lang, part.sc, "bold", part.id, {genders = part.genders, tr = "-"}, FULLPAGENAME) — should be modified somehow to fix this. Or maybe something else should. &#x200b;—msh210℠ (talk) 05:44, 8 April 2014 (UTC)
 * The "selflink" part is added by the software itself. It's done whenever someone links to the current page, like here: Module talk:headword. 12:48, 8 April 2014 (UTC)
 * I was aware of that. But that's only if generates a link, which it shouldn't and didn't use to. &#x200b;—msh210℠ (talk) 17:39, 8 April 2014 (UTC)
 * I'm not sure if I understand. I don't see a link anywhere in the code you showed above. In fact the wiki software is explicitly preventing a link to the same page from being created. 17:41, 8 April 2014 (UTC)
 * The  is the effect of the template's presenting the plural form as a wikilink: the software realizes the link would be to the same page and makes it strong (boldfaced) instead. That's what I meant by "  generates a link": it generates a link for the plural form, which, in this case because the plural form matches the pagename, it shouldn't and the software converts to boldface. (Have some Madeira, m'dear.) &#x200b;—msh210℠ (talk) 03:56, 9 April 2014 (UTC)
 * always used to do this. --WikiTiki89 18:20, 8 April 2014 (UTC)
 * My memory misserves me! Looking at [//en.wiktionary.org/?action=edit&oldid=8900143] at least, it seems you're right. Thanks for the correction. So I'm wrong that the template's doing different form what it used to: but I think it should. I suppose that's a discussion for the BP, though, not here. &#x200b;—msh210℠ (talk) 03:56, 9 April 2014 (UTC)

Continued discussion at [[Wiktionary:Beer parlour/2014/June]]. &#x200b;—msh210℠ (talk) 17:39, 11 June 2014 (UTC)
 * I am not sure if the discussion in the beer parlour reached any conclusion. I tried a [ simple fix] to avoid a bolded selflink. I think it works fine. --Vriullop (talk) 14:18, 29 July 2014 (UTC)
 * The discussion did reach a conclusion. The solution is to modify the CSS, not the module. The module is fine. —CodeCat 14:26, 29 July 2014 (UTC)
 * Sorry, I was confused because it has not been done till right now. Thanks. --Vriullop (talk) 15:27, 29 July 2014 (UTC)
 * Is it fixed now? —CodeCat 15:52, 29 July 2014 (UTC)
 * Yes. The two words of bonefish are identical now with Firefox. Before, the second one was extra bolded. --Vriullop (talk) 18:31, 29 July 2014 (UTC)

"transliteration needed" for Serbo-Croatian Cyrillic headwords
This obnoxious message now appears in the headwords, but it shouldn't (e.g. on, ). --Ivan Štambuk (talk) 15:48, 6 October 2014 (UTC)
 * See the GP discussion. —CodeCat 15:50, 6 October 2014 (UTC)

Duplicates
Would it be natural for this module to filter out duplicates? Right now, it happily displays

rather than
 * fruppic tense WADIWU or WADIWU
 * fruppic tense WADIWU.

--Njardarlogar (talk) 10:50, 18 December 2014 (UTC)

th
Please add ["th"] = true, to notranslit to leave transliteration blank in Thai headword. --Octahedron80 (talk) 06:10, 24 February 2016 (UTC)
 * I've added but it's still attempting to autotransliterate. See the current strange behaviour at สร้าง. The pronunciation section shows the correct transliteration - "sâang", the headword shows "srâang" (it's wrong). --Anatoli T. (обсудить/вклад) 06:30, 24 February 2016 (UTC)
 * Problem gone. If you still see on some page, purge it. :) --Octahedron80 (talk) 06:46, 24 February 2016 (UTC)

InTG WIKTIONARY
Can you create this module in tg wiktionary. And another ru modules. Please :-). And thanks заранее ToJack (talk) 13:52, 3 February 2017 (UTC)

Edit request
When the edit request for Module:links has been done, please remove lines 287-289, and replace line 281 with: tr = part.translit or (not (parts.enable_auto_translit or data.inflections.enable_auto_translit) and "-" or nil), accel = parts.accel or partaccel, —CodeCat 12:50, 20 August 2017 (UTC)
 * ✅ — Eru·tuon 18:10, 20 August 2017 (UTC)

Script tags and redundant scripts
I notice that in you added code that fills in   if it's. However, this very same code is already in the  function. One of them should go, but which?

The reason I ask is because I traced a lot of redundant instances of  to here. It turns out that the module automatically puts  on the inflections as well. Perhaps this is what we want; if someone specifies the script of the headword then you can probably assume the inflections will also be in that script. The alternative would be having to provide  on each inflection as well. This may or may not be desirable. Regardless, a problem arises because the headword script is applied to inflections after the headword script is autodetected. This means that for e.g. an English noun, first the headword is determined to be  by autodetection, and then   is passed to Module:links for every plural form. That module then scoffs because it's being given a script that it can autodetect.

I can think of two possible solutions for this, depending on which direction we want to go in: —Rua (mew) 12:15, 8 January 2018 (UTC)
 * If we don't want headword script to be automatically applied to inflections, then the solution is fairly simple. But we'll have to make sure this change doesn't break entries which rely on it, and provide  parameters as necessary.
 * If we do want headword script to be automatically applied to inflections, then we need to do so only if the headword script is actually provided in . This would need to be done before the autodetection, which sets   regardless. If   is actually provided, then the module should also apply this to the   of every inflection part individually in the preprocessing stage.
 * It is certainly complicated tracing the instances of scripts being passed to Module:links.
 * I think it may be a better use of server resources to expect all inflections in a headword to share the script of the lemma form, unless indicated otherwise. But then again, maybe it doesn't save all that server time and memory. There are currently with two or more scripts, 72 with three or more. That means only for these languages does lua do pattern-matching; if there's just one script, it will be quickly returned. And in many cases of the 72 languages, a script will be returned after just one pattern-matching.
 * The script-getting in the  function seems to happen after the script-getting in the   function, so the former is clearly unnecessary. However, I'm still trying to understand the logic of the module and of what you're trying to do, so I'm not confident enough to say any more. — Eru·tuon 21:57, 8 January 2018 (UTC)

ts= param
Thanks and  for adding ts! --Victar (talk) 01:18, 17 March 2018 (UTC)
 * So, I guess I should have asked for this before, but lua? :D —*i̯óh₁n̥C[5] 23:28, 17 March 2018 (UTC)
 * Nope. Again with the vanishing parameters. This time it doesn't seem possible to work around the issue by reordering the table. DTLHS (talk) 23:34, 17 March 2018 (UTC)

Lua error found on 祢 page
I found an error on 祢's page reading:

Lua error in Module:headword at line 548: malformed pattern (missing ']')

Can this be fixed please? Thanks. EDIT: Also found this error on 你}. Fluoromethyl (talk) 21:10, 28 November 2020 (UTC)
 * This was fixed. You can edit and save a page without changes to force regeneration.  Otherwise the system will take a while to regenerate with the fixed module.  Vox Sciurorum (talk) 21:19, 28 November 2020 (UTC)

Ah I see. Thanks for clearing that up. Fluoromethyl (talk) 10:39, 29 November 2020 (UTC)

heads up
Hi, I see you just made a change to this module. Do you have any more changes planned in the next day or so? I'm going to be rewriting this module so the `data.heads` table can be an array of objects rather than always an array of strings. Preferably, transliterations, transcriptions and other headword-specific properties all go into this table rather than into separate arrays, as currently. This is so I can support qualifiers and such things attached to individual headwords in a clean fashion. The preprocess function will gather stuff into headword objects if not already in that format, and code to format headword objects will be partly shared with format_inflection_parts. Let me know if these changes will interfere with anything you have planned. BTW I see a ton of tracking code in this module and I doubt it all needs to be there. Is any of it being used by you? If not I may start selectively removing stuff that doesn't look important. Benwing2 (talk) 07:03, 4 March 2023 (UTC)


 * @Benwing2 Thanks for the heads up. The only thing on my radar at the moment is to add the magic characters that have already been added to Module:links, but it's not urgent - I probably won't get round to it for a while. Theknightwho (talk) 07:06, 4 March 2023 (UTC)
 * Hi. You added some code in full_headword lines 588-592 that seems wrong; if `heads` is left nil, you substitute pagename which disables the default multiword linking that happens around line 160 in preprocess. It "works" in most cases currently because the passed-in value for `data.heads` is usually a zero-length table, which your code leaves alone; but I'm not sure if this was intentional on your part. Also the code you added in lines 599-607 looks ugly and I don't understand it. Can you explain what it's supposed to do? I take it you are allowing per-headword script specification but there has to be a better way to do this; in particular the change I mention just above should make this a lot cleaner. Also what code currently relies on being able to specify an array of script objects in `data.sc` in `full_headword`, since I want to remove this functionality and move it into headword objects? Thanks! Benwing2 (talk) 07:54, 4 March 2023 (UTC)
 * @Benwing2 I'll have to go over this to remind myself of what I was doing and why - will get back to you shortly. Theknightwho (talk) 08:46, 4 March 2023 (UTC)

Transcription slashes
Your recent rewrite seems to have made it so transcriptions are no longer in slashes (eg. ). Doesn't look intentional, the slashes still appear in mentions (eg. ). Catonif (talk) 11:50, 24 March 2023 (UTC)
 * sorry wrong ping Catonif (talk) 22:10, 24 March 2023 (UTC)
 * Should be fixed. BTW if you pinged me recently on other topics, apologies for not responding, I've been a bit overwhelmed with pings and need to sit down and go through the backlog. Benwing2 (talk) 22:50, 24 March 2023 (UTC)
 * Thank you, and take your time. We wouldn't want to wear you down. Nte sciupà. :) Catonif (talk) 23:03, 24 March 2023 (UTC)

нямам
@Benwing2 It certainly looks better with the comma than without. However, in this entry, the lemma gloss is a very long way from the lemma (separated by the transliteration and aspect information), such that it's not totally clear that the lemma gloss even pertains to the lemma itself. It could be misinterpreted as saying that the verb is defective and only exists in this form. Not sure what to do. Perhaps lemma glosses are not required in situations where the headword line doesn't contain any other forms? This, that and the other (talk) 22:48, 16 November 2023 (UTC)
 * @This, that and the other I wonder if we should put the lemma gloss directly after the lemma, before the translit and gender/aspect. Try modifying line 96 of Module:bg-headword as follows:

return require("Module:User:Benwing2/headword").full_headword(data) and then, without saving, preview нямам. This will let you see the lemma gloss before the translit; I think it looks fine that way, and it won't make any difference for Latin, where there's no translit or aspect. Benwing2 (talk) 22:56, 16 November 2023 (UTC)


 * @Benwing2 Hmm, I wonder if it should come after the translit but before the grammatical info? The lemma and its translit feel like a "unit" to me. Maybe just put it before the translit for now, and we'll see if anyone complains. This, that and the other (talk) 23:24, 16 November 2023 (UTC)
 * @This, that and the other Try it now; I put the lemma gloss between the translit and gender, with a comma between lemma gloss and gender if both exist. Benwing2 (talk) 23:30, 16 November 2023 (UTC)
 * @Benwing2 looks good to me. This, that and the other (talk) 23:51, 16 November 2023 (UTC)