Skip to content

Commit 8c796f0

Browse files
committed
rename
1 parent d98e109 commit 8c796f0

File tree

12 files changed

+23
-23
lines changed

12 files changed

+23
-23
lines changed

dictionary/parser.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
} from "../src/parser/parser_lib.ts";
2727
import {
2828
Adjective,
29+
AdjectiveName,
2930
Adverb,
3031
Definition,
3132
Determiner,
@@ -34,7 +35,6 @@ import {
3435
IndirectObject,
3536
Noun,
3637
NounForms,
37-
PostAdjective,
3838
VerbAccessory,
3939
} from "./type.ts";
4040

@@ -263,14 +263,14 @@ const noun = sequence(
263263
simpleUnit("adj"),
264264
word.skip(tag(sequence(keyword("n"), keyword("proper")))),
265265
)
266-
.map(([adjective, name]): PostAdjective => ({ adjective, name })),
266+
.map(([adjective, name]): AdjectiveName => ({ adjective, name })),
267267
),
268268
)
269-
.map(([determiners, adjectives, noun, postAdjective]): Noun => ({
269+
.map(([determiners, adjectives, noun, adjectiveName]): Noun => ({
270270
...noun,
271271
determiners,
272272
adjectives,
273-
postAdjective,
273+
adjectiveName,
274274
}));
275275
const checkedNoun = new CheckedParser(
276276
choiceOnlyOne(

dictionary/type.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export type NounForms = Readonly<{
22
singular: null | string;
33
plural: null | string;
44
}>;
5-
export type PostAdjective = Readonly<{
5+
export type AdjectiveName = Readonly<{
66
adjective: string;
77
name: string;
88
}>;
@@ -12,7 +12,7 @@ export type Noun =
1212
determiners: ReadonlyArray<Determiner>;
1313
adjectives: ReadonlyArray<Adjective>;
1414
gerund: boolean;
15-
postAdjective: null | PostAdjective;
15+
adjectiveName: null | AdjectiveName;
1616
}>;
1717
export type PronounForms = Readonly<{
1818
singular: null | Readonly<{ subject: string; object: string }>;

src/translator/ast.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export type Word = Readonly<{
77
emphasis: boolean;
88
}>;
99
export type Quantity = "singular" | "plural" | "condensed";
10-
export type PostAdjective = Readonly<{ adjective: string; name: string }>;
10+
export type AdjectiveName = Readonly<{ adjective: string; name: string }>;
1111
export type NounPhrase =
1212
| Readonly<{
1313
type: "simple";
@@ -16,7 +16,7 @@ export type NounPhrase =
1616
noun: Word;
1717
quantity: Quantity;
1818
perspective: Dictionary.Perspective;
19-
postAdjective: null | PostAdjective;
19+
adjectiveName: null | AdjectiveName;
2020
postCompound: null | NounPhrase;
2121
prepositions: ReadonlyArray<Preposition>;
2222
emphasis: boolean;

src/translator/clause.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function phraseClause(phrases: TokiPona.MultiplePhrases) {
4040
},
4141
quantity: "singular",
4242
perspective: "third",
43-
postAdjective: null,
43+
adjectiveName: null,
4444
postCompound: null,
4545
prepositions: [],
4646
emphasis: false,
@@ -102,7 +102,7 @@ function iWish(
102102
noun: noEmphasis("I"),
103103
quantity: "singular",
104104
perspective: "first",
105-
postAdjective: null,
105+
adjectiveName: null,
106106
postCompound: null,
107107
prepositions: [],
108108
emphasis: false,
@@ -143,7 +143,7 @@ function oClause(clause: TokiPona.Clause & { type: "o clause" }) {
143143
noun: noEmphasis("you"),
144144
quantity: "plural",
145145
perspective: "second",
146-
postAdjective: null,
146+
adjectiveName: null,
147147
postCompound: null,
148148
prepositions: [],
149149
emphasis: false,

src/translator/composer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function noun(phrases: English.NounPhrase, depth: number): string {
1818
...phrases.determiners.map(({ determiner }) => word(determiner)),
1919
...phrases.adjectives.map(adjective),
2020
word(phrases.noun),
21-
...nullableAsArray(phrases.postAdjective)
21+
...nullableAsArray(phrases.adjectiveName)
2222
.map(({ adjective, name }) => `${adjective} ${name}`),
2323
...nullableAsArray(phrases.postCompound)
2424
.map((phrase) => noun(phrase, 0)),

src/translator/fixer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function rankNoun(noun: English.NounPhrase): number {
1515
function fixNounPhrase(noun: English.NounPhrase): English.NounPhrase {
1616
switch (noun.type) {
1717
case "simple":
18-
if (noun.postAdjective != null && noun.prepositions.length > 0) {
18+
if (noun.adjectiveName != null && noun.prepositions.length > 0) {
1919
throw new FilteredError("named noun with preposition");
2020
}
2121
if (

src/translator/modifier.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ export function multipleModifiers(
245245
noun: noEmphasis("way"),
246246
quantity: "singular",
247247
perspective: "third",
248-
postAdjective: null,
248+
adjectiveName: null,
249249
postCompound: null,
250250
prepositions: [],
251251
emphasis: false,

src/translator/nanpa.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function nanpa(
3232
quantity: "singular",
3333
perspective: "third",
3434
postCompound: phrase.noun,
35-
postAdjective: null,
35+
adjectiveName: null,
3636
prepositions: [],
3737
emphasis: false,
3838
}

src/translator/noun.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export type PartialNoun =
1919
reduplicationCount: number;
2020
emphasis: boolean;
2121
perspective: Dictionary.Perspective;
22-
postAdjective: null | { adjective: string; name: string };
22+
adjectiveName: null | { adjective: string; name: string };
2323
}>;
2424
export function partialNoun(
2525
options: Readonly<{

src/translator/phrase.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ function nounPhrase(
5555
...[...modifier.adjectives].reverse(),
5656
...noun.adjectives,
5757
];
58-
if (noun.postAdjective != null && modifier.name != null) {
58+
if (noun.adjectiveName != null && modifier.name != null) {
5959
throw new FilteredError("double name");
6060
}
61-
const postAdjective = noun.postAdjective ??
61+
const adjectiveName = noun.adjectiveName ??
6262
mapNullable(
6363
modifier.name,
64-
(name): English.PostAdjective => ({ adjective: "named", name }),
64+
(name): English.AdjectiveName => ({ adjective: "named", name }),
6565
);
6666
const prepositions = nullableAsArray(modifier.ofPhrase)
6767
.map((object) => nounAsPreposition(object, "of"));
@@ -79,7 +79,7 @@ function nounPhrase(
7979
quantity,
8080
perspective: noun.perspective,
8181
postCompound: null,
82-
postAdjective,
82+
adjectiveName,
8383
prepositions,
8484
emphasis: emphasis &&
8585
nounPreposition == null,

src/translator/pronoun.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export function pronounAsPartialNoun(
3838
determiners: [],
3939
adjectives: [],
4040
perspective: pronoun.perspective,
41-
postAdjective: null,
41+
adjectiveName: null,
4242
};
4343
}
4444
export function pronoun(
@@ -59,7 +59,7 @@ export function pronoun(
5959
quantity,
6060
perspective: definition.perspective,
6161
postCompound: null,
62-
postAdjective: null,
62+
adjectiveName: null,
6363
prepositions: [],
6464
emphasis: false,
6565
}));

src/translator/word_unit.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export function wordUnit(
123123
reduplicationCount: 1,
124124
emphasis: wordUnit.emphasis != null,
125125
perspective: "third",
126-
postAdjective: null,
126+
adjectiveName: null,
127127
}));
128128
case "x ala x":
129129
return IterableResult.errors([new TranslationTodoError("x ala x")]);

0 commit comments

Comments
 (0)