Module talk:ko-translit

Definition from Wiktionary, the free dictionary
Jump to: navigation, search

Keep original[edit]

What would that be used for? —CodeCat 03:16, 17 March 2013 (UTC)

I dunno — I imagine it made more sense in whatever Anatoli used his C# program for — but anyway, I've removed it now. (I actually removed it even before seeing your comment here.) —RuakhTALK 07:32, 17 March 2013 (UTC)
Hi. Thank you for the conversion, Ruakh! Sorry for not replying earlier. Yes, that variable was used to append the converted text to the original. I should have removed it from my example. Good that you figured it out. I'll come back with some tweaks or requests to tweak. Will look at something that looks a bit simpler - Module:hy-translit. --Anatoli (обсудить/вклад) 09:47, 17 March 2013 (UTC)

Oops[edit]

It's not working. Getting "Script error" --Anatoli (обсудить/вклад) 10:04, 17 March 2013 (UTC)

That's expected behavior. For information on how to use Scribunto, see Wiktionary:Scribunto. —RuakhTALK 16:09, 17 March 2013 (UTC)
Thanks. Maybe I misunderstand something but it's expected behaviour if something doesn't work. The module compiles but I haven't seen it converting Korean hangeul (not the current or the original version). I have created Module:ko-translit-test for debugging/testing (will remove or rename later) and found out that the call fails on the function "len()". --Anatoli (обсудить/вклад) 22:25, 17 March 2013 (UTC)
It's just that nothing in the module was designed to be called directly from outside Lua. I've now added a general-purpose wrapper called main that you can use to test the module's functions, so you can write e.g. {{#invoke:ko-translit|main|tr|한국어|-}} (which produces Script error: The function "main" does not exist.).
Do we want this function to actually be called directly from outside Lua? Like, do we want templates to be able to #invoke it directly? If so, then we should probably either add a dedicated function for that, or modify the function to support the possibility of receiving a frame rather than a string.
RuakhTALK 22:50, 17 March 2013 (UTC)
(before edit conflict) Got it, thank you! I actually tested without the second parameter yesterday, now I see that you need "|" to separate params. Testing "한국어 (han-gugeo)" without delimiter: "Script error: The function "main" does not exist.", with delimiter: "Script error: The function "main" does not exist.".
(after edit conflict), Yes, calling directly would be good, like other transliteration modules. Are you open for enhances, fixes of the module? I'd like to bring as close as possible to the standard Korean transliteration (called "revised"). The changes are consistent (depends on the positions of consistent - what precedes and what follows, beginning or end of word), there are no exceptions as such. --Anatoli (обсудить/вклад) 22:57, 17 March 2013 (UTC)
Re: "like other transliteration modules": I wasn't aware of any others, which I guess is why this one differs from those. Can you point me at one, so I can see what kind of API they offer?
Re: "Are you open for enhances, fixes of the module?": Are you asking if I'm willing to make changes, or are you asking if it's O.K. if you make changes? In the former case — I can try. In the latter case — by all means, go ahead. I just created this as a starting-point. It's not actually used anywhere yet.
RuakhTALK 23:08, 17 March 2013 (UTC)
Category:Transliteration modules. This is why we have a categorisation system :) —Μετάknowledgediscuss/deeds 23:15, 17 March 2013 (UTC)
Ew, it looks like those all require a frame, so they are really designed to be called only from outside Lua. If someone wants to do that to this module, please warn me in advance so I can remove it from my watchlist first. :-P   —RuakhTALK 23:24, 17 March 2013 (UTC)
The original standards Anatoli and I have been following were designed by Ignatus (talkcontribs), and as I'm admittedly inept, I've needed his help a lot. If you want to change it (although I don't see why), you ought to discuss it with him, and because we still don't have that many modules, it can be changed relatively easily. —Μετάknowledgediscuss/deeds 23:28, 17 March 2013 (UTC)
@Ruakh. I meant both, you, me or any other to change it. I'll change basicRomanization to tr match other modules. --Anatoli (обсудить/вклад) 01:03, 18 March 2013 (UTC)
To me tr implies that it's the actual romanization scheme we're using, but your description of it at GP implied that it's not, and your comments since then have reinforced that implication (by, e.g., talking about your desire to create something closer to Revised Romanization). —RuakhTALK 01:09, 18 March 2013 (UTC)
The Revised Korean Romanization is one of the standards, and according to Wiktionary:About_Korean#Han-geul, Romanization, and English translation, it's the main one, McCune-Reischauer is only mentioned as "another in use". I don't think it will contradict any our current policy, besides the Revised version is more straightforward, easier to implement and has more one to one correspondences than any previous transliterations. Our entries also follow revised but there are inconsistencies, many are due to the lack of knowledge of the standard. --Anatoli (обсудить/вклад) 01:22, 18 March 2013 (UTC)
In other words tr should produce the actual romanization scheme we're using (if possible) and entries/translations not following could/should be changed to match the current standard. User:KYPark had disagreements with some parts of the revised system because it wasn't phonetic enough but there's no perfect system. --Anatoli (обсудить/вклад) 01:27, 18 March 2013 (UTC)
I would prefer a more descriptive name than just two letters, though. Same for all the other modules. —CodeCat 01:48, 18 March 2013 (UTC)
You're maybe right (before it's too late) but it will be a lot of typing when you have to add a call to the function to each inflection form for quite a lot of templates. I saw people have already started using it. tr is also the parameter name used in many other templates. --Anatoli (обсудить/вклад) 02:19, 18 March 2013 (UTC)
Already quite widely used, intuitive to Wiktionary editors, and way shorter. Let's stick with tr. —Μετάknowledgediscuss/deeds 02:44, 18 March 2013 (UTC)

Debugging[edit]

Is there an easy way to debug modules - walk trough the code to see the values of variables? --Anatoli (обсудить/вклад) 10:20, 17 March 2013 (UTC)

No, I don't think so. You should be able to use mw.log to write messages to the debug console, but nothing like a "debugger" like you might be used to from Visual Studio. —RuakhTALK 22:53, 17 March 2013 (UTC)

Rewritten[edit]

I've rewritten this module using a different romanisation approach, and it appears to be less buggy now. Wyang (talk) 13:56, 12 April 2014 (UTC)

Unit tests say otherwise. And reading this code makes me cringe. Keφr 18:17, 12 April 2014 (UTC)