Skip to content

Commit f279dc6

Browse files
committed
add more filters for anu
1 parent 82dbdd3 commit f279dc6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/parser/filter.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,17 @@ export const SENTENCE_RULES: ReadonlyArray<(sentence: Sentence) => boolean> = [
346346
}
347347
return true;
348348
},
349+
// "anu la" must only be at the beginning
350+
(sentence) =>
351+
sentence.type !== "simple" ||
352+
sentence.contextClauses.slice(1).every(({ type }) => type !== "anu") ||
353+
throwError(new UnrecognizedError('"anu la" inside a sentence')),
354+
355+
// there cannot be both "anu" as sentence starting particle and "anu la"
356+
(sentence) =>
357+
sentence.type !== "simple" || sentence.startingParticle == null ||
358+
sentence.startingParticle.word !== "anu" ||
359+
sentence.contextClauses.every(({ type }) => type !== "anu"),
349360
];
350361
export const MULTIPLE_SENTENCES_RULES: ReadonlyArray<
351362
(sentences: ReadonlyArray<Sentence>) => boolean

0 commit comments

Comments
 (0)