Skip to content

Commit e87f343

Browse files
committed
completely remove includeGerund parameter
1 parent 867031b commit e87f343

6 files changed

Lines changed: 11 additions & 29 deletions

File tree

src/dictionary/soft-build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// this code is Deno only
22

33
import { exists } from "@std/fs/exists";
4-
import { Parser } from './parallel_parser.ts'
4+
import { Parser } from "./parallel_parser.ts";
55

66
if (import.meta.main) {
77
using parser = new Parser();

src/translator2/modifier.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,7 @@ function defaultModifier(wordUnit: TokiPona.WordUnit) {
167167
function pi(
168168
insidePhrase: TokiPona.Phrase,
169169
): IterableResult<ModifierTranslation> {
170-
return phrase({
171-
phrase: insidePhrase,
172-
includeGerund: true,
173-
})
170+
return phrase(insidePhrase)
174171
.filter((modifier) =>
175172
modifier.type !== "verb" &&
176173
(modifier.type !== "adjective" || modifier.inWayPhrase == null) &&

src/translator2/nanpa.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ import { phrase } from "./phrase.ts";
99
export function nanpa(
1010
nanpa: TokiPona.Nanpa,
1111
): IterableResult<English.SimpleNounPhrase> {
12-
return phrase({
13-
phrase: nanpa.phrase,
14-
includeGerund: true,
15-
})
12+
return phrase(nanpa.phrase)
1613
.filterMap((phrase): null | English.SimpleNounPhrase =>
1714
phrase.type !== "noun"
1815
? throwError(

src/translator2/phrase.ts

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ import { ExhaustedError, FilteredError } from "./error.ts";
99
import { CONJUNCTION } from "./misc.ts";
1010
import {
1111
adjectivalIsNone,
12-
AdjectivalModifier, adverbialIsNone,
12+
AdjectivalModifier,
13+
adverbialIsNone,
1314
AdverbialModifier,
1415
multipleModifiers,
15-
} from './modifier.ts'
16+
} from "./modifier.ts";
1617
import { nounAsPreposition, preposition } from "./preposition.ts";
1718
import { wordUnit } from "./word_unit.ts";
1819

@@ -148,12 +149,8 @@ function verbPhrase(
148149
};
149150
}
150151
function defaultPhrase(
151-
options: Readonly<{
152-
phrase: TokiPona.Phrase & { type: "simple" };
153-
includeGerund: boolean;
154-
}>,
152+
phrase: TokiPona.Phrase & { type: "simple" },
155153
) {
156-
const { phrase } = options;
157154
const emphasis = phrase.emphasis != null;
158155
return IterableResult.combine(
159156
wordUnit(phrase.headWord),
@@ -248,10 +245,7 @@ function preverb(
248245
);
249246
return IterableResult.combine(
250247
verb,
251-
translatePhrase({
252-
phrase: preverb.phrase,
253-
includeGerund: false,
254-
}),
248+
translatePhrase(preverb.phrase),
255249
)
256250
.filterMap(([verb, predicate]): null | English.SimpleVerbPhrase => {
257251
if (
@@ -301,15 +295,11 @@ function preverb(
301295
}
302296
const translatePhrase = phrase;
303297
export function phrase(
304-
options: Readonly<{
305-
phrase: TokiPona.Phrase;
306-
includeGerund: boolean;
307-
}>,
298+
phrase: TokiPona.Phrase,
308299
): IterableResult<PhraseTranslation> {
309-
const { phrase } = options;
310300
switch (phrase.type) {
311301
case "simple":
312-
return defaultPhrase({ ...options, phrase });
302+
return defaultPhrase(phrase);
313303
case "preposition":
314304
return preposition(phrase)
315305
.map(prepositionAsVerb)
@@ -394,14 +384,13 @@ export function phraseAsVerb(
394384
export function multiplePhrases(
395385
options: Readonly<{
396386
phrases: TokiPona.MultiplePhrases;
397-
includeGerund: boolean;
398387
andParticle: null | string;
399388
}>,
400389
): IterableResult<PhraseTranslation> {
401390
const { phrases, andParticle } = options;
402391
switch (phrases.type) {
403392
case "simple":
404-
return phrase({ ...options, phrase: phrases.phrase });
393+
return phrase(phrases.phrase);
405394
case "and":
406395
case "anu": {
407396
const conjunction = CONJUNCTION[phrases.type];

src/translator2/predicate.ts

Whitespace-only changes.

src/translator2/preposition.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export function preposition(
3333
),
3434
multiplePhrases({
3535
phrases: preposition.phrases,
36-
includeGerund: true,
3736
andParticle: null,
3837
})
3938
.filterMap((phrases) =>

0 commit comments

Comments
 (0)