akira-kurogane / furigana-injector

Automatically exported from code.google.com/p/furigana-injector
2 stars 1 forks source link

Furigana appearing over non-kanji (or part-kanji) words such as "ラテン語" #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
To reproduce the issue:
Inject furigana over text containing a word such as "ラテン語". (N.B. make
sure the kanji "語" is not in the kanji-to-exclude list).

Expected result:
Only the furigana "ご" over the kanji "語", and nothing over "ラテン"

Original issue reported on code.google.com by akira%ya...@gtempaccount.com on 24 Mar 2009 at 1:56

GoogleCodeExporter commented 9 years ago
This was addressed in version 1.3.

The code in rubyinserter.js was adjusted so that it didn't match words that 
have the
pattern [non-kanji][kanji]. This means that now "ラテン語" won't get any 
furigana at
all. This type of word is a rare occurence so I thought it was acceptable.

To edit the code to handle the case of "ラテン語" the pattern matching 
needs to be
opened up to the [non-kanji][kanji], [non-kanji][kanji][non-kanji], etc. 
patterns.
Furthermore any katakana should be converted to hiragana so the furigana string 
can
be matched against it.

Original comment by akira%ya...@gtempaccount.com on 31 Mar 2009 at 3:25