@@ -10,7 +10,7 @@ import {
1010import { extractNegativeFromMultipleAdverbs , NOT } from "./adverb.ts" ;
1111import * as English from "./ast.ts" ;
1212import { getNumber } from "./determiner.ts" ;
13- import { ExhaustedError , FilteredError , UntranslatableError } from "./error.ts" ;
13+ import { ExhaustedError , FilteredError } from "./error.ts" ;
1414import { CONJUNCTION } from "./misc.ts" ;
1515import {
1616 AdjectivalModifier ,
@@ -196,10 +196,9 @@ function defaultPhrase(
196196 phrase : TokiPona . Phrase & { type : "simple" } ;
197197 place : Place ;
198198 includeGerund : boolean ;
199- includeVerb : boolean ;
200199 } > ,
201200) {
202- const { phrase, includeVerb } = options ;
201+ const { phrase } = options ;
203202 const emphasis = phrase . emphasis != null ;
204203 return IterableResult . combine (
205204 wordUnit ( { ...options , wordUnit : phrase . headWord } ) ,
@@ -221,7 +220,7 @@ function defaultPhrase(
221220 type : "adjective" ,
222221 } ) ;
223222 } else if (
224- includeVerb && headWord . type === "verb" && modifier . type === "adverbial"
223+ headWord . type === "verb" && modifier . type === "adverbial"
225224 ) {
226225 return IterableResult . from ( ( ) =>
227226 IterableResult . single < PhraseTranslation > ( {
@@ -286,7 +285,6 @@ function preverb(
286285 phrase : preverb . phrase ,
287286 place : "object" ,
288287 includeGerund : false ,
289- includeVerb : true ,
290288 } ) ,
291289 )
292290 . filterMap ( ( [ verb , predicate ] ) : null | PartialSimpleVerb => {
@@ -345,38 +343,25 @@ export function phrase(
345343 phrase : TokiPona . Phrase ;
346344 place : Place ;
347345 includeGerund : boolean ;
348- includeVerb : boolean ;
349346 } > ,
350347) : IterableResult < PhraseTranslation > {
351- const { phrase, includeVerb } = options ;
348+ const { phrase } = options ;
352349 switch ( phrase . type ) {
353350 case "simple" :
354351 return defaultPhrase ( { ...options , phrase } ) ;
355352 case "preposition" :
356- if ( includeVerb ) {
357- return preposition ( phrase )
358- . map ( prepositionAsVerb )
359- . map ( ( verb ) : PhraseTranslation => ( {
360- type : "verb" ,
361- verb : { ...verb , type : "simple" } ,
362- } ) ) ;
363- } else {
364- return IterableResult . errors ( [
365- new UntranslatableError ( "preposition" , "noun or adjective" ) ,
366- ] ) ;
367- }
353+ return preposition ( phrase )
354+ . map ( prepositionAsVerb )
355+ . map ( ( verb ) : PhraseTranslation => ( {
356+ type : "verb" ,
357+ verb : { ...verb , type : "simple" } ,
358+ } ) ) ;
368359 case "preverb" :
369- if ( includeVerb ) {
370- return preverb ( phrase )
371- . map ( ( verb ) : PhraseTranslation => ( {
372- type : "verb" ,
373- verb : { ...verb , type : "simple" } ,
374- } ) ) ;
375- } else {
376- return IterableResult . errors ( [
377- new UntranslatableError ( "preverb" , "noun or adjective" ) ,
378- ] ) ;
379- }
360+ return preverb ( phrase )
361+ . map ( ( verb ) : PhraseTranslation => ( {
362+ type : "verb" ,
363+ verb : { ...verb , type : "simple" } ,
364+ } ) ) ;
380365 }
381366}
382367export function phraseAsVerb (
@@ -443,10 +428,9 @@ export function multiplePhrases(
443428 place : Place ;
444429 includeGerund : boolean ;
445430 andParticle : null | string ;
446- includeVerb : boolean ;
447431 } > ,
448432) : IterableResult < PhraseTranslation > {
449- const { phrases, andParticle, includeVerb } = options ;
433+ const { phrases, andParticle } = options ;
450434 switch ( phrases . type ) {
451435 case "simple" :
452436 return phrase ( { ...options , phrase : phrases . phrase } ) ;
@@ -488,7 +472,7 @@ export function multiplePhrases(
488472 inWayPhrase : null ,
489473 } ;
490474 }
491- } else if ( includeVerb ) {
475+ } else {
492476 return {
493477 type : "verb" ,
494478 verb : {
@@ -500,8 +484,6 @@ export function multiplePhrases(
500484 prepositions : [ ] ,
501485 } ,
502486 } ;
503- } else {
504- return null ;
505487 }
506488 } )
507489 . addErrorWhenNone ( ( ) =>
0 commit comments