Skip to content

Commit 3de7326

Browse files
committed
fix adverb not showing, fixes #76
1 parent 7051a6e commit 3de7326

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

src/translator/verb.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { condense } from "./misc.ts";
88
import { noun } from "./noun.ts";
99
import { nounAsPreposition } from "./preposition.ts";
1010
import { noEmphasis, word } from "./word.ts";
11+
import { version } from "esbuild";
1112

1213
export type VerbObjects = Readonly<{
1314
object: null | English.NounPhrase;
@@ -161,10 +162,8 @@ export function fromVerbForms(
161162
verbForms: Dictionary.VerbForms;
162163
perspective: Dictionary.Perspective;
163164
quantity: English.Quantity;
164-
reduplicationCount: number;
165-
emphasis: boolean;
166165
}>,
167-
): ArrayResult<English.Verb> {
166+
): ArrayResult<Readonly<{ modal: null | string; verb: string }>> {
168167
const { verbForms, perspective, quantity } = options;
169168
const is = verbForms.presentSingular === "is";
170169
const presentSingular = is && perspective === "first"
@@ -177,47 +176,37 @@ export function fromVerbForms(
177176
quantity !== "singular" || (!is && perspective !== "third")
178177
? [pastPlural, verbForms.presentPlural]
179178
: [pastSingular, presentSingular];
180-
let verb: ArrayResult<{ modal: null | string; verb: string }>;
181179
switch (settings.tense) {
182180
case "condensed":
183181
if (is) {
184182
if (quantity === "condensed") {
185-
verb = new ArrayResult([{
183+
return new ArrayResult([{
186184
modal: null,
187185
verb: "is/are/was/were/will be",
188186
}]);
189187
} else {
190-
verb = new ArrayResult([{
188+
return new ArrayResult([{
191189
modal: null,
192190
verb: `${present}/${past}/will be`,
193191
}]);
194192
}
195193
} else {
196-
verb = new ArrayResult([{
194+
return new ArrayResult([{
197195
modal: "(will)",
198196
verb: condenseVerb(present, past),
199197
}]);
200198
}
201-
break;
202199
case "both": {
203200
const future = is ? "be" : verbForms.presentPlural;
204-
verb = new ArrayResult([
201+
return new ArrayResult([
205202
{ modal: null, verb: present },
206203
{ modal: null, verb: past },
207204
{ modal: "will", verb: future },
208205
]);
209-
break;
210206
}
211207
case "default only":
212-
verb = new ArrayResult([{ modal: null, verb: present }]);
213-
break;
208+
return new ArrayResult([{ modal: null, verb: present }]);
214209
}
215-
return verb.map(({ modal, verb }) => {
216-
return {
217-
modal: mapNullable(modal, (modal) => noAdverbs(noEmphasis(modal))),
218-
verb: [noAdverbs(word({ ...options, word: verb }))],
219-
};
220-
});
221210
}
222211
export function verb(
223212
partialVerb: PartialCompoundVerb,
@@ -232,15 +221,26 @@ export function verb(
232221
verbForms,
233222
perspective,
234223
quantity,
235-
reduplicationCount: partialVerb.reduplicationCount,
236-
emphasis: partialVerb.wordEmphasis,
237224
})
238225
.map<English.VerbPhrase>((verb) => ({
239226
...partialVerb,
240227
type: "default",
241228
verb: {
242-
modal: verb.modal,
243-
verb: [...verb.verb, ...partialVerb.rest],
229+
modal: mapNullable(
230+
mapNullable(verb.modal, noEmphasis),
231+
noAdverbs,
232+
),
233+
verb: [
234+
{
235+
adverb: partialVerb.adverb,
236+
verb: word({
237+
word: verb.verb,
238+
reduplicationCount: partialVerb.reduplicationCount,
239+
emphasis: partialVerb.wordEmphasis,
240+
}),
241+
},
242+
...partialVerb.rest,
243+
],
244244
},
245245
contentClause: null,
246246
hideVerb: false,

0 commit comments

Comments
 (0)