Skip to content

Commit 0b0e98c

Browse files
committed
prepare inflection resolver and composer
1 parent 2c77f56 commit 0b0e98c

19 files changed

Lines changed: 23 additions & 21 deletions
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import * as Dictionary from "../dictionary/type.ts";
22

3-
// When editing, update `./fixer.ts` as well
4-
53
export type Word = Readonly<{
64
word: string;
75
emphasis: boolean;
@@ -27,17 +25,21 @@ export type NounPhrase =
2725
nouns: ReadonlyArray<NounPhrase>;
2826
}>;
2927
export type Determiner = Readonly<{
30-
kind: Dictionary.DeterminerType;
3128
determiner: Word;
29+
30+
// TODO: remove these two
31+
kind: Dictionary.DeterminerType;
3232
quantity: Dictionary.Quantity;
3333
}>;
3434
export type AdjectivePhrase =
3535
| Readonly<{
3636
type: "simple";
37-
kind: Dictionary.AdjectiveType;
3837
adverbs: ReadonlyArray<Adverb>;
3938
adjective: Word;
4039
emphasis: boolean;
40+
41+
// TODO: remove this
42+
kind: Dictionary.AdjectiveType;
4143
}>
4244
| Readonly<{
4345
type: "compound";

src/translator_legacy/adjective.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as TokiPona from "../parser/ast.ts";
55
import { UntranslatableError } from "../translator/error.ts";
66
import { noEmphasis, word } from "../translator/word.ts";
77
import { extractNegativeFromMultipleAdverbs } from "./adverb.ts";
8-
import * as English from "./ast.ts";
8+
import * as English from "../resolver_and_composer/ast.ts";
99

1010
export type AdjectiveWithInWay = Readonly<{
1111
adjective: English.AdjectivePhrase;

src/translator_legacy/adverb.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { noEmphasis } from "../translator/word.ts";
2-
import * as English from "./ast.ts";
2+
import * as English from "../resolver_and_composer/ast.ts";
33

44
export const NOT: English.Adverb = {
55
adverb: noEmphasis("not"),

src/translator_legacy/as_string.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { IterableResult } from "../compound.ts";
22
import * as Dictionary from "../dictionary/type.ts";
33
import { adjective, compoundAdjective } from "./adjective.ts";
4-
import * as EnglishComposer from "./composer.ts";
4+
import * as EnglishComposer from "../resolver_and_composer/composer.ts";
55
import { noun, simpleNounForms } from "./noun.ts";
66
import { pronoun } from "./pronoun.ts";
77
import { partialSimpleVerb, verb } from "./verb.ts";

src/translator_legacy/clause.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { nullableAsArray, throwError } from "../misc/misc.ts";
33
import * as TokiPona from "../parser/ast.ts";
44
import { FilteredError, UntranslatableError } from "../translator/error.ts";
55
import { noEmphasis } from "../translator/word.ts";
6-
import * as English from "./ast.ts";
6+
import * as English from "../resolver_and_composer/ast.ts";
77
import { nanpa } from "./nanpa.ts";
88
import { perspective, quantity } from "./noun.ts";
99
import { multiplePhrases } from "./phrase.ts";

src/translator_legacy/determiner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { IterableResult } from "../compound.ts";
33
import * as Dictionary from "../dictionary/type.ts";
44
import { FilteredError } from "../translator/error.ts";
55
import { word } from "../translator/word.ts";
6-
import * as English from "./ast.ts";
6+
import * as English from "../resolver_and_composer/ast.ts";
77
import { simpleNounForms } from "./noun.ts";
88

99
function filterQuantity(

src/translator_legacy/fixer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as Dictionary from "../dictionary/type.ts";
22
import { mapNullable } from "../misc/misc.ts";
33
import { FilteredError } from "../translator/error.ts";
4-
import * as English from "./ast.ts";
4+
import * as English from "../resolver_and_composer/ast.ts";
55
import { encodeDeterminer } from "./determiner.ts";
66

77
function fixNounPhrase(noun: English.NounPhrase): English.NounPhrase {

src/translator_legacy/modifier.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { ExhaustedError, TranslationTodoError } from "../translator/error.ts";
66
import { number, numberAsText } from "../translator/number.ts";
77
import { noEmphasis, word } from "../translator/word.ts";
88
import { adjective, compoundAdjective } from "./adjective.ts";
9-
import * as English from "./ast.ts";
9+
import * as English from "../resolver_and_composer/ast.ts";
1010
import { determiner } from "./determiner.ts";
1111
import { nanpa } from "./nanpa.ts";
1212
import { noun } from "./noun.ts";

src/translator_legacy/nanpa.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { IterableResult } from "../compound.ts";
22
import { throwError } from "../misc/misc.ts";
33
import * as TokiPona from "../parser/ast.ts";
44
import { FilteredError } from "../translator/error.ts";
5-
import * as English from "./ast.ts";
5+
import * as English from "../resolver_and_composer/ast.ts";
66
import { phrase } from "./phrase.ts";
77

88
export function nanpa(

0 commit comments

Comments
 (0)