@@ -28,7 +28,7 @@ export type ModifierTranslation =
28
28
| Readonly < { type : "determiner" ; determiner : English . Determiner } >
29
29
| Readonly < { type : "adverb" ; adverb : English . Word } >
30
30
| Readonly < { type : "name" ; name : string } >
31
- | Readonly < { type : "in position phrase" ; noun : English . NounPhrase } > ;
31
+ | Readonly < { type : "position phrase" ; noun : English . NounPhrase } > ;
32
32
export type AdjectivalModifier = Readonly < {
33
33
nounPreposition :
34
34
| null
@@ -146,7 +146,7 @@ export function defaultModifier(
146
146
}
147
147
}
148
148
}
149
- export function piModifier (
149
+ export function pi (
150
150
insidePhrase : TokiPona . Phrase ,
151
151
) : ArrayResult < ModifierTranslation > {
152
152
return phrase ( {
@@ -163,9 +163,9 @@ export function piModifier(
163
163
modifier . type !== "adjective" || modifier . inWayPhrase == null
164
164
) as ArrayResult < ModifierTranslation > ;
165
165
}
166
- function nanpaModifier (
166
+ export function nanpa (
167
167
nanpa : TokiPona . Modifier & { type : "nanpa" } ,
168
- ) : ArrayResult < ModifierTranslation > {
168
+ ) : ArrayResult < English . NounPhrase > {
169
169
return phrase ( {
170
170
phrase : nanpa . phrase ,
171
171
place : "object" ,
@@ -184,22 +184,19 @@ function nanpaModifier(
184
184
throw new FilteredError ( 'preposition within "in position" phrase' ) ;
185
185
} else {
186
186
return {
187
- type : "in position phrase" ,
187
+ type : "simple" ,
188
+ determiner : [ ] ,
189
+ adjective : [ ] ,
188
190
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 ,
202
193
} ,
194
+ quantity : "singular" ,
195
+ perspective : "third" ,
196
+ postCompound : phrase . noun ,
197
+ postAdjective : null ,
198
+ preposition : [ ] ,
199
+ emphasis : false ,
203
200
} ;
204
201
}
205
202
} ) ;
@@ -213,9 +210,10 @@ function modifier(
213
210
case "proper words" :
214
211
return new ArrayResult ( [ { type : "name" , name : modifier . words } ] ) ;
215
212
case "pi" :
216
- return piModifier ( modifier . phrase ) ;
213
+ return pi ( modifier . phrase ) ;
217
214
case "nanpa" :
218
- return nanpaModifier ( modifier ) ;
215
+ return nanpa ( modifier )
216
+ . map ( ( noun ) => ( { type : "position phrase" , noun } ) ) ;
219
217
}
220
218
}
221
219
export function multipleModifiers (
@@ -247,7 +245,7 @@ export function multipleModifiers(
247
245
. flatMap ( ( modifier ) => modifier . type === "name" ? [ modifier . name ] : [ ] ) ;
248
246
249
247
const inPositionPhrase = modifiers . flatMap ( ( modifier ) =>
250
- modifier . type === "in position phrase" ? [ modifier . noun ] : [ ]
248
+ modifier . type === "position phrase" ? [ modifier . noun ] : [ ]
251
249
) ;
252
250
253
251
let adjectival : ArrayResult < MultipleModifierTranslation > ;
0 commit comments