Module talk:User:Suzukaze-c/02

From Wiktionary, the free dictionary
Latest comment: 6 years ago by Wyang in topic r function with nonexistent pages
Jump to navigation Jump to search

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)Reply

I just discovered the r function. I will definitely be using it. — Eru·tuon 04:40, 18 August 2017 (UTC)Reply

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)Reply

I look up the word and add the ruby... —suzukaze (tc) 03:01, 6 September 2017 (UTC)Reply
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)Reply
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 (tc) 04:36, 6 September 2017 (UTC)Reply
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)Reply
@Erutuon: It remains {{ja-r|kanji|kanji}} in the edit window, doesn't it? —suzukaze (tc) 03:45, 8 September 2017 (UTC)Reply
No... I'm substituting it. — Eru·tuon 03:47, 8 September 2017 (UTC)Reply
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)Reply
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 (tc) 04:06, 8 September 2017 (UTC)Reply
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)Reply
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 (tc) 05:05, 8 September 2017 (UTC)Reply
@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)Reply
@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)Reply