Module talk:accel
Add topicComparative and superlative adjectives
[edit]Since the script currently (as far as I am aware) uses the headings to find the part-of-speech for deciding the part-of-speech of accelerated entries, it doesn't work for the new format of comparative or superlative adjectives, since they still have "Adjective" as the heading. Would it be possible to instead possibly check the head template or similar of the existing entry for finding the part-of-speech? I could look at it myself as well. — surjection ⟨?⟩ 15:50, 10 January 2019 (UTC)
- My solution for Ancient Greek was adding a parameter to
{{grc-adecl}}
to specify that an adjective was a comparative or superlative and then adding|comparative
or|superlative
to the form-of acceleration parameter. - The JavaScript compiles the acceleration parameters, and it can only look at stuff in the HTML and JavaScript. I think there is nothing in the HTML of the headword template to indicate that the word is a comparative. There is the
wgCategories
variable available in themw.config
object and it would be possible to determine that the page is in a category containing the name of the current language and "comparative adjectives" or "superlative adjectives", but there is no way to determine which links actually belong to the comparative or superlative and which might belong to another part of speech. Even if the closest part-of-speech header to a link is "Adjective", there could be a page with both a positive adjective and a comparative adjective. - You could try my solution. The only way I could see the headword line being helpful is if something were added to the HTML to indicate what POS categories were added. But it is somewhat clearer to have the "comparative" or "superlative" information in the HTML around individual links. — Eru·tuon 22:33, 10 January 2019 (UTC)
- Right, that will require something language-by-language which needs to be handled separately. I'll try to come up with something for Finnish at least. — surjection ⟨?⟩ 22:39, 10 January 2019 (UTC)
- But wait, if that is the case, how does the script/module get the PoS heading, or does it not try to at all and am I just mistaken? — surjection ⟨?⟩ 22:49, 10 January 2019 (UTC)
- @Surjection: I don't quite understand. The script does get the part of speech from the header, as you said. — Eru·tuon 23:04, 10 January 2019 (UTC)
- It gets the header, so why couldn't it just read the line below that? It might have some other template than
{{head}}
sure, but that's language-specific and should be handled in the language-specific modules. — surjection ⟨?⟩ 08:58, 11 January 2019 (UTC)- Like I said, there's nothing about "comparative" or "superlative" in the actual HTML of the headword that the JavaScript has access to. — Eru·tuon 09:19, 11 January 2019 (UTC)
- It gets the header, so why couldn't it just read the line below that? It might have some other template than
- @Surjection: I don't quite understand. The script does get the part of speech from the header, as you said. — Eru·tuon 23:04, 10 January 2019 (UTC)
Merging headwords
[edit]@Erutuon In the case of Slovene mešati, most forms of the imperative have more than one form, but the difference is only in the accentuation, which is not a part of normal Slovene orthography. If these forms were created with acceleration, you'd end up with two ===Verb===
headers on the page mešajte, one with the headword mẹ́šajte and another with mešȃjte. In the case of hvaliti, there is a present-tense form that matches one of the imperatives, so it would be grouped under the hválite heading, leaving the second imperative hvalȋte by itself.
In the case of mešajte, it would be useful if both imperative forms were grouped under a single heading, with head=mẹ́šajte|head2=mešȃjte
. This could be done relatively simply by making another merging function that handles cases where all but the headwords are the same. But I'm not sure how this should interact with the existing definition-merging code. There is a choice to be made: group the first imperative hválite with the present-tense form (thus merging the definitions), or with the second imperative hvalȋte (thus merging the headwords)? Which should take precedence? I'm leaning towards merging the headwords in this case. But one could imagine more complicated cases where both the headword and the definition can be merged, and I don't think this would work out of the box. —Rua (mew) 08:56, 12 July 2019 (UTC)
- I'm partial to merging headwords so that definitions aren't duplicated. It seems closer to what we do when it's a lemma. — Eru·tuon 17:56, 12 July 2019 (UTC)
- Perhaps
origin
andorigin-transliteration
could be conceptually arrays, so that multiple headwords can be specified in the acceleration data and the acceleration script doesn't have to figure out how to merge the entries. Not sure if that makes sense though. — Eru·tuon 18:37, 12 July 2019 (UTC)- It would be easier if the template/module writer doesn't have to think of that, and can just trust that the gadget will do the right thing. —Rua (mew) 18:50, 12 July 2019 (UTC)
- Yeah, you're right. The acceleration for one spelling should not have to contain the other spelling. It would be annoying and bad design. — Eru·tuon 04:48, 13 July 2019 (UTC)
- It would be easier if the template/module writer doesn't have to think of that, and can just trust that the gadget will do the right thing. —Rua (mew) 18:50, 12 July 2019 (UTC)