@@ -8,6 +8,7 @@ import { condense } from "./misc.ts";
8
8
import { noun } from "./noun.ts" ;
9
9
import { nounAsPreposition } from "./preposition.ts" ;
10
10
import { noEmphasis , word } from "./word.ts" ;
11
+ import { version } from "esbuild" ;
11
12
12
13
export type VerbObjects = Readonly < {
13
14
object : null | English . NounPhrase ;
@@ -161,10 +162,8 @@ export function fromVerbForms(
161
162
verbForms : Dictionary . VerbForms ;
162
163
perspective : Dictionary . Perspective ;
163
164
quantity : English . Quantity ;
164
- reduplicationCount : number ;
165
- emphasis : boolean ;
166
165
} > ,
167
- ) : ArrayResult < English . Verb > {
166
+ ) : ArrayResult < Readonly < { modal : null | string ; verb : string } > > {
168
167
const { verbForms, perspective, quantity } = options ;
169
168
const is = verbForms . presentSingular === "is" ;
170
169
const presentSingular = is && perspective === "first"
@@ -177,47 +176,37 @@ export function fromVerbForms(
177
176
quantity !== "singular" || ( ! is && perspective !== "third" )
178
177
? [ pastPlural , verbForms . presentPlural ]
179
178
: [ pastSingular , presentSingular ] ;
180
- let verb : ArrayResult < { modal : null | string ; verb : string } > ;
181
179
switch ( settings . tense ) {
182
180
case "condensed" :
183
181
if ( is ) {
184
182
if ( quantity === "condensed" ) {
185
- verb = new ArrayResult ( [ {
183
+ return new ArrayResult ( [ {
186
184
modal : null ,
187
185
verb : "is/are/was/were/will be" ,
188
186
} ] ) ;
189
187
} else {
190
- verb = new ArrayResult ( [ {
188
+ return new ArrayResult ( [ {
191
189
modal : null ,
192
190
verb : `${ present } /${ past } /will be` ,
193
191
} ] ) ;
194
192
}
195
193
} else {
196
- verb = new ArrayResult ( [ {
194
+ return new ArrayResult ( [ {
197
195
modal : "(will)" ,
198
196
verb : condenseVerb ( present , past ) ,
199
197
} ] ) ;
200
198
}
201
- break ;
202
199
case "both" : {
203
200
const future = is ? "be" : verbForms . presentPlural ;
204
- verb = new ArrayResult ( [
201
+ return new ArrayResult ( [
205
202
{ modal : null , verb : present } ,
206
203
{ modal : null , verb : past } ,
207
204
{ modal : "will" , verb : future } ,
208
205
] ) ;
209
- break ;
210
206
}
211
207
case "default only" :
212
- verb = new ArrayResult ( [ { modal : null , verb : present } ] ) ;
213
- break ;
208
+ return new ArrayResult ( [ { modal : null , verb : present } ] ) ;
214
209
}
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
- } ) ;
221
210
}
222
211
export function verb (
223
212
partialVerb : PartialCompoundVerb ,
@@ -232,15 +221,26 @@ export function verb(
232
221
verbForms,
233
222
perspective,
234
223
quantity,
235
- reduplicationCount : partialVerb . reduplicationCount ,
236
- emphasis : partialVerb . wordEmphasis ,
237
224
} )
238
225
. map < English . VerbPhrase > ( ( verb ) => ( {
239
226
...partialVerb ,
240
227
type : "default" ,
241
228
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
+ ] ,
244
244
} ,
245
245
contentClause : null ,
246
246
hideVerb : false ,
0 commit comments