@@ -4,6 +4,7 @@ import * as TokiPona from "../parser/ast.ts";
4
4
import * as Composer from "../parser/composer.ts" ;
5
5
import {
6
6
AdjectiveWithInWay ,
7
+ combineAdjective ,
7
8
extractNegativeFromAdjective ,
8
9
} from "./adjective.ts" ;
9
10
import { extractNegativeFromMultipleAdverbs , NOT } from "./adverb.ts" ;
@@ -21,7 +22,12 @@ import {
21
22
AdverbialModifier ,
22
23
multipleModifiers ,
23
24
} from "./modifier.ts" ;
24
- import { extractNegativeFromNoun , fromNounForms , PartialNoun } from "./noun.ts" ;
25
+ import {
26
+ combineNoun ,
27
+ extractNegativeFromNoun ,
28
+ fromNounForms ,
29
+ PartialNoun ,
30
+ } from "./noun.ts" ;
25
31
import {
26
32
extractNegativeFromPreposition ,
27
33
nounAsPreposition ,
@@ -291,48 +297,6 @@ export function phrase(
291
297
return IterableResult . errors ( [ new TranslationTodoError ( phrase . type ) ] ) ;
292
298
}
293
299
}
294
- function compoundNoun (
295
- conjunction : string ,
296
- phrases : ReadonlyArray < English . NounPhrase > ,
297
- ) : English . NounPhrase {
298
- const nouns = phrases
299
- . flatMap ( ( noun ) => {
300
- if (
301
- noun . type === "compound" &&
302
- noun . conjunction === conjunction
303
- ) {
304
- return noun . nouns ;
305
- } else {
306
- return [ noun ] ;
307
- }
308
- } ) ;
309
- return {
310
- type : "compound" ,
311
- conjunction,
312
- nouns,
313
- } ;
314
- }
315
- function compoundAdjective (
316
- conjunction : string ,
317
- phrases : ReadonlyArray < English . AdjectivePhrase > ,
318
- ) : English . AdjectivePhrase {
319
- return {
320
- type : "compound" ,
321
- conjunction,
322
- adjectives : phrases
323
- . flatMap ( ( adjective ) => {
324
- if (
325
- adjective . type === "compound" &&
326
- adjective . conjunction === conjunction
327
- ) {
328
- return adjective . adjectives ;
329
- } else {
330
- return [ adjective ] ;
331
- }
332
- } ) ,
333
- emphasis : false ,
334
- } ;
335
- }
336
300
export function phraseAsVerb (
337
301
phrase : PhraseTranslation ,
338
302
) : PartialVerb {
@@ -420,7 +384,7 @@ export function multiplePhrases(
420
384
if ( phrase . every ( ( phrase ) => phrase . type === "noun" ) ) {
421
385
return {
422
386
type : "noun" ,
423
- noun : compoundNoun (
387
+ noun : combineNoun (
424
388
conjunction ,
425
389
phrase . map ( ( phrase ) => phrase . noun ) ,
426
390
) ,
@@ -431,7 +395,7 @@ export function multiplePhrases(
431
395
} else {
432
396
return {
433
397
type : "adjective" ,
434
- adjective : compoundAdjective (
398
+ adjective : combineAdjective (
435
399
conjunction ,
436
400
phrase . map ( ( phrase ) => phrase . adjective ) ,
437
401
) ,
0 commit comments