Advertisemen
So I began writing in Java, however after nearly completing it Java decided to spout an OutOfMemoryException. Just had to store two hashmaps, one for the On readings, the other for the Kun readings. Parsing the second XML file gave me an OutOfMemory exception. So I switched to C#. Very annoying since it was almost complete.
But anyhow, C# version is in progress, it's nice to start again as the code can be refactored and cleaned up. So far, I have kanji being parsed (only into Kata and Hira as the functionality to translate them both hasn't been implemented. Below are some test runs (modified Dir en grey song titles):
Kanji | Expected Romaji | Output Kata/Hira | Output Romaji |
凱歌沈黙頃 | gaika chinmoku goro | ガイ カ チン モク ケイ | gai ka chin moku kei |
欲巣欲巣 | yoku su yoku su | ヨク ソウ ヨク ソウ | yoku sou yoku sou |
獣慾 | jyuuyoku | ジュウ ヨク | juu yoku |
暁 | akatsuki | ギョウ | gyou |
激闇雨 | geki yame u | ゲキ アン ウ | geki an u |
Note that for 獣慾, the romaji translator gives shishi yoku as output, however, it should be jyuuyoku.
So the tests were nowhere near good enough, some further refactoring:
y>KanjiExpected RomajiOutput Kata/HiraOutput Romaji凱歌沈黙頃gaika chinmoku goroがいか チン モク ころgaika chin moku koro欲巣欲巣yoku su yoku suよく す よく すyoku su yoku su獣慾jyuuyokuけもの ヨクke mo no yoku暁akatsukiあかつきakatsuki激闇雨geki yame uげき やみ あめ geki ya mi ame
I know checked 獣慾 in the XML and I'm not parsing all the data, so that isn't coming out correctly.
A so onto another round of testing!
Aside from spacing errors, the only incorrect one is the last one, which is completely incorrect!
I know checked 獣慾 in the XML and I'm not parsing all the data, so that isn't coming out correctly.
A so onto another round of testing!
Kanji | Expected Romaji | Output Kata/Hira | Output Romaji |
凱歌沈黙頃 | gaika chinmoku goro | ガイ カ チン モク ころ | gai ka chin moku koro |
欲巣欲巣 | yoku su yoku su | よく す よく す | yoku su yoku su |
獣慾 | jyuuyoku | ジュウ ヨク | jyuuyoku |
暁 | akatsuki | あかつき | akatsuki |
激闇雨 | geki yame u | カチンとくる アン ウ | kachin to kuru an u |
Aside from spacing errors, the only incorrect one is the last one, which is completely incorrect!
Advertisemen
Tidak ada komentar:
Posting Komentar