File tree Expand file tree Collapse file tree 3 files changed +9
-10
lines changed
Expand file tree Collapse file tree 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 {
1515function fixNounPhrase ( noun : English . NounPhrase ) : English . NounPhrase {
1616 switch ( noun . type ) {
1717 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+ }
1827 return {
1928 ...noun ,
2029 determiners : fixMultipleDeterminers ( noun . determiners ) ,
Original file line number Diff line number Diff line change @@ -21,12 +21,6 @@ export function nanpa(
2121 `${ phrase . type } within "position X" phrase` ,
2222 ) ,
2323 )
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- )
3024 : {
3125 type : "simple" ,
3226 determiners : [ ] ,
Original file line number Diff line number Diff line change @@ -65,10 +65,6 @@ function nounPhrase(
6565 ) ;
6666 const prepositions = nullableAsArray ( modifier . ofPhrase )
6767 . 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- }
7268 const { nounPreposition } = modifier ;
7369 const headNoun = fromNounForms ( noun , quantity )
7470 . map ( ( { noun : useWord , quantity } ) : English . NounPhrase => ( {
You can’t perform that action at this time.
0 commit comments