![]() |
|
Generating Kanji readings in Excel - 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: Generating Kanji readings in Excel (/thread-10180.html) |
Generating Kanji readings in Excel - Green_Airplane - 2012-11-17 Hello, I have a bit of a technical question, concerning MS Excel. I've been going through Kanji Odyssey 2001, part 3. Those of you familiar with the materials will know that there are no sample sentences for part 3. So I'm making my own. I'm making a list in Excel, usually 3 to 5 characters a day, which means anywhere between 10 and 20 keywords, and thus sample sentences. I copy the keywords from the electronic materials included with the book, and then I look up sample sentences in online dictionaries. I'm maintaining an exact format, so I can easily suck the whole thing into a more sophisticated database tool in the future, if need be. The format is roughly as follows (the "|" symbol represents cell delimiter here): character number | character | character reading(s) | keyword | keyword reading | keyword translation (English) | sample sentence | sample sentence reading | sample sentence translation (English) if there are more keywords for a single Kanji (which is usually the case) I don't repeat the first four fields, dealing with the Kanji itself. After I add all the data for a given day, I copy the sample sentence, and its translation, into Anki. I use the Japanese flashcard model, I let Anki fill in the readings. I also change the relevant Kanji's color to blue, to mimic the KO2001 part 1 and 2's sample sentence format. This process is fairly time consuming, so I'm trying to streamline it as much as possible. One thing I'd like to get rid of is having to type in the readings. I do it twice for each entry, once for the keyword and once for the sample sentence. I know MS Office can generate readings for Japanese, because I had Word generate furigana for some Japanese texts. I'm not sure if this is out of the box functionality, or if I had to install some extra package. Either way, I'd like to leverage this. But I don't want furigana, I want separate text with all the Kanji replaced with hiragana. For example, if I write 「人工芝」 in cell G72, I want Excel to fill in 「じんこうしば」 in cell H72. The reading generators (in Office and Anki both) usually get it right. But sometimes there are multiple possibilities, and they may not necessarily pick the right one. Or there are two equally valid options, and I want to include the other one, or both. So I have to edit the generated readings occasionally. Therefore I don't want this to be an equation: nothing like "=getJapaneseReading(G72)" I would have to break the equation to edit this. So I'd rather have this as a one-time event, triggered by something specific (like a keyboard shortcut, or focus entering/leaving a specific cell) I believe this could be achieved by a macro? I have next to no experience with Excel's more advanced features. However I am in fact a software developer, so feel free to get technical with me. I can probably figure out how to make a macro on my own. The problem lies in the Japanese reading generation functionality. I tried googling for it, with no luck whatsoever. As this forum deals with Japanese language, I figured there'd be a good chance somebody here knows the answer. Thank you in advance. Generating Kanji readings in Excel - avelicu - 2012-11-18 Hello! I don't think you can access the furigana generator in any way programmatically in office macros. However, if you want to do this, i think you can use mecab by calling it as an exe from within your Excel macro. It will give you the reading for the word that you pass to it. If you pass a sentence it should give you the appropriate reading for each word based on context. (ps: I have no experience with mecab, only with Chasen. You could try that too, but I don't really know if it works on windows) Generating Kanji readings in Excel - avelicu - 2012-11-18 Here is the page http://mecab.googlecode.com/svn/trunk/mecab/doc/index.html#install-windows As for running it, try using It like this: Mecab.exe -Oyomi < input.txt You will have to parse the output yourself in excel ![]() Good luck! Generating Kanji readings in Excel - Green_Airplane - 2012-11-19 Thanks, I tried Mecab, with the exact parameters you gave me. But all it did was take the text from the input file I specified, and print it in the console. No change whatsoever. If the tool can really do what I need, I haven't figured out how just yet. I tried googling for some manual, but it's like the thing was made by ninjas. I know there's a lot of text on the Mecab homepage, but it's all in Japanese, so it'll take time for me to decipher. If you could provide a link to instructions in English, that would be very helpful. Anyway, if I were to use it as you suggested, it would actually slow me down, not speed up my work. I need some one-click functionality in Excel, that would run the program, with the appropriate string as its input, and place the output in the intended cell. Can this even be done in Excel? Generating Kanji readings in Excel - HelenF - 2012-11-23 To import your spreadsheet from Excel to Anki, you need to convert it to an intermediate text file anyway. It might be easier to do the processing of readings on the text file instead of in Excel. The Mecab Python interface is pretty reasonable. You could either have an interactive step in the Python program to choose between possibilities, or just correct it in Anki. |