Module talk:auto cat

Από Βικιλεξικό
Μετάβαση στην πλοήγηση Πήδηση στην αναζήτηση
explantion in greek: Εδώ συζητήθηκε για ποιο λόγο είναι δύσκολο να έχουμε έκφραση ΧΧΧκές λέξεις τάδε προέλευσης
Trials for {{auto cat}}

One Category's title is a problem. It consists of

Module:Languages.words + Module:Languages.from
e.g. ModernGreek words + derived from English = Κατηγορία:Νεοελληνικές λέξεις αγγλικής προέλευσης

'words' is based on the receiver-language ISO and 'from' is based on the donor-language ISO
I have tried (Module:auto cat line 600 onwards), but I cannot spilt the title and match the 2 parts with the keywords of Module:Languages.
Is it possible?
Another solution is to change completely its title to:

Προέλευση λέξεων (=Origin of words) + Module:Languages.apota (languagename)
e.g. to Κατηγορία:Προέλευση λέξεων από τα αγγλικά (νέα ελληνικά)

which is not a problem. What can be done? ‑‑Sarri.greek  | 11:30, 1 Νοεμβρίου 2020 (UTC)[απάντηση]


Thank you for this reply at en.wikt by Benwing2: «I think you're trying to pull out the two language names from a category like Κατηγορία:Νεοελληνικές λέξεις αγγλικής προέλευσης? Then you'd want something like this:
local receiver_lang, donor_lang = mw.ustring.match(category, "^(.+) λέξεις (.+) προέλευσης$")
After this, if category has the value "Νεοελληνικές λέξεις αγγλικής προέλευσης", then receiver_lang will have the value "Νεοελληνικές" and donor_lang will have the value "αγγλικής"


ABOUT APOTA: (languages = Module:Languages TEST Κατηγορία:Δάνεια από τα γαλλικά
«first need to build a table like this:
apota_to_language_code = {}
for langcode, data in pairs(languages) do
    apota_to_language_code[data.apota] = langcode -- TRIAL: table index is nil----------------
end
Then you need to extract the apota text and look up the language code, something like this:
local apota_text = mw.ustring.match(category, " (από .*)$")
local apota_langcode = apota_to_language_code[apota_text]
This assumes that all apota text variants begin with από surrounded by spaces and that the apota text is always at the end of a category. If this isn't the case, then it gets harder, and we can figure out how to handle it depending on what if anything is always true about the apota text.» (by en:User:Benwing2, 2 November 2020


I would have a look at this if wanted, but you would have to really spell out the problem (briefly!) to someone like me who has no idea of the background or the language. Why do you need to split text up? Is there a precise algorithm that would reliably work for all possible conditions? Then I would need a testcase: some input wikitext (possibly using a sandbox template) that generates certain output (or an error message) with an explanation of what is wrong with the current output and exactly what is wanted. Finally, please put the standard welcome template on my talk page. Johnuniq (συζήτηση) 02:15, 2 Νοεμβρίου 2020 (UTC)[απάντηση]

Thank you for offering to help ☏ Johnuniq. This is a 'sandbox' is the word? A trial module. The problem here is about a usual categorization in all wiktionaries, concerning Xlanguage originates from Ylanguage. But i will change the whole expression altogether to Origin from Ylang (Xlang) and everything is solved. Anyway, thank you very much, ‑‑Sarri.greek  | 02:27, 2 Νοεμβρίου 2020 (UTC) PS I have no idea how to make error messages. ‑‑Sarri.greek  | 02:30, 2 Νοεμβρίου 2020 (UTC)[απάντηση]
Re error messages, I just meant that if you have some input wikitext which generates an error instead of the wanted output, that would be fine. I don't mind if it works or not. What I need is example input with what it generates and what it should be. Johnuniq (συζήτηση) 03:06, 2 Νοεμβρίου 2020 (UTC)[απάντηση]
Thank you: I am too ashamed to ask childish questions to experts like you, ☏ Johnuniq. Please do not bother. This should have been supplied by meta. The problem is repetitive and of general nature.
1. I have a module full of data (with various keywords which take certain valures). e.g. Module:Languages
2. I have Cat.titles, pages, texts, which use some expressions which match a specific keyword's value.
Example: keyword apota (it means «from language X» As in Category:Δάνεια από τα αγγλικά . The word Δάνεια (borrowings) is what i manually extract, to get the last part of the title,
...which happens to be similar to the apota value of ISO en at Module:Languages. In Module:auto cat line 600, I have faked the matching: I never truly referred to Module:Languges. I could not do the same trick, when I have TWO key/values in a title. Also, I cannot call any key from any Module. One of the reasons, is, that inflectional languages have TOO MANY different styles of values for the same keyword. It is not like: 'English'. It comes in feminine: αγγλική in genitive fem. αγγλικής in neuter αγγλικά and so on. Example: Category:Νεοελληνικές λέξεις προέλευσης από τη μέση άνω γερμανική (leyword:'words' Greek words + keyword:'from' MiddleUpperGerman)
In general: is there a way to say if this XXXX expression is identical to any value of keyword «apota» of Module:X, then, do this and that ‑‑Sarri.greek  | 03:21, 2 Νοεμβρίου 2020 (UTC)[απάντηση]
I suggest changing your question to use simple English letters that I can easily follow. It does not have to make sense—it only needs to outline what is wanted. For example, instead of writing "Category:Δάνεια από τα αγγλικά", write "Category:Abc apota def". I believe you want to take that text as input, and get "Abc" and "def" as output. You would use Abc and def in some way. Briefly: what would you do with them? I think the problem is that you need to look up what "apota" might be in various languages. For example, in Module:Languages for the language of interest, you might find that apota is "xyz" and the input wikitext would actually be "Category:Abc xyz def" and you need to extract Abc and def from that. However, apota may be written in several different ways, so it could be xyz but also could possibly be xyz2 or xyz3. Is that the problem? Can you give an example which is currently in Module:Languages where alternatives for apota are given? Johnuniq (συζήτηση) 06:36, 2 Νοεμβρίου 2020 (UTC)[απάντηση]
Sorry, I did not see this ☏ Johnuniq. apota is fine, it works. The problem has been two expressions together: abcxxxx...xxx? + xxxxxxxxxyz which is impossible to recognize because there are no boundaries between them. There might be a way, but it would be very complicated. It is not worth it. We need to change the naming style completely. Please, do not bother yourself. I managed apota though, thank you! ‑‑Sarri.greek  | 16:26, 2 Νοεμβρίου 2020 (UTC)[απάντηση]