Skip to content

Commit

Permalink
Fix cases where particles were being incorrectly grouped after masu
Browse files Browse the repository at this point in the history
  • Loading branch information
mwhirls committed Jan 30, 2024
1 parent a55cd21 commit 5c107bf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/internal/segmenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,10 @@ function handleMasu(cursor: TokenCursor) {
const masen = nextWord(next);
const nextNext = next.next();
if (nextNext) {
const desu = nextWord(nextNext);
masen.next = desu;
if (isPoliteCopula(nextNext.token())) {
const desu = nextWord(nextNext);
masen.next = desu;
}
}
return new IpadicConjugation(token, masen);
} else if (nextToken.pos === PartOfSpeech.AuxillaryVerb) { // まし(た)
Expand Down
7 changes: 7 additions & 0 deletions test/particle.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,5 +204,12 @@ export function runTestSuite(context: TestContext) {
];
runTest(cases, 'から', -1, context);
});

describe('ので', function () {
const cases = [
'いつもめ事を起こすか分かりませんので',
];
runTest(cases, 'ので', -1, context);
});
});
}

0 comments on commit 5c107bf

Please sign in to comment.