Skip to content

Commit d4ec3bd

Browse files
committed
fix nanpa translation
1 parent 8bfc9b5 commit d4ec3bd

File tree

5 files changed

+8
-0
lines changed

5 files changed

+8
-0
lines changed

src/translator/ast.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export type NounPhrase =
1414
quantity: Quantity;
1515
perspective: Dictionary.Perspective;
1616
postAdjective: null | Readonly<{ adjective: string; name: string }>;
17+
postCompound: null | NounPhrase;
1718
preposition: ReadonlyArray<Preposition>;
1819
emphasis: boolean;
1920
}>

src/translator/clause.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ function phraseClause(
4343
quantity: "singular",
4444
perspective: "third",
4545
postAdjective: null,
46+
postCompound: null,
4647
preposition: [],
4748
emphasis: false,
4849
},
@@ -108,6 +109,7 @@ function iWish(
108109
quantity: "singular",
109110
perspective: "first",
110111
postAdjective: null,
112+
postCompound: null,
111113
preposition: [],
112114
emphasis: false,
113115
},
@@ -150,6 +152,7 @@ function oClause(
150152
quantity: "plural",
151153
perspective: "second",
152154
postAdjective: null,
155+
postCompound: null,
153156
preposition: [],
154157
emphasis: false,
155158
}]);

src/translator/composer.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ export function noun(phrases: English.NounPhrase, depth: number): string {
2020
word(phrases.noun),
2121
...nullableAsArray(phrases.postAdjective)
2222
.map(({ adjective, name }) => `${adjective} ${name}`),
23+
...nullableAsArray(phrases.postCompound)
24+
.map((phrase) => noun(phrase, 0)),
2325
...phrases.preposition.map(preposition),
2426
]
2527
.join(" ");

src/translator/modifier.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ export function multipleModifiers(
287287
quantity: "singular",
288288
perspective: "third",
289289
postAdjective: null,
290+
postCompound: null,
290291
preposition: [],
291292
emphasis: false,
292293
}

src/translator/noun.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ export function noun(
115115
...partialNoun,
116116
type: "simple",
117117
noun: word({ ...options, word: noun }),
118+
postCompound: null,
118119
quantity,
119120
preposition: [],
120121
emphasis: false,

0 commit comments

Comments
 (0)