Skip to content

Commit 80b4d45

Browse files
committed
reduplication in phrase parser
1 parent e2bb5c8 commit 80b4d45

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/translator.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,18 @@ function defaultPhrase(
642642
)
643643
.flatMap(([headWord, modifier]) => {
644644
if (headWord.type === "noun" && modifier.type === "adjectival") {
645+
let count: number;
646+
switch (phrase.headWord.type) {
647+
case "number":
648+
case "default":
649+
count = 1;
650+
break;
651+
case "x ala x":
652+
return new Output();
653+
case "reduplication":
654+
count = phrase.headWord.count;
655+
break;
656+
}
645657
const determiner = fixDeterminer([
646658
...headWord.determiner,
647659
...modifier.determiner,
@@ -694,7 +706,7 @@ function defaultPhrase(
694706
determiner,
695707
adjective,
696708
noun: {
697-
word: noun.noun,
709+
word: repeat(noun.noun, count),
698710
emphasis: phrase.headWord.emphasis != null,
699711
},
700712
number,

0 commit comments

Comments
 (0)