![]() |
|
Replacing RTK keywords with kanji in English texts - Printable Version +- kanji koohii FORUM (http://forum.koohii.com) +-- Forum: Learning Japanese (http://forum.koohii.com/forum-4.html) +--- Forum: Learning resources (http://forum.koohii.com/forum-9.html) +--- Thread: Replacing RTK keywords with kanji in English texts (/thread-9800.html) |
Replacing RTK keywords with kanji in English texts - lauri_ranta - 2012-08-22 There is a Chrome and Firefox extension called Characterizer that replaces RTK keywords with kanji on websites. I wrote a simple Ruby script that does the same thing for plain text files: require "open-uri" input = IO.read("input.txt") open("http://jptxt.net/rtk-keywords.txt").read.split("\n").grep(/^[^#]/)[0..2199].each { |k| kanji, keyword = k.split(";").values_at(0, 2) input.gsub!(/(\b|[“”‘’…—])#{Regexp.escape(keyword)}(\b|[“”‘’…—])/i, "\\1#{kanji}\\2") } puts input The output looks like this: Jofuku was the Wise 男 之 China. 多 books 彼 読, and 彼 never forgot 何 was 中 them. 皆 the characters 彼 knew as 彼 knew the lines 中 the palm 之 his 手. 彼 learned secrets 乃 birds and beasts, and herbs and flowers and trees, and rocks and metals. 彼 knew magic and poetry and 哲. 彼 grew 満 之 years and 智. 皆 the 民 honoured him; but 彼 was 勿 happy, for 彼 had a 語 written upon his 心. If you use OS X, you can run the script by for example saving it as ~/script.rb, saving the input text as ~/input.txt, and then running "ruby script.rb" in Terminal. I uploaded a sample output text to http://jptxt.net/japanese-fairy-tales.txt. Replacing RTK keywords with kanji in English texts - yudantaiteki - 2012-08-22 This seems more dangerous than helpful to me, because some of the characters are being used in totally different ways than in Japanese. It's also kanji->English studying, which is not recommended either by Heisig or most people on this forum. For instance: 中 the palm 之 his 手. 彼 learned secrets 乃 birds and beasts 之 isn't used in modern Japanese outside of names, and it doesn't really map to "of". I don't even know what 乃 is supposed to mean here. "From"? 勿 is only "never" in old texts, mostly classical Chinese. It just seems strange to study this way to me -- many of these phrases, in Japanese, would not use the kanji that appear in these script replacements, so you're not really studying Japanese with this, just RTK. Such being the 州 之 affairs 州 means "state" in the sense of a division of a country, not state of affairs. Replacing RTK keywords with kanji in English texts - jmignot - 2012-08-23 There was already an add-on for Firefox which did about the same: http://kanjilish.mozdev.org/ I tried it some time ago but, I must say, never used it seriously for studying. It may be useful if one uses it just for drilling the kanji-keyword associations, while keeping it completely separate from the actual meaning of the sentence in which it appears. |