Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Okurigana feature #853

Merged
merged 2 commits into from
Mar 8, 2019
Merged

Conversation

Toshihiko-Yamazaki
Copy link
Contributor

Hello,
I'm considering the improvement of Okurigana feature.
Please confirm whether the reviced code is acceptable or not.

[Improved feature]
Improve Okurigana feature

[Issue]
If the verb of "消費する" is included with the sentnce,
The unexpected issues will be detected as 不正な送り仮名.

[Measure]
The unexpected issues won't be deteced
if the existing code is replaced with the reviced code.

The existing code

static {
    invalidOkurigana = new HashSet<>();
    invalidOkurigana.add("費さ");
    invalidOkurigana.add("費し");
    invalidOkurigana.add("費す");
    invalidOkurigana.add("費せ");
    invalidOkurigana.add("費そ");

}

The reviced code

static {
    invalidOkuriganaTokens.add(new ExpressionRule().addElement(new TokenElement("費さ", asList("動詞", "自立"), 0)));
    invalidOkuriganaTokens.add(new ExpressionRule().addElement(new TokenElement("費し", asList("動詞", "自立"), 0)));
    invalidOkuriganaTokens.add(new ExpressionRule().addElement(new TokenElement("費す", asList("動詞", "自立"), 0)));
    invalidOkuriganaTokens.add(new ExpressionRule().addElement(new TokenElement("費せ", asList("動詞", "自立"), 0)));
    invalidOkuriganaTokens.add(new ExpressionRule().addElement(new TokenElement("費そ", asList("動詞", "自立"), 0)));
}

If the reviced code is conducted,
the behavior is the folowing.

The detected issues
費した
費す
Not the deteced issues
消費する
費やす

I think there are similar 26 patterns like the above.
26 patterns make them improve the reslt.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.09%) to 91.403% when pulling d8171f8 on Toshihiko-Yamazaki:master into 57bbef7 on redpen-cc:master.

@takahi-i
Copy link
Member

takahi-i commented Mar 8, 2019

Thank you very much for the valuable contributions!! @Toshihiko-Yamazaki

@takahi-i takahi-i merged commit 8c6f838 into redpen-cc:master Mar 8, 2019
@Toshihiko-Yamazaki
Copy link
Contributor Author

Thank you very much for confirming and merging my code. I have been working on my work to take advantage of RedPen. I’ll continue to consider how to use RedPen efficiently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants