| Wiktionary:Beer parlour Aug 26th 2012, 17:09 Bot to handle [[{{{2}}}#{{{{{1}}}}}|{{{{{{{1}}}/script}}|lang=|{{{2}}}}}]] and its ilk.: new section | ← Older revision | Revision as of 17:09, 26 August 2012 | | Line 1,167: | Line 1,167: | | | ::::Whereas, I do think a person from Sudan would think twice before copying the header ==Aja (Benin)== to add a word from their Sudanese Aja. And likewise for other same-name languages. [[User:-sche|- -sche]] [[User talk:-sche|(discuss)]] 04:59, 26 August 2012 (UTC) | | ::::Whereas, I do think a person from Sudan would think twice before copying the header ==Aja (Benin)== to add a word from their Sudanese Aja. And likewise for other same-name languages. [[User:-sche|- -sche]] [[User talk:-sche|(discuss)]] 04:59, 26 August 2012 (UTC) | | | :::::(FWIW, AFAIK the only langtemps with {{temp|also}}s are {{temp|ldl}} and {{temp|law}}, both added by me.) I just think that parenthetical countries are a problem. For example, countries change, and then it can get really messy. In this case, Aja isn't spoken in Sudan any more. It's spoken in [[South Sudan]] (independent since 2011). And what about the the thousands of Aja speakers across the border in the Central African Republic? So you can see that <tt>Aja (Sudan)</tt> is just asking for trouble, and that's the problem with parentheticals in general. --[[User:Metaknowledge|Μετάknowledge]]<small><sup>''[[User talk:Metaknowledge|discuss]]/[[Special:Contributions/Metaknowledge|deeds]]''</sup></small> 05:15, 26 August 2012 (UTC) | | :::::(FWIW, AFAIK the only langtemps with {{temp|also}}s are {{temp|ldl}} and {{temp|law}}, both added by me.) I just think that parenthetical countries are a problem. For example, countries change, and then it can get really messy. In this case, Aja isn't spoken in Sudan any more. It's spoken in [[South Sudan]] (independent since 2011). And what about the the thousands of Aja speakers across the border in the Central African Republic? So you can see that <tt>Aja (Sudan)</tt> is just asking for trouble, and that's the problem with parentheticals in general. --[[User:Metaknowledge|Μετάknowledge]]<small><sup>''[[User talk:Metaknowledge|discuss]]/[[Special:Contributions/Metaknowledge|deeds]]''</sup></small> 05:15, 26 August 2012 (UTC) | | | + | | | | + | == Bot to handle {{[[Template:t|t]]}} and its ilk. == | | | + | | | | + | I'd like to set {{user|Rukhabot}} on the task of converting between {{temp|t}}, {{temp|t+}}, {{temp|t-}}, and {{temp|tø}}. As currently coded, it follows these rules: | | | + | | | | + | * It goes based on database-dumps, so will typically have somewhat out-of-date information. (For the first pass, I think this is fine: currently they are, for the most part, two ''years'' out of date. For later passes, I'll see about improving this somewhat.) | | | + | * It will only convert between those four templates. If a translation does not use any of those templates, it will be not be touched. (Later on, I ''may'' work on {{temp|t}}-ifying simple cases.) | | | + | * It will not change any formatting, alter any language-codes, or anything like that. It will ''only'' change the name of the template being called. (Exception: if there's spurious whitespace inside the template-call, it can be removed. For example, <tt><nowiki>{{ t+ | fr | le }}</nowiki></tt> will become <tt><nowiki>{{t+|fr|le}}</nowiki></tt>.) | | | + | * It does not try very hard to understand the subtle complexities of MediaWiki template syntax. It simply looks for (approximately) <tt><nowiki>{{t[-+ø]?[|]([a-z-]{2,10})[|]([^|}=]+)</nowiki></tt> followed by <tt>|</tt> or <tt>}}</tt>. So, for example, it will be fooled by <tt><nowiki>{{t+|fr|asfasefasefase|2=le}}</nowiki></tt>, which ''looks'' like it links to [[:fr:asfasefasefase]], but which ''actually'' links to [[:fr:le]]. However, even in such pathological cases, it won't cause any ''serious'' harm — it just might select the wrong template. | | | + | * It doesn't examine context at all; it's just as happy to update a {{temp|t}} in a ====Synonyms==== section, or inside a comment, as a properly-used {{temp|t}} in a ====Translations==== section. (See [[Wiktionary:Todo/Translations templates outside translations sections]].) | | | + | * It chooses between {{temp|t+}}, {{temp|t-}}, and {{temp|tø}} using the rules you'd expect, with two special cases: | | | + | ** The language-codes <tt>nan</tt>, <tt>cmn</tt>, <tt>nb</tt>, <tt>rup</tt>, and <tt>kmr</tt> are hardcodedly mapped to zh-min-nan.wikt, zh.wikt, no.wikt, roa-rup.wikt, and ku.wikt, so they will result in {{temp|t+}} or {{temp|t-}}, not in {{temp|tø}}. For example, [[:no:yes]] exists, so the bot will convert {{temp|t|nb|yes}} to {{temp|t+|nb|yes}} and {{temp|t|no|yes}} to {{temp|t+|no|yes}}. | | | + | ** Due to the weird script-conversion stuff, I haven't figured out how to reliably tell if zh.wikt, sr.wikt, kk.wikt, ku.wikt, or iu.wikt has an entry, so for those, it will change {{temp|tø}} to {{temp|t}}, but will otherwise leave those Wiktionaries alone. (See [[Wiktionary:Grease pit/2012/August#ku:فەرهەنگ|Wiktionary:Grease pit/2012/August#ku:{{ku-Arab|فەرهەنگ|lang=ku}}]].) | | | + | * It has no special behavior for B/C/S/M; for example, it will convert {{temp|t|hr|Leiter}} to {{temp|t+|hr|Leiter}} and {{temp|t|sh|Leiter}} to {{temp|t-|sh|Leiter}}. | | | + | | | | + | For ten examples of the edits it makes, see {{argwiktlink|link=Special:Contributions/Rukhabot?offset=20120826030100&limit=10}}. | | | + | | | | + | Does anyone have any objections to the edits that would be made by such a bot? | | | + | | | | + | —[[User: Ruakh |Ruakh]]<sub ><small ><i >[[User talk: Ruakh |TALK]]</i ></small ></sub > 17:09, 26 August 2012 (UTC) | | |
沒有留言:
張貼留言