Re: [Wikitech-ambassadors] Lua script that needs to look up a big table (phonetic guide automation)

2020-03-15 Thread bawolff
So in this scenario, are all categories planned to be sorted via jyupting? If so, we could make a collation, in which case categories would automatically be sorted that way, and you would just put the category in a page in the normal way (by doing [[Category:Foo]] with no sortkey). The downside

Re: [Wikitech-ambassadors] Lua script that needs to look up a big table (phonetic guide automation)

2020-03-15 Thread Huji Lee
The additional information you provided was helpful. I still think the best approach is to have an extension that returns the Jyutping value for the article title. Let's say that extension introduces a new magic word called {{TITLEINJYUPTING}}. That way you can add

Re: [Wikitech-ambassadors] Lua script that needs to look up a big table (phonetic guide automation)

2020-03-15 Thread bawolff
On that note, I'll mention there was a previous attempt by Liangent to do better sorting of categories for zhwiki, that unfortunately never got reviewed so ended up bitrotting.https://phabricator.wikimedia.org/T46667 I agree generally, that if you want to change the sort order for categories,

Re: [Wikitech-ambassadors] Lua script that needs to look up a big table (phonetic guide automation)

2020-03-15 Thread Huji Lee
Deryck, I am not sure what you mean by "re-sort" articles, but if what you means is that categories should be sorted differently, then I don't think Lua is the answer, and it would need to be handled on the back end. In general, also, I think that for a problem like yours, Lua is not the right

Re: [Wikitech-ambassadors] Lua script that needs to look up a big table (phonetic guide automation)

2020-03-15 Thread bawolff
Consider using https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#mw.loadData , keeping in mind that lua isn't really made with the usecase of huge data tables in mind, so there might be limits you run into if your data is really big. -- Bawolff On Sun, Mar 15, 2020 at 2:13

[Wikitech-ambassadors] Lua script that needs to look up a big table (phonetic guide automation)

2020-03-15 Thread Deryck Chan
Hello Ambassadors - This technical question may be relevant to multiple (particularly CJK) language communities so I'm asking it here. What is the advice for writing a Lua script that needs to look up data from a big table (~10k rows at first deployment, potentially increasing in the future)?