Content deleted Content added
tests |
→Handling disambiguation terms: new section |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 7:
:I think it's correct now, but {{U|Erutuon}} should wait a day before doing anything in case there are more changes. [[User:Peter coxhead|Peter coxhead]] ([[User talk:Peter coxhead|talk]]) 15:13, 23 August 2018 (UTC)
::See [[User:Peter coxhead/Test#Module:TaxonItalics#main]] for my work tests. [[User:Peter coxhead|Peter coxhead]] ([[User talk:Peter coxhead|talk]]) 15:16, 23 August 2018 (UTC)
:::{{ping|Tom.Reding|Erutuon}} I'm doubtful of the value of [[Module talk:TaxonItalics/testcases]], because it's the <em>visual appearance</em> of the output that matters, not the exact HTML that achieves this. During development, I've changed the way the code de-italicizes components like the hybrid symbol and connecting terms more than once, partly to simplify the algorithm and partly for consistency. It could be changed again, e.g. depending on the discussion at [[Wikipedia talk:WikiProject Plants#Hybrid symbol ×]], without changing the visual appearance of cases currently handled correctly. In development, I've relied on tests like those at [[User:Peter coxhead/Test#Module:TaxonItalics#main]], just looking at the output. [[User:Peter coxhead|Peter coxhead]] ([[User talk:Peter coxhead|talk]]) 16:47, 24 August 2018 (UTC)
:::: {{reply to|Peter coxhead}} Well, I see your point, but I've updated them so that they all pass again. Perhaps they can serve as a demonstration of what the function does, since they are not very useful when editing the module. — [[User:Erutuon|Eru]]·[[User talk:Erutuon|tuon]] 20:54, 24 August 2018 (UTC)
:::::Well, if you're happy to do the work, I agree they are a good demonstration.
:::::Any thoughts about other cases, as per my question below? [[User:Peter coxhead|Peter coxhead]] ([[User talk:Peter coxhead|talk]]) 20:58, 24 August 2018 (UTC)
:::::: Not right now, but I'll post there if any occur to me. — [[User:Erutuon|Eru]]·[[User talk:Erutuon|tuon]] 06:03, 25 August 2018 (UTC)
== Work remaining ==
The module seems to handle [[ICNafp]]-style names (i.e. those with connecting terms) correctly, both straightforward italicization and abbreviation. <s>However, it doesn't yet handle "GENUS (SUBGENUS)" style names:</s>
[[User:Peter coxhead|Peter coxhead]] ([[User talk:Peter coxhead|talk]]) 17:12, 23 August 2018 (UTC)
The module now handles "GENUS (SUBGENUS)" style names correctly:
*Genus (Subgenus) → {{#invoke:TaxonItalics|main|Genus (Subgenus)}}
*Genus (Subgenus) species → {{#invoke:TaxonItalics|main|Genus (Subgenus) species}}
*Genus (Subgenus) [abbreviated] → {{#invoke:TaxonItalics|main|Genus (Subgenus)|abbreviated=yes}}
*Genus (Subgenus) species [abbreviated] → {{#invoke:TaxonItalics|main|Genus (Subgenus) species|abbreviated=yes}}
Are there any more cases that the code should handle? [[User:Peter coxhead|Peter coxhead]] ([[User talk:Peter coxhead|talk]]) 16:41, 24 August 2018 (UTC)
== Handling disambiguation terms ==
By default, the code assumes that a parenthesized term is a subgenus and italicizes it:
* <nowiki>{{#invoke:TaxonItalics |main |Varanus (Hapturosaurus)}}</nowiki> → {{#invoke:TaxonItalics|main|Varanus (Hapturosaurus)}}
However, this is wrong if it is actually a disambiguation term:
* <nowiki>{{#invoke:TaxonItalics |main |Caia (plant)}}</nowiki> → {{#invoke:TaxonItalics|main|Caia (plant)}}
I've just added a parameter {{para|dab}} to treat a parenthesized part as a disambiguation term:
* <nowiki>{{#invoke:TaxonItalics |main |Caia (plant) |dab=yes}}</nowiki> → {{#invoke:TaxonItalics|main|Caia (plant)|dab=yes}}
[[User:Peter coxhead|Peter coxhead]] ([[User talk:Peter coxhead|talk]]) 06:54, 5 October 2021 (UTC)
|