Skip to content

Commit 68d718e

Browse files
committed
it seems unnecessary to extract every adverbs from multiple nouns
1 parent e87f343 commit 68d718e

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

src/translator2/phrase.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { equal } from "@std/assert/equal";
21
import { IterableResult } from "../compound.ts";
32
import { mapNullable, nullableAsArray } from "../misc/misc.ts";
43
import * as TokiPona from "../parser/ast.ts";
@@ -409,11 +408,11 @@ export function multiplePhrases(
409408
);
410409
}
411410
if (phrase.every((phrase) => phrase.type === "noun")) {
412-
const firstAdverbial = phrase[0].adverbialModifier;
413-
const allEqual = phrase.slice(1).every((phrase) =>
414-
equal(phrase.adverbialModifier, firstAdverbial)
415-
);
416-
if (allEqual) {
411+
if (
412+
phrase.every((phrase) =>
413+
adverbialIsNone(phrase.adverbialModifier)
414+
)
415+
) {
417416
return {
418417
type: "noun",
419418
// TODO: flatten compound nouns on the grammar fixer
@@ -422,7 +421,7 @@ export function multiplePhrases(
422421
conjunction,
423422
nouns: phrase.map(({ noun }) => noun),
424423
},
425-
adverbialModifier: firstAdverbial,
424+
adverbialModifier: { adverbs: [], inWayPhrase: null },
426425
};
427426
} else {
428427
return null;

0 commit comments

Comments
 (0)