Module talk:User:Suzukaze-c/02
Add topicAppearance
Latest comment: 7 years ago by Wyang in topic r function with nonexistent pages
testing
[edit]- {{ja-r|魔法使い|まほうつかい}}
- {{ja-r|明けましておめでとう|あけまして おめでとう}}
- {{ja-r|ソフトパワー|ソフト パワー}}
- {{ja-r|らしい|らし.い}}
- {{ja-r|厳しい|ーーーーー}}
{
[1] = "きびしい",
[2] = "いつくしい",
}
- {{ja-r|無効|むこう}}
- {{ja-r|背負う|せお.う}}
- {{ja-r|柄|ーーーーー}}
{
[1] = "え",
[2] = "かび",
[3] = "かい",
[4] = "から",
[5] = "がら",
[6] = "つか",
[7] = "つく",
[8] = "ほぞ",
}
- {{ja-r|柄|ーーーーー}}
{
[1] = "え",
[2] = "かび",
[3] = "かい",
[4] = "から",
[5] = "がら",
[6] = "つか",
[7] = "つく",
[8] = "ほぞ",
}
- {{ja-r|linkto=柄|TITLE|から}}
- {{ja-r|WWII|WWII}}
- {{ja-r|还没有这个词条哦|还没有这个词条哦}}
- {{ja-r|还没有这个词条哦|还没有这个词条哦}}
- {{ja-r|魔法使い|まほうつかい}}
- {{ja-r|背負う|せお.う}}
- {{ja-r|明けましておめでとう|^あけまして おめでとう}}
Man, this stuff is powerful.
[edit]Wyang (talk) 07:28, 6 October 2016 (UTC)
I just discovered the r function. I will definitely be using it. — Eru·tuon 04:40, 18 August 2017 (UTC)
r function with nonexistent pages
[edit]Regarding this: Currently the r
function returns {{ja-r}}
with a repetition of the kanji in the second parameter (for instance, {{ja-r|明晦|明晦}}
) if there's no Japanese entry. Because that causes a module error and because {{ja-r}}
requires at least two parameters and requires the second one to have no kanji, I use {{ja-l}}
. Is there a better option? — Eru·tuon 02:56, 6 September 2017 (UTC)
- I look up the word and add the ruby... —suzukaze (t・c) 03:01, 6 September 2017 (UTC)
- Still, the function is hard to use with a long list of bare links, some of which are redlinked, are given faulty
{{ja-r|kanji|kanji}}
by the function, and have to be manually switched to{{ja-l}}
or something else. If you don't want a red-link to result in{{ja-l}}
and there isn't a better option, I'll have to make my own copy of your function. — Eru·tuon 04:31, 6 September 2017 (UTC)- I think that a mixture of
{{ja-l}}
and{{ja-r}}
is unhelpful (readings for only certain words) and really unaesthetic (lack of consistency).{{ja-r|kanji|kanji}}
is intentional; I look up{{{1}}}
in a different dictionary and copy+paste the reading into{{{2}}}
. —suzukaze (t・c) 04:36, 6 September 2017 (UTC)- Well, I don't know how you make it work when it gives a module error. It's annoying. I'm making my own modified function. — Eru·tuon 03:43, 8 September 2017 (UTC)
- @Erutuon: It remains
{{ja-r|kanji|kanji}}
in the edit window, doesn't it? —suzukaze (t・c) 03:45, 8 September 2017 (UTC)- No... I'm substituting it. — Eru·tuon 03:47, 8 September 2017 (UTC)
- I mean, do you usually save it with all the module errors and then go through and add kana? — Eru·tuon 03:58, 8 September 2017 (UTC)
- Either one of these is how I work with it: [1], [2]. ("【wt】ja-r" is part of my global.js stuff, and in the second recording I didn't close the Weblio tab from the first recording...) —suzukaze (t・c) 04:06, 8 September 2017 (UTC)
- Hmm. Why not add a database for Japanese readings in the backend? This is uncopyrightable and there are many of these online (e.g. here). The reading for 冷徹 should be included in most of them: video. Wyang (talk) 04:34, 8 September 2017 (UTC)
- The function could definitely be much smarter but at the moment I consider it a quick hack and haven't really felt the need to add more functionality. —suzukaze (t・c) 05:05, 8 September 2017 (UTC)
- @Wyang: That would be really useful, but I don't know how to convert the XML into a usable data module. — Eru·tuon 21:30, 11 September 2017 (UTC)
- @Erutuon I don't really work with XML files either - to me the easiest solution is to use the command line or write a script and analyse the file line by line. The Kanji and ruby readings are enclosed by various tags; something like
grep -e "\<[rk]eb\>" -e "\<entry\>"
would give the desired lines. Wyang (talk) 01:00, 12 September 2017 (UTC)
- @Erutuon I don't really work with XML files either - to me the easiest solution is to use the command line or write a script and analyse the file line by line. The Kanji and ruby readings are enclosed by various tags; something like
- Hmm. Why not add a database for Japanese readings in the backend? This is uncopyrightable and there are many of these online (e.g. here). The reading for 冷徹 should be included in most of them: video. Wyang (talk) 04:34, 8 September 2017 (UTC)
- Either one of these is how I work with it: [1], [2]. ("【wt】ja-r" is part of my global.js stuff, and in the second recording I didn't close the Weblio tab from the first recording...) —suzukaze (t・c) 04:06, 8 September 2017 (UTC)
- @Erutuon: It remains
- Well, I don't know how you make it work when it gives a module error. It's annoying. I'm making my own modified function. — Eru·tuon 03:43, 8 September 2017 (UTC)
- I think that a mixture of
- Still, the function is hard to use with a long list of bare links, some of which are redlinked, are given faulty