@@ -28,7 +28,7 @@ export type ModifierTranslation =
2828 | Readonly < { type : "determiner" ; determiner : English . Determiner } >
2929 | Readonly < { type : "adverb" ; adverb : English . Word } >
3030 | Readonly < { type : "name" ; name : string } >
31- | Readonly < { type : "in position phrase" ; noun : English . NounPhrase } > ;
31+ | Readonly < { type : "position phrase" ; noun : English . NounPhrase } > ;
3232export type AdjectivalModifier = Readonly < {
3333 nounPreposition :
3434 | null
@@ -146,7 +146,7 @@ export function defaultModifier(
146146 }
147147 }
148148}
149- export function piModifier (
149+ export function pi (
150150 insidePhrase : TokiPona . Phrase ,
151151) : ArrayResult < ModifierTranslation > {
152152 return phrase ( {
@@ -163,9 +163,9 @@ export function piModifier(
163163 modifier . type !== "adjective" || modifier . inWayPhrase == null
164164 ) as ArrayResult < ModifierTranslation > ;
165165}
166- function nanpaModifier (
166+ export function nanpa (
167167 nanpa : TokiPona . Modifier & { type : "nanpa" } ,
168- ) : ArrayResult < ModifierTranslation > {
168+ ) : ArrayResult < English . NounPhrase > {
169169 return phrase ( {
170170 phrase : nanpa . phrase ,
171171 place : "object" ,
@@ -184,22 +184,19 @@ function nanpaModifier(
184184 throw new FilteredError ( 'preposition within "in position" phrase' ) ;
185185 } else {
186186 return {
187- type : "in position phrase" ,
187+ type : "simple" ,
188+ determiner : [ ] ,
189+ adjective : [ ] ,
188190 noun : {
189- type : "simple" ,
190- determiner : [ ] ,
191- adjective : [ ] ,
192- noun : {
193- word : "position" ,
194- emphasis : nanpa . nanpa . emphasis != null ,
195- } ,
196- quantity : "singular" ,
197- perspective : "third" ,
198- postCompound : phrase . noun ,
199- postAdjective : null ,
200- preposition : [ ] ,
201- emphasis : false ,
191+ word : "position" ,
192+ emphasis : nanpa . nanpa . emphasis != null ,
202193 } ,
194+ quantity : "singular" ,
195+ perspective : "third" ,
196+ postCompound : phrase . noun ,
197+ postAdjective : null ,
198+ preposition : [ ] ,
199+ emphasis : false ,
203200 } ;
204201 }
205202 } ) ;
@@ -213,9 +210,10 @@ function modifier(
213210 case "proper words" :
214211 return new ArrayResult ( [ { type : "name" , name : modifier . words } ] ) ;
215212 case "pi" :
216- return piModifier ( modifier . phrase ) ;
213+ return pi ( modifier . phrase ) ;
217214 case "nanpa" :
218- return nanpaModifier ( modifier ) ;
215+ return nanpa ( modifier )
216+ . map ( ( noun ) => ( { type : "position phrase" , noun } ) ) ;
219217 }
220218}
221219export function multipleModifiers (
@@ -247,7 +245,7 @@ export function multipleModifiers(
247245 . flatMap ( ( modifier ) => modifier . type === "name" ? [ modifier . name ] : [ ] ) ;
248246
249247 const inPositionPhrase = modifiers . flatMap ( ( modifier ) =>
250- modifier . type === "in position phrase" ? [ modifier . noun ] : [ ]
248+ modifier . type === "position phrase" ? [ modifier . noun ] : [ ]
251249 ) ;
252250
253251 let adjectival : ArrayResult < MultipleModifierTranslation > ;
0 commit comments