Skip to content

Commit

Permalink
Added handling for special cases:
Browse files Browse the repository at this point in the history
Due to tokenizer's behavior '見れる' will be one token.
So now it handle this case specially
  • Loading branch information
hirokiky committed Oct 16, 2020
1 parent e06a0b7 commit 4ac46d3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ public void validate(Sentence sentence) {
for (int i = 0; i < (tokens.size() - 1); ++i) {
final TokenElement p = tokens.get(i);
final List<String> ptags = p.getTags();
if (ptags.get(0).equals("動詞") && ptags.get(1).equals("自立") && ptags.get(2).equals("一段") && ptags.get(3).equals("未然形")) {
if (ptags.get(0).equals("動詞") && p.getSurface().equals("見れる")) {
addLocalizedError(sentence, p.getSurface());
} else if (ptags.get(0).equals("動詞") && ptags.get(1).equals("自立") && ptags.get(2).equals("一段") && ptags.get(3).equals("未然形")) {
final TokenElement q = tokens.get(i+1);
final List<String> qtags = q.getTags();
if (qtags.get(0).equals("動詞") && qtags.get(1).equals("接尾") && q.getSurface().startsWith("られ")) {
Expand Down

0 comments on commit 4ac46d3

Please sign in to comment.