Module talk:auto cat

From Wiktionary, the free dictionary
Latest comment: 2 years ago by 217.117.125.83 in topic WD item
Jump to navigation Jump to search

Categories to be added

[edit]

Eru·tuon 09:13, 16 May 2017 (UTC)Reply

Detecting if a category is valid?

[edit]

@Erutuon Can you think of a simple way to return a boolean value based on whether the category name is valid? The problem is that each of the separate handlers are expanded outside of the module so there's no way that I can think of to detect an error if it occurs. DTLHS (talk) 06:22, 22 May 2017 (UTC)Reply

@DTLHS: Hmm. Perhaps we could use frame.preprocess to expand the resulting template and then search for whatever indicates an error. (If all the templates were just Lua errors, it would be easy to search for the HTML used when formatting such an error, but some are template-based.) Umm, I guess frame.expandTemplate gives basically the same output, except in a different way, so hypothetically we could just analyze the output of the current function. But I don't know if there's anything consistent that we can look for... — Eru·tuon 06:35, 22 May 2017 (UTC)Reply
@DTLHS, Erutuon FWIW, I implemented this at the end of last year in [1]. The original reason was Category:Mato Grosso, Brazil, since there is a Category:Mato language, but it also fixes the issue below with Category:Chinese astronomy. Benwing2 (talk) 01:42, 27 October 2020 (UTC)Reply

Category:Chinese astronomy

[edit]

@Erutuon, could you check why {{autocat}} doesn't work on this category? — justin(r)leung (t...) | c=› } 21:05, 21 June 2017 (UTC)Reply

That would be because "Chinese" at the beginning of the category name makes {{autocat}} think that the category is a POS cat, like Category:Chinese nouns. Not sure how that can be fixed. — Eru·tuon 21:16, 21 June 2017 (UTC)Reply
@Erutuon: No wonder... I don't know how that would be fixed either. I guess we'll have to stick with {{topic cat}} for now. Thanks! — justin(r)leung (t...) | c=› } 21:20, 21 June 2017 (UTC)Reply
@Justinrleung: Or it could be fixed by creating a custom list of ambiguous category names... but that might be more work than it's worth. — Eru·tuon 21:53, 21 June 2017 (UTC)Reply
@Erutuon: I agree. If there were more categories that would have this problem, it would be a good solution. — justin(r)leung (t...) | c=› }
A solution would be to rename topical categories, as was suggested recently. —CodeCat 22:39, 21 June 2017 (UTC)Reply

langcatboiler

[edit]

Just linking to a discussion on another page regarding the addition of {{langcatboiler}} to this module: Category talk:Java programming language. — Eru·tuon 19:06, 18 July 2017 (UTC)Reply

Parsing titles

[edit]

@Erutuon The whole point of {{auto cat}} is to parse titles. It should not be delegated to another template. That defeats the point. —CodeCat 20:36, 18 July 2017 (UTC)Reply

True, but an additional purpose is to direct you to the correct template. — Eru·tuon 20:37, 18 July 2017 (UTC)Reply
No, its purpose is to not care about the correct template. If its purpose was to actually put the correct template call into the category, we'd be substing it instead. —CodeCat 20:41, 18 July 2017 (UTC)Reply
Well, this is not the first template to do this. Search request cat in the module. — Eru·tuon 20:44, 18 July 2017 (UTC)Reply
Then that should be changed too. {{auto cat}}'s purpose is to figure out what to do with the category, so that the user does not have to think about the specific templates or their parameters. Someone who does want to use the specific template will do so knowing which parameters to use, because they would have used {{auto cat}} otherwise. —CodeCat 20:49, 18 July 2017 (UTC)Reply
Well, why should category boilerplate templates have parameters, when they don't need to, because the category title gives all the information needed? — Eru·tuon 20:51, 18 July 2017 (UTC)Reply
Honestly, it is quite convenient to be able to just use {{auto cat}} for as many categories as possible, whether or not it handles parameters. [edit:] For some categories it means you don't have to learn parameters, for others (PIE root categories and request categories) it means you don't have to learn template names. If you wanna rewrite Module:category tree/PIE root cat to use parameters, go ahead. But I don't see the point. — Eru·tuon 20:46, 18 July 2017 (UTC)Reply
The point is simple: if you want it to automatically figure out the parameters, why not use {{auto cat}}? It's redundant to duplicate it in {{PIE root cat}}. —CodeCat 20:52, 18 July 2017 (UTC)Reply
Well, I already luaified it that way. Again, why would I rewrite the module just so that it uses parameters? — Eru·tuon 20:54, 18 July 2017 (UTC)Reply
However, on the Module:auto cat end, it would make sense to directly invoke Module:category tree with the correct function and "template" name rather than invoking {{PIE root cat}}. — Eru·tuon 20:55, 18 July 2017 (UTC)Reply
I've been wanting to rewrite the category tree templates lately anyway, but I haven't decided yet on all the details. —CodeCat 21:01, 18 July 2017 (UTC)Reply
I imagine they could be improved, but haven't had any ideas. It took me a while to figure out how to add a new template. If it were easier, perhaps more of our catboiler templates would be modulified and would have breadcrumbs and the other nice things. — Eru·tuon 21:04, 18 July 2017 (UTC)Reply
I do wonder if some of the etymology submodules (particularly Module:category tree/derivcatboiler, Module:category tree/borrowed cat, Module:category tree/inherited cat) couldn't be merged somehow. — Eru·tuon 21:20, 18 July 2017 (UTC)Reply
@Erutuon, Rua I effectively ended up doing something of this sort with poscatboiler handlers. You may notice that many of the category submodules are disappearing. Currently this only really works with categories that begin with a language name or are the corresponding umbrella categories, but in principle a similar solution could be extended to all categories. Benwing2 (talk) 01:50, 27 October 2020 (UTC)Reply

{{ar-root cat}} & {{HE root cat}}

[edit]

@Benwing2 {{ar-root cat}} should be removed from this module, same for {{HE root cat}} فين أخاي (talk)

@Fenakhay They are gone. Benwing2 (talk) 01:30, 27 October 2020 (UTC)Reply

useless TOC w braille

[edit]

For Category:Braille script characters, the automated TOC is useless, since none of the entries sort as Latin script. (Click on A or Z, and the entries displayed will be the same.) Is there a way to turn it off? kwami (talk) 08:39, 6 March 2022 (UTC)Reply

WD item

[edit]

Please, change link in tables on language category pages to WD item to internal. 217.117.125.83 16:37, 27 April 2022 (UTC)Reply