File tree 3 files changed +9
-10
lines changed
3 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,15 @@ function rankNoun(noun: English.NounPhrase): number {
15
15
function fixNounPhrase ( noun : English . NounPhrase ) : English . NounPhrase {
16
16
switch ( noun . type ) {
17
17
case "simple" :
18
+ // if (noun.postAdjective != null && noun.prepositions.length > 0) {
19
+ // throw new FilteredError("named noun with preposition");
20
+ // }
21
+ if (
22
+ noun . postCompound != null && noun . postCompound . type === "simple" &&
23
+ noun . postCompound . prepositions . length > 0
24
+ ) {
25
+ new FilteredError ( `preposition within "${ noun . noun . word } X" phrase` ) ;
26
+ }
18
27
return {
19
28
...noun ,
20
29
determiners : fixMultipleDeterminers ( noun . determiners ) ,
Original file line number Diff line number Diff line change @@ -21,12 +21,6 @@ export function nanpa(
21
21
`${ phrase . type } within "position X" phrase` ,
22
22
) ,
23
23
)
24
- // TODO: do this on `fixer.ts` instead
25
- : ( phrase . noun as English . NounPhrase & { type : "simple" } )
26
- . prepositions . length > 0
27
- ? throwError (
28
- new FilteredError ( 'preposition within "position X" phrase' ) ,
29
- )
30
24
: {
31
25
type : "simple" ,
32
26
determiners : [ ] ,
Original file line number Diff line number Diff line change @@ -65,10 +65,6 @@ function nounPhrase(
65
65
) ;
66
66
const prepositions = nullableAsArray ( modifier . ofPhrase )
67
67
. map ( ( object ) => nounAsPreposition ( object , "of" ) ) ;
68
- // TODO: do this on `fixer.ts` instead
69
- if ( prepositions . length > 0 && postAdjective != null ) {
70
- throw new FilteredError ( "named noun with preposition" ) ;
71
- }
72
68
const { nounPreposition } = modifier ;
73
69
const headNoun = fromNounForms ( noun , quantity )
74
70
. map ( ( { noun : useWord , quantity } ) : English . NounPhrase => ( {
You can’t perform that action at this time.
0 commit comments