Skip to content

Commit 470d440

Browse files
committed
reuse verb function
1 parent 4159c69 commit 470d440

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

src/translator/as-string.ts

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import * as Dictionary from "../../dictionary/type.ts";
22
import { Output } from "../output.ts";
33
import { adjective, compoundAdjective } from "./adjective.ts";
4-
import * as English from "./ast.ts";
54
import * as EnglishComposer from "./composer.ts";
65
import { nounAsPlainString, simpleNounForms } from "./noun.ts";
76
import { pronoun } from "./pronoun.ts";
8-
import { fromVerbForms, partialVerb } from "./verb.ts";
7+
import { partialVerb, verb } from "./verb.ts";
98

109
export function definitionAsPlainString(
1110
definition: Dictionary.Definition,
@@ -36,17 +35,10 @@ export function definitionAsPlainString(
3635
case "interjection":
3736
return new Output([definition.interjection]);
3837
case "verb": {
39-
return Output.combine(
40-
fromVerbForms(definition, "third", "plural", 1, false),
41-
partialVerb(definition, 1, false),
42-
)
43-
.map<English.VerbPhrase>(([verb, partialVerb]) => ({
44-
...partialVerb,
45-
type: "default",
46-
verb,
47-
objectComplement: null,
48-
hideVerb: false,
49-
}))
38+
return partialVerb(definition, 1, false)
39+
.flatMap((partialVerb) =>
40+
verb({ ...partialVerb, type: "simple" }, "third", "plural")
41+
)
5042
.map((verb) => EnglishComposer.verb(verb, 0));
5143
}
5244
case "filler":

0 commit comments

Comments
 (0)