Closed inoueakimitsu closed 2 years ago
To add an option to avoid splitting consecutive Kanji characters, the following two points have been implemented.
prevent_splitting_consecutive_kanjis
was added to options_ui
The example sentences used for testing are as follows:
This relates #9
Oh my God thanks for your PR and hard working! I'm investigating and testing your PR currently.
And add more example sentences for test:
I tried to find these sentences that cause "multiple furigana in the same kanji/tango" from NHK's Twitter.
but I don't exactly know why after I copied-and-pasted them into Github Issue, Furiganaize works correctly in most of them...=> I guess it's because the syntax analyzer (igo.js) may give out multiple potentially correct analysis results for a same long sentence.
(読み方は違う)
The result is much better than I've expected before, I even want to make this option enable by default... But I guess I must be calm down and be patient, test it for a period before making it enabled by default.
Actually, I'm still a little worried about the reliability of RegExp new RegExp(kanji + "(?![^<]*<\/rb>)", 'g');
, but donno how to prove it. Whatever, let's try to use it in real world :P
Thanks for your contribution again!
Your PR has been included in latest v0.6.6, now available for update.
BTW, I add more information to the option.
@kuanyui Thank you for your
igo.js
's multiple outputs behavioroptions_ui
.If you encounter any problems with the regular expression in question, please let me know.
Some of the kanji characters that were once furiganized are matched again to the current regular expression. This fix will make sure that Kanji characters in tags will not be replaced. To do so, a modification is made to the regular expression for the search.
This relates #9