; This is a Parsing Expression Grammar for Lojban. ; See http://www.pdos.lcs.mit.edu/~baford/packrat/ ; ; All rules have the form: ; ; name <- peg-expression ; ; which means that the grammatical construct "name" is parsed using ; "peg-expression". ; ; 1) Names in lower case are grammatical constructs. ; 2) Names in UPPER CASE are selma'o (lexeme) names, and are terminals. ; 3) Concatenation is expressed by juxtaposition with no operator symbol. ; 4) / represents *ORDERED* alternation (choice). If the first ; option succeeds, the others will never be checked. ; 5) ? indicates that the element to the left is optional. ; 6) * represents optional repetition of the construct to the left. ; 7) + represents one-or-more repetition of the construct to the left. ; 8) () serves to indicate the grouping of the other operators. ; ; Longest match wins. ; --- GRAMMAR --- text <- intro-null NAI-clause* text-part-2 (!text-1 joik-jek)? text-1? faho-clause EOF? intro-null <- spaces? su-clause* intro-si-clause text-part-2 <- (CMENE-clause+ / indicators?) free* ;; intro-sa-clause <- SA-clause+ / any-word-SA-handling !(ZEI-clause SA-clause) intro-sa-clause intro-si-clause <- si-clause? SI-clause* faho-clause <- (FAhO-clause dot-star)? ; Please note that the "text-1" item in the text-1 production does ; *not* match the BNF. This is due to a bug in the BNF. The change ; here was made to match grammar.300 text-1 <- I-clause (jek / joik)? (stag? BO-clause)? free* text-1? / NIhO-clause+ free* su-clause* paragraphs? / paragraphs paragraphs <- paragraph (NIhO-clause+ free* su-clause* paragraphs)? paragraph <- (statement / fragment) (I-clause !jek !joik !joik-jek free* (statement / fragment)?)* statement <- statement-1 / prenex statement statement-1 <- statement-2 (I-clause joik-jek statement-2?)* statement-2 <- statement-3 (I-clause (jek / joik)? stag? BO-clause free* statement-2)? / statement-3 (I-clause (jek / joik)? stag? BO-clause free*)? statement-3 <- sentence / tag? TUhE-clause free* text-1 TUhU-clause? free* fragment <- prenex / terms VAU-clause? free* / ek free* / gihek free* / quantifier / NA-clause !JA-clause free* / relative-clauses / links / linkargs prenex <- terms ZOhU-clause free* ;; sentence <- (terms CU-clause? free*)? bridi-tail / bridi-tail sentence <- (terms bridi-tail-sa* CU-clause? free*)? bridi-tail-sa* bridi-tail sentence-sa <- sentence-start (!sentence-start (sa-word / SA-clause !sentence-start ) )* SA-clause &text-1 sentence-start <- I-pre / NIhO-pre subsentence <- sentence / prenex subsentence bridi-tail <- bridi-tail-1 (gihek stag? KE-clause free* bridi-tail KEhE-clause? free* tail-terms)? bridi-tail-sa <- bridi-tail-start (term / !bridi-tail-start (sa-word / SA-clause !bridi-tail-start ) )* SA-clause &bridi-tail bridi-tail-start <- ME-clause / NUhA-clause / NU-clause / NA-clause !KU-clause / NAhE-clause !BO-clause / selbri / tag bridi-tail-start / KE-clause bridi-tail-start / bridi-tail bridi-tail-1 <- bridi-tail-2 (gihek !(stag? BO-clause) !(stag? KE-clause) free* bridi-tail-2 tail-terms)* bridi-tail-2 <- bridi-tail-3 (gihek stag? BO-clause free* bridi-tail-2 tail-terms)? bridi-tail-3 <- selbri tail-terms / gek-sentence gek-sentence <- gek subsentence gik subsentence tail-terms / tag? KE-clause free* gek-sentence KEhE-clause? free* / NA-clause free* gek-sentence tail-terms <- terms? VAU-clause? free* terms <- terms-1+ ;; terms-1 <- terms-2 (PEhE-clause free* joik-jek terms-2)* ;; terms-2 <- term (CEhE-clause free* term)* terms-1 <- terms-2 (pehe-sa* PEhE-clause free* joik-jek terms-2)* terms-2 <- term (cehe-sa* CEhE-clause free* term)* pehe-sa <- PEhE-clause (!PEhE-clause (sa-word / SA-clause !PEhE-clause))* SA-clause cehe-sa <- CEhE-clause (!CEhE-clause (sa-word / SA-clause !CEhE-clause))* SA-clause ;;term <- sumti / ( !gek (tag / FA-clause free*) (sumti / KU-clause? free*) ) / termset / NA-clause KU-clause free* term <- term-sa* term-1 term-1 <- sumti / ( !gek (tag / FA-clause free*) (sumti / KU-clause? free*) ) / termset / NA-clause KU-clause free* term-sa <- term-start (!term-start (sa-word / SA-clause !term-start ) )* SA-clause &term-1 term-start <- term-1 / LA-clause / LE-clause / LI-clause / LU-clause / LAhE-clause / quantifier term-start / gek sumti gik / FA-clause / tag term-start termset <- gek-termset / NUhI-clause free* gek terms NUhU-clause? free* gik terms NUhU-clause? free* / NUhI-clause free* terms NUhU-clause? free* gek-termset <- gek terms-gik-terms terms-gik-terms <- term (gik / terms-gik-terms) term sumti <- sumti-1 (VUhO-clause free* relative-clauses)? sumti-1 <- sumti-2 (joik-ek stag? KE-clause free* sumti KEhE-clause? free*)? sumti-2 <- sumti-3 (joik-ek sumti-3)* sumti-3 <- sumti-4 (joik-ek stag? BO-clause free* sumti-3)? sumti-4 <- sumti-5 / gek sumti gik sumti-4 sumti-5 <- quantifier? sumti-6 relative-clauses? / quantifier selbri KU-clause? free* relative-clauses? sumti-6 <- ZO-clause free* / ZOI-clause free* / LOhU-clause free* / lerfu-string !MOI-clause BOI-clause? free* / LU-clause text LIhU-clause? free* / (LAhE-clause free* / NAhE-clause BO-clause free*) relative-clauses? sumti LUhU-clause? free* / KOhA-clause free* / LA-clause free* relative-clauses? CMENE-clause+ free* / (LA-clause / LE-clause) free* sumti-tail KU-clause? free* / li-clause li-clause <- LI-clause free* mex LOhO-clause? free* sumti-tail <- (sumti-6 relative-clauses?)? sumti-tail-1 / relative-clauses sumti-tail-1 sumti-tail-1 <- selbri relative-clauses? / quantifier selbri relative-clauses? / quantifier sumti relative-clauses <- relative-clause (ZIhE-clause free* relative-clause)* ;; relative-clause <- GOI-clause free* term GEhU-clause? free* / NOI-clause free* subsentence KUhO-clause? free* relative-clause <- relative-clause-sa* relative-clause-1 relative-clause-sa <- relative-clause-start (!relative-clause-start (sa-word / SA-clause !relative-clause-start ) )* SA-clause &relative-clause-1 relative-clause-1 <- GOI-clause free* term GEhU-clause? free* / NOI-clause free* subsentence KUhO-clause? free* relative-clause-start <- GOI-clause / NOI-clause selbri <- tag? selbri-1 selbri-1 <- selbri-2 / NA-clause free* selbri selbri-2 <- selbri-3 (CO-clause free* selbri-2)? selbri-3 <- selbri-4+ selbri-4 <- selbri-5 (joik-jek selbri-5 / joik stag? KE-clause free* selbri-3 KEhE-clause? free*)* selbri-5 <- selbri-6 ((jek / joik) stag? BO-clause free* selbri-5)? selbri-6 <- tanru-unit (BO-clause free* selbri-6)? / NAhE-clause? free* guhek selbri gik selbri-6 tanru-unit <- tanru-unit-1 (CEI-clause free* tanru-unit-1)* tanru-unit-1 <- tanru-unit-2 linkargs? ; ** zei is part of BRIVLA-clause tanru-unit-2 <- BRIVLA-clause free* / GOhA-clause RAhO-clause? free* / KE-clause free* selbri-3 KEhE-clause? free* / ME-clause free* (sumti / lerfu-string) MEhU-clause? free* MOI-clause? free* / (number / lerfu-string) MOI-clause free* / NUhA-clause free* mex-operator / SE-clause free* tanru-unit-2 / JAI-clause free* tag? tanru-unit-2 / NAhE-clause free* tanru-unit-2 / NU-clause NAI-clause? free* (joik-jek NU-clause NAI-clause? free*)* subsentence KEI-clause? free* ;; linkargs <- BE-clause free* term links? BEhO-clause? free* linkargs <- linkargs-sa* linkargs-1 linkargs-1 <- BE-clause free* term links? BEhO-clause? free* linkargs-sa <- linkargs-start (!linkargs-start (sa-word / SA-clause !linkargs-start ) )* SA-clause &linkargs-1 linkargs-start <- BE-clause ;; links <- BEI-clause free* term links? links <- links-sa* links-1 links-1 <- BEI-clause free* term links? links-sa <- links-start (!links-start (sa-word / SA-clause !links-start ) )* SA-clause &links-1 links-start <- BEI-clause quantifier <- number !MOI-clause BOI-clause? free* / VEI-clause free* mex VEhO-clause? free* ;;mex <- mex-1 (operator mex-1)* / rp-clause mex <- mex-sa* mex-0 mex-0 <- mex-1 (operator mex-1)* / rp-clause mex-sa <- mex-start (!mex-start (sa-word / SA-clause !mex-start) )* SA-clause &mex-0 mex-start <- FUhA-clause / PEhO-clause / operand-start rp-clause <- FUhA-clause free* rp-expression mex-1 <- mex-2 (BIhE-clause free* operator mex-1)? mex-2 <- operand / mex-forethought ; This is just to make for clearer parse trees mex-forethought <- PEhO-clause? free* operator fore-operands KUhE-clause? free* fore-operands <- mex-2+ ;li fu'a reboi ci pi'i voboi mu pi'i su'i reboi ci vu'u su'i du li rexa ;rp-expression <- rp-operand rp-operand operator ;rp-operand <- operand / rp-expression ; AKA (almost; this one allows a single operand; above does not. ;rp-expression <- rp-expression rp-expression operator / operand ; Right recursive version. rp-expression <- operand rp-expression-tail rp-expression-tail <- rp-expression operator rp-expression-tail / () ;; operator <- operator-1 (joik-jek operator-1 / joik stag? KE-clause free* operator KEhE-clause? free*)* operator <- operator-sa* operator-0 operator-0 <- operator-1 (joik-jek operator-1 / joik stag? KE-clause free* operator KEhE-clause? free*)* operator-sa <- operator-start (!operator-start (sa-word / SA-clause !operator-start) )* SA-clause &operator-0 operator-start <- guhek / KE-clause / SE-clause? NAhE-clause / SE-clause? MAhO-clause / SE-clause? VUhU-clause operator-1 <- operator-2 / guhek operator-1 gik operator-2 / operator-2 (jek / joik) stag? BO-clause free* operator-1 operator-2 <- mex-operator / KE-clause free* operator KEhE-clause? free* mex-operator <- SE-clause free* mex-operator / NAhE-clause free* mex-operator / MAhO-clause free* mex TEhU-clause? free* / NAhU-clause free* selbri TEhU-clause? free* / VUhU-clause free* ;; operand <- operand-1 (joik-ek stag? KE-clause free* operand KEhE-clause? free*)? operand <- operand-sa* operand-0 operand-0 <- operand-1 (joik-ek stag? KE-clause free* operand KEhE-clause? free*)? operand-sa <- operand-start (!operand-start (sa-word / SA-clause !operand-start) )* SA-clause &operand-0 operand-start <- quantifier / lerfu-word / NIhE-clause / MOhE-clause / JOhI-clause / gek / LAhE-clause / NAhE-clause operand-1 <- operand-2 (joik-ek operand-2)* operand-2 <- operand-3 (joik-ek stag? BO-clause free* operand-2)? operand-3 <- quantifier / lerfu-string !MOI-clause BOI-clause? free* / NIhE-clause free* selbri TEhU-clause? free* / MOhE-clause free* sumti TEhU-clause? free* / JOhI-clause free* mex-2+ TEhU-clause? free* / gek operand gik operand-3 / (LAhE-clause free* / NAhE-clause BO-clause free*) operand LUhU-clause? free* number <- PA-clause (PA-clause / lerfu-word)* lerfu-string <- lerfu-word (PA-clause / lerfu-word)* ; ** BU clauses are part of BY-clause lerfu-word <- BY-clause / LAU-clause lerfu-word / TEI-clause lerfu-string FOI-clause ek <- NA-clause? SE-clause? A-clause NAI-clause? ;; gihek <- NA-clause? SE-clause? GIhA-clause NAI-clause? gihek <- gihek-sa* gihek-1 gihek-1 <- NA-clause? SE-clause? GIhA-clause NAI-clause? gihek-sa <- gihek-1 (!gihek-1 (sa-word / SA-clause !gihek-1 ) )* SA-clause &gihek jek <- NA-clause? SE-clause? JA-clause NAI-clause? joik <- SE-clause? JOI-clause NAI-clause? / interval / GAhO-clause interval GAhO-clause interval <- SE-clause? BIhI-clause NAI-clause? ;; joik-ek <- joik free* / ek free* joik-ek <- joik-ek-sa* joik-ek-1 joik-ek-1 <- (joik free* / ek free*) joik-ek-sa <- joik-ek-1 (!joik-ek-1 (sa-word / SA-clause !joik-ek-1 ) )* SA-clause &joik-ek joik-jek <- joik free* / jek free* gek <- SE-clause? GA-clause NAI-clause? free* / joik GI-clause free* / stag gik guhek <- SE-clause? GUhA-clause NAI-clause? free* gik <- GI-clause NAI-clause? free* tag <- tense-modal (joik-jek tense-modal)* ;stag <- simple-tense-modal ((jek / joik) simple-tense-modal)* stag <- simple-tense-modal ((jek / joik) simple-tense-modal)* / tense-modal (joik-jek tense-modal)* tense-modal <- simple-tense-modal free* / FIhO-clause free* selbri FEhU-clause? free* simple-tense-modal <- NAhE-clause? SE-clause? BAI-clause NAI-clause? KI-clause? / NAhE-clause? ( ((time space? / space time?) CAhA-clause) / (time space? / space time?) / CAhA-clause ) KI-clause? / KI-clause / CUhE-clause time <- ZI-clause time-offset* (ZEhA-clause (PU-clause NAI-clause?)?)? interval-property* / ZI-clause? time-offset+ (ZEhA-clause (PU-clause NAI-clause?)?)? interval-property* / ZI-clause? time-offset* ZEhA-clause (PU-clause NAI-clause?)? interval-property* / ZI-clause? time-offset* (ZEhA-clause (PU-clause NAI-clause?)?)? interval-property+ time-offset <- PU-clause NAI-clause? ZI-clause? space <- VA-clause space-offset* space-interval? (MOhI-clause space-offset)? / VA-clause? space-offset+ space-interval? (MOhI-clause space-offset)? / VA-clause? space-offset* space-interval (MOhI-clause space-offset)? / VA-clause? space-offset* space-interval? MOhI-clause space-offset space-offset <- FAhA-clause NAI-clause? VA-clause? space-interval <- (VEhA-clause / VIhA-clause / VEhA-clause VIhA-clause) (FAhA-clause NAI-clause?)? space-int-props / (VEhA-clause / VIhA-clause / VEhA-clause VIhA-clause) (FAhA-clause NAI-clause?)? / space-int-props space-int-props <- (FEhE-clause interval-property)+ interval-property <- number ROI-clause NAI-clause? / TAhE-clause NAI-clause? / ZAhO-clause NAI-clause? free <- SEI-clause free* (terms CU-clause? free*)? selbri SEhU-clause? / SOI-clause free* sumti sumti? SEhU-clause? / vocative relative-clauses? selbri relative-clauses? DOhU-clause? / vocative relative-clauses? CMENE-clause+ free* relative-clauses? DOhU-clause? / vocative sumti? DOhU-clause? / (number / lerfu-string) MAI-clause / TO-clause text TOI-clause? / xi-clause xi-clause <- XI-clause free* (number / lerfu-string) BOI-clause? / XI-clause free* VEI-clause free* mex VEhO-clause? vocative <- (COI-clause NAI-clause?)+ DOI-clause / (COI-clause NAI-clause?) (COI-clause NAI-clause?)* / DOI-clause indicators <- FUhE-clause? indicator+ indicator <- ((UI-clause / CAI-clause) NAI-clause? / DAhO-clause / FUhO-clause) !BU-clause ; **************** ; Magic Words ; **************** zei-clause <- pre-clause zei-clause-no-pre zei-clause-no-pre <- pre-zei-bu (zei-tail? bu-tail)* zei-tail post-clause zei-clause-no-SA <- pre-zei-bu-no-SA (zei-tail? bu-tail)* zei-tail bu-clause <- pre-clause bu-clause-no-pre bu-clause-no-pre <- pre-zei-bu (bu-tail? zei-tail)* bu-tail post-clause bu-clause-no-SA <- pre-zei-bu-no-SA (bu-tail? zei-tail)* bu-tail zei-tail <- (ZEI-clause any-word)+ bu-tail <- BU-clause+ pre-zei-bu <- (!BU-clause !ZEI-clause !SI-clause !SA-clause !SU-clause !FAhO-clause any-word-SA-handling) si-clause? ; LOhU-pre / ZO-pre / ZOI-pre / !ZEI-clause !BU-clause !FAhO-clause !SI-clause !SA-clause !SU-clause any-word-SA-handling si-clause? pre-zei-bu-no-SA <- LOhU-pre / ZO-pre / ZOI-pre / !ZEI-clause !BU-clause !FAhO-clause !SI-clause !SA-clause !SU-clause any-word si-clause? dot-star <- .* ; -- General Morphology Issues ; ; 1. Spaces (including '.y') and UI are eaten *after* a word. ; ; 3. BAhE is eaten *before* a word. ; Handling of what can go after a cmavo post-clause <- spaces? si-clause? !ZEI-clause !BU-clause indicators* pre-clause <- BAhE-clause? ;any-word-SA-handling <- BRIVLA-pre / known-cmavo-SA / !known-cmavo-pre CMAVO-pre / CMENE-pre any-word-SA-handling <- BRIVLA-pre / known-cmavo-SA / CMAVO-pre / CMENE-pre known-cmavo-SA <- A-pre / BAI-pre / BAhE-pre / BE-pre / BEI-pre / BEhO-pre / BIhE-pre / BIhI-pre / BO-pre / BOI-pre / BU-pre / BY-pre / CAI-pre / CAhA-pre / CEI-pre / CEhE-pre / CO-pre / COI-pre / CU-pre / CUhE-pre / DAhO-pre / DOI-pre / DOhU-pre / FA-pre / FAhA-pre / FEhE-pre / FEhU-pre / FIhO-pre / FOI-pre / FUhA-pre / FUhE-pre / FUhO-pre / GA-pre / GAhO-pre / GEhU-pre / GI-pre / GIhA-pre / GOI-pre / GOhA-pre / GUhA-pre / I-pre / JA-pre / JAI-pre / JOI-pre / JOhI-pre / KE-pre / KEI-pre / KEhE-pre / KI-pre / KOhA-pre / KU-pre / KUhE-pre / KUhO-pre / LA-pre / LAU-pre / LAhE-pre / LE-pre / LEhU-pre / LI-pre / LIhU-pre / LOhO-pre / LOhU-pre / LU-pre / LUhU-pre / MAI-pre / MAhO-pre / ME-pre / MEhU-pre / MOI-pre / MOhE-pre / MOhI-pre / NA-pre / NAI-pre / NAhE-pre / NAhU-pre / NIhE-pre / NIhO-pre / NOI-pre / NU-pre / NUhA-pre / NUhI-pre / NUhU-pre / PA-pre / PEhE-pre / PEhO-pre / PU-pre / RAhO-pre / ROI-pre / SA-pre / SE-pre / SEI-pre / SEhU-pre / SI-clause / SOI-pre / SU-pre / TAhE-pre / TEI-pre / TEhU-pre / TO-pre / TOI-pre / TUhE-pre / TUhU-pre / UI-pre / VA-pre / VAU-pre / VEI-pre / VEhA-pre / VEhO-pre / VIhA-pre / VUhO-pre / VUhU-pre / XI-pre / ZAhO-pre / ZEI-pre / ZEhA-pre / ZI-pre / ZIhE-pre / ZO-pre / ZOI-pre / ZOhU-pre ; Handling of spaces and things like spaces. ; --- SPACE --- ; Do *NOT* delete the line above! ; SU clauses su-clause <- (erasable-clause / su-word)* SU-clause ; Handling of SI and interactions with zo and lo'u...le'u si-clause <- ((erasable-clause / si-word / SA-clause) si-clause? SI-clause)+ erasable-clause <- bu-clause-no-pre !ZEI-clause !BU-clause / zei-clause-no-pre !ZEI-clause !BU-clause sa-word <- pre-zei-bu si-word <- pre-zei-bu su-word <- !NIhO-clause !LU-clause !TUhE-clause !TO-clause !SU-clause !FAhO-clause any-word-SA-handling ; --- SELMAHO --- ; Do *NOT* delete the line above! BRIVLA-clause <- BRIVLA-pre BRIVLA-post / zei-clause BRIVLA-pre <- pre-clause BRIVLA spaces? BRIVLA-post <- post-clause BRIVLA-no-SA-handling <- pre-clause BRIVLA post-clause / zei-clause-no-SA CMENE-clause <- CMENE-pre CMENE-post CMENE-pre <- pre-clause CMENE spaces? CMENE-post <- post-clause CMENE-no-SA-handling <- pre-clause CMENE post-clause CMAVO-clause <- CMAVO-pre CMAVO-post CMAVO-pre <- pre-clause CMAVO spaces? CMAVO-post <- post-clause CMAVO-no-SA-handling <- pre-clause CMAVO post-clause ; eks; basic afterthought logical connectives A-clause <- A-pre A-post A-pre <- pre-clause A spaces? A-post <- post-clause A-no-SA-handling <- pre-clause A post-clause ; modal operators BAI-clause <- BAI-pre BAI-post BAI-pre <- pre-clause BAI spaces? BAI-post <- post-clause BAI-no-SA-handling <- pre-clause BAI post-clause ; next word intensifier BAhE-clause <- (BAhE-pre BAhE-post)+ BAhE-pre <- BAhE spaces? BAhE-post <- si-clause? !ZEI-clause !BU-clause BAhE-no-SA-handling <- BAhE spaces? BAhE-post ; sumti link to attach sumti to a selbri BE-clause <- BE-pre BE-post BE-pre <- pre-clause BE spaces? BE-post <- post-clause BE-no-SA-handling <- pre-clause BE post-clause ; multiple sumti separator between BE, BEI BEI-clause <- BEI-pre BEI-post BEI-pre <- pre-clause BEI spaces? BEI-post <- post-clause BEI-no-SA-handling <- pre-clause BEI post-clause ; terminates BEBEI specified descriptors BEhO-clause <- BEhO-pre BEhO-post BEhO-pre <- pre-clause BEhO spaces? BEhO-post <- post-clause BEhO-no-SA-handling <- pre-clause BEhO post-clause ; prefix for high-priority MEX operator BIhE-clause <- BIhE-pre BIhE-post BIhE-pre <- pre-clause BIhE spaces? BIhE-post <- post-clause BIhE-no-SA-handling <- pre-clause BIhE post-clause ; interval component of JOI BIhI-clause <- BIhI-pre BIhI-post BIhI-pre <- pre-clause BIhI spaces? BIhI-post <- post-clause BIhI-no-SA-handling <- pre-clause BIhI post-clause ; joins two units with shortest scope BO-clause <- BO-pre BO-post BO-pre <- pre-clause BO spaces? BO-post <- post-clause BO-no-SA-handling <- pre-clause BO post-clause ; number or lerfu-string terminator BOI-clause <- BOI-pre BOI-post BOI-pre <- pre-clause BOI spaces? BOI-post <- post-clause BOI-no-SA-handling <- pre-clause BOI post-clause ; turns any word into a BY lerfu word BU-clause <- BU-pre BU-post BU-clause-no-SA <- BU-pre-no-SA BU BU-post BU-pre <- pre-clause BU spaces? BU-pre-no-SA <- pre-clause BU-post <- spaces? BU-no-SA-handling <- pre-clause BU spaces? ; individual lerfu words BY-clause <- BY-pre BY-post / bu-clause BY-pre <- pre-clause BY spaces? BY-post <- post-clause BY-no-SA-handling <- pre-clause BY post-clause / bu-clause-no-SA ; specifies actualitypotentiality of tense CAhA-clause <- CAhA-pre CAhA-post CAhA-pre <- pre-clause CAhA spaces? CAhA-post <- post-clause CAhA-no-SA-handling <- pre-clause CAhA post-clause ; afterthought intensity marker CAI-clause <- CAI-pre CAI-post CAI-pre <- pre-clause CAI spaces? CAI-post <- post-clause CAI-no-SA-handling <- pre-clause CAI post-clause ; pro-bridi assignment operator CEI-clause <- CEI-pre CEI-post CEI-pre <- pre-clause CEI spaces? CEI-post <- post-clause CEI-no-SA-handling <- pre-clause CEI post-clause ; afterthought term list connective CEhE-clause <- CEhE-pre CEhE-post CEhE-pre <- pre-clause CEhE spaces? CEhE-post <- post-clause CEhE-no-SA-handling <- pre-clause CEhE post-clause ; names; require consonant end, then pause no ; LA or DOI selma'o embedded, pause before if ; vowel initial and preceded by a vowel ; tanru inversion CO-clause <- CO-pre CO-post CO-pre <- pre-clause CO spaces? CO-post <- post-clause CO-no-SA-handling <- pre-clause CO post-clause COI-clause <- COI-pre COI-post COI-pre <- pre-clause COI spaces? COI-post <- post-clause COI-no-SA-handling <- pre-clause COI post-clause ; vocative marker permitted inside names; must ; always be followed by pause or DOI ; separator between head sumti and selbri CU-clause <- CU-pre CU-post CU-pre <- pre-clause CU spaces? CU-post <- post-clause CU-no-SA-handling <- pre-clause CU post-clause ; tensemodal question CUhE-clause <- CUhE-pre CUhE-post CUhE-pre <- pre-clause CUhE spaces? CUhE-post <- post-clause CUhE-no-SA-handling <- pre-clause CUhE post-clause ; cancel anaphoracataphora assignments DAhO-clause <- DAhO-pre DAhO-post DAhO-pre <- pre-clause DAhO spaces? DAhO-post <- post-clause DAhO-no-SA-handling <- pre-clause DAhO post-clause ; vocative marker DOI-clause <- DOI-pre DOI-post DOI-pre <- pre-clause DOI spaces? DOI-post <- post-clause DOI-no-SA-handling <- pre-clause DOI post-clause ; terminator for DOI-marked vocatives DOhU-clause <- DOhU-pre DOhU-post DOhU-pre <- pre-clause DOhU spaces? DOhU-post <- post-clause DOhU-no-SA-handling <- pre-clause DOhU post-clause ; modifier head generic case tag FA-clause <- FA-pre FA-post FA-pre <- pre-clause FA spaces? FA-post <- post-clause FA-no-SA-handling <- pre-clause FA post-clause ; superdirections in space FAhA-clause <- FAhA-pre FAhA-post FAhA-pre <- pre-clause FAhA spaces? FAhA-post <- post-clause FAhA-no-SA-handling <- pre-clause FAhA post-clause ; normally elided 'done pause' to indicate end ; of utterance string FAhO-clause <- pre-clause FAhO spaces? ; space interval mod flag FEhE-clause <- FEhE-pre FEhE-post FEhE-pre <- pre-clause FEhE spaces? FEhE-post <- post-clause FEhE-no-SA-handling <- pre-clause FEhE post-clause ; ends bridi to modal conversion FEhU-clause <- FEhU-pre FEhU-post FEhU-pre <- pre-clause FEhU spaces? FEhU-post <- post-clause FEhU-no-SA-handling <- pre-clause FEhU post-clause ; marks bridi to modal conversion FIhO-clause <- FIhO-pre FIhO-post FIhO-pre <- pre-clause FIhO spaces? FIhO-post <- post-clause FIhO-no-SA-handling <- pre-clause FIhO post-clause ; end compound lerfu FOI-clause <- FOI-pre FOI-post FOI-pre <- pre-clause FOI spaces? FOI-post <- post-clause FOI-no-SA-handling <- pre-clause FOI post-clause ; reverse Polish flag FUhA-clause <- FUhA-pre FUhA-post FUhA-pre <- pre-clause FUhA spaces? FUhA-post <- post-clause FUhA-no-SA-handling <- pre-clause FUhA post-clause ; open long scope for indicator FUhE-clause <- FUhE-pre FUhE-post FUhE-pre <- pre-clause FUhE spaces? FUhE-post <- !BU-clause spaces? !ZEI-clause !BU-clause FUhE-no-SA-handling <- pre-clause FUhE post-clause ; close long scope for indicator FUhO-clause <- FUhO-pre FUhO-post FUhO-pre <- pre-clause FUhO spaces? FUhO-post <- post-clause FUhO-no-SA-handling <- pre-clause FUhO post-clause ; geks; forethought logical connectives GA-clause <- GA-pre GA-post GA-pre <- pre-clause GA spaces? GA-post <- post-clause GA-no-SA-handling <- pre-clause GA post-clause ; openclosed interval markers for BIhI GAhO-clause <- GAhO-pre GAhO-post GAhO-pre <- pre-clause GAhO spaces? GAhO-post <- post-clause GAhO-no-SA-handling <- pre-clause GAhO post-clause ; marker ending GOI relative clauses GEhU-clause <- GEhU-pre GEhU-post GEhU-pre <- pre-clause GEhU spaces? GEhU-post <- post-clause GEhU-no-SA-handling <- pre-clause GEhU post-clause ; forethought medial marker GI-clause <- GI-pre GI-post GI-pre <- pre-clause GI spaces? GI-post <- post-clause GI-no-SA-handling <- pre-clause GI post-clause ; logical connectives for bridi-tails GIhA-clause <- GIhA-pre GIhA-post GIhA-pre <- pre-clause GIhA spaces? GIhA-post <- post-clause GIhA-no-SA-handling <- pre-clause GIhA post-clause ; attaches a sumti modifier to a sumti GOI-clause <- GOI-pre GOI-post GOI-pre <- pre-clause GOI spaces? GOI-post <- post-clause GOI-no-SA-handling <- pre-clause GOI post-clause ; pro-bridi GOhA-clause <- GOhA-pre GOhA-post GOhA-pre <- pre-clause GOhA spaces? GOhA-post <- post-clause GOhA-no-SA-handling <- pre-clause GOhA post-clause ; GEK for tanru units, corresponds to JEKs GUhA-clause <- GUhA-pre GUhA-post GUhA-pre <- pre-clause GUhA spaces? GUhA-post <- post-clause GUhA-no-SA-handling <- pre-clause GUhA post-clause ; sentence link I-clause <- sentence-sa* I-pre I-post I-pre <- pre-clause I spaces? I-post <- post-clause I-no-SA-handling <- pre-clause I post-clause ; jeks; logical connectives within tanru JA-clause <- JA-pre JA-post JA-pre <- pre-clause JA spaces? JA-post <- post-clause JA-no-SA-handling <- pre-clause JA post-clause ; modal conversion flag JAI-clause <- JAI-pre JAI-post JAI-pre <- pre-clause JAI spaces? JAI-post <- post-clause JAI-no-SA-handling <- pre-clause JAI post-clause ; flags an array operand JOhI-clause <- JOhI-pre JOhI-post JOhI-pre <- pre-clause JOhI spaces? JOhI-post <- post-clause JOhI-no-SA-handling <- pre-clause JOhI post-clause ; non-logical connectives JOI-clause <- JOI-pre JOI-post JOI-pre <- pre-clause JOI spaces? JOI-post <- post-clause JOI-no-SA-handling <- pre-clause JOI post-clause ; left long scope marker KE-clause <- KE-pre KE-post KE-pre <- pre-clause KE spaces? KE-post <- post-clause KE-no-SA-handling <- pre-clause KE post-clause ; right terminator for KE groups KEhE-clause <- KEhE-pre KEhE-post KEhE-pre <- pre-clause KEhE spaces? KEhE-post <- post-clause KEhE-no-SA-handling <- pre-clause KEhE post-clause ; right terminator, NU abstractions KEI-clause <- KEI-pre KEI-post KEI-pre <- pre-clause KEI spaces? KEI-post <- post-clause KEI-no-SA-handling <- pre-clause KEI post-clause ; multiple utterance scope for tenses KI-clause <- KI-pre KI-post KI-pre <- pre-clause KI spaces? KI-post <- post-clause KI-no-SA-handling <- pre-clause KI post-clause ; sumti anaphora KOhA-clause <- KOhA-pre KOhA-post KOhA-pre <- pre-clause KOhA spaces? KOhA-post <- post-clause KOhA-no-SA-handling <- pre-clause KOhA spaces? ; right terminator for descriptions, etc. KU-clause <- KU-pre KU-post KU-pre <- pre-clause KU spaces? KU-post <- post-clause KU-no-SA-handling <- pre-clause KU post-clause ; MEX forethought delimiter KUhE-clause <- KUhE-pre KUhE-post KUhE-pre <- pre-clause KUhE spaces? KUhE-post <- post-clause KUhE-no-SA-handling <- pre-clause KUhE post-clause ; right terminator, NOI relative clauses KUhO-clause <- KUhO-pre KUhO-post KUhO-pre <- pre-clause KUhO spaces? KUhO-post <- post-clause KUhO-no-SA-handling <- pre-clause KUhO post-clause ; name descriptors LA-clause <- LA-pre LA-post LA-pre <- pre-clause LA spaces? LA-post <- post-clause LA-no-SA-handling <- pre-clause LA post-clause ; lerfu prefixes LAU-clause <- LAU-pre LAU-post LAU-pre <- pre-clause LAU spaces? LAU-post <- post-clause LAU-no-SA-handling <- pre-clause LAU post-clause ; sumti qualifiers LAhE-clause <- LAhE-pre LAhE-post LAhE-pre <- pre-clause LAhE spaces? LAhE-post <- post-clause LAhE-no-SA-handling <- pre-clause LAhE post-clause ; sumti descriptors LE-clause <- LE-pre LE-post LE-pre <- pre-clause LE spaces? LE-post <- post-clause LE-no-SA-handling <- pre-clause LE post-clause ; possibly ungrammatical text right quote LEhU-clause <- LEhU-pre LEhU-post LEhU-pre <- pre-clause LEhU spaces? LEhU-post <- spaces? LEhU-clause-no-SA <- LEhU-pre-no-SA LEhU-post LEhU-pre-no-SA <- pre-clause LEhU spaces? LEhU-no-SA-handling <- pre-clause LEhU post-clause ; convert number to sumti LI-clause <- LI-pre LI-post LI-pre <- pre-clause LI spaces? LI-post <- post-clause LI-no-SA-handling <- pre-clause LI post-clause ; grammatical text right quote LIhU-clause <- LIhU-pre LIhU-post LIhU-pre <- pre-clause LIhU spaces? LIhU-post <- post-clause LIhU-no-SA-handling <- pre-clause LIhU post-clause ; elidable terminator for LI LOhO-clause <- LOhO-pre LOhO-post LOhO-pre <- pre-clause LOhO spaces? LOhO-post <- post-clause LOhO-no-SA-handling <- pre-clause LOhO post-clause ; possibly ungrammatical text left quote LOhU-clause <- LOhU-pre LOhU-post LOhU-pre <- pre-clause LOhU spaces? (!LEhU any-word)* LEhU-clause spaces? LOhU-post <- post-clause LOhU-no-SA-handling <- pre-clause LOhU spaces? (!LEhU any-word)* LEhU-clause spaces? ; grammatical text left quote LU-clause <- LU-pre LU-post LU-pre <- pre-clause LU spaces? LU-post <- post-clause LU-no-SA-handling <- pre-clause LU post-clause ; LAhE close delimiter LUhU-clause <- LUhU-pre LUhU-post LUhU-pre <- pre-clause LUhU spaces? LUhU-post <- post-clause LUhU-no-SA-handling <- pre-clause LUhU post-clause ; change MEX expressions to MEX operators MAhO-clause <- MAhO-pre MAhO-post MAhO-pre <- pre-clause MAhO spaces? MAhO-post <- post-clause MAhO-no-SA-handling <- pre-clause MAhO post-clause ; change numbers to utterance ordinals MAI-clause <- MAI-pre MAI-post MAI-pre <- pre-clause MAI spaces? MAI-post <- post-clause MAI-no-SA-handling <- pre-clause MAI post-clause ; converts a sumti into a tanru_unit ME-clause <- ME-pre ME-post ME-pre <- pre-clause ME spaces? ME-post <- post-clause ME-no-SA-handling <- pre-clause ME post-clause ; terminator for ME MEhU-clause <- MEhU-pre MEhU-post MEhU-pre <- pre-clause MEhU spaces? MEhU-post <- post-clause MEhU-no-SA-handling <- pre-clause MEhU post-clause ; change sumti to operand, inverse of LI MOhE-clause <- MOhE-pre MOhE-post MOhE-pre <- pre-clause MOhE spaces? MOhE-post <- post-clause MOhE-no-SA-handling <- pre-clause MOhE post-clause ; motion tense marker MOhI-clause <- MOhI-pre MOhI-post MOhI-pre <- pre-clause MOhI spaces? MOhI-post <- post-clause MOhI-no-SA-handling <- pre-clause MOhI post-clause ; change number to selbri MOI-clause <- MOI-pre MOI-post MOI-pre <- pre-clause MOI spaces? MOI-post <- post-clause MOI-no-SA-handling <- pre-clause MOI post-clause ; bridi negation NA-clause <- NA-pre NA-post NA-pre <- pre-clause NA spaces? NA-post <- post-clause NA-no-SA-handling <- pre-clause NA post-clause ; attached to words to negate them NAI-clause <- NAI-pre NAI-post NAI-pre <- pre-clause NAI spaces? NAI-post <- post-clause NAI-no-SA-handling <- pre-clause NAI post-clause ; scalar negation NAhE-clause <- NAhE-pre NAhE-post NAhE-pre <- pre-clause NAhE spaces? NAhE-post <- post-clause NAhE-no-SA-handling <- pre-clause NAhE post-clause ; change a selbri into an operator NAhU-clause <- NAhU-pre NAhU-post NAhU-pre <- pre-clause NAhU spaces? NAhU-post <- post-clause NAhU-no-SA-handling <- pre-clause NAhU post-clause ; change selbri to operand; inverse of MOI NIhE-clause <- NIhE-pre NIhE-post NIhE-pre <- pre-clause NIhE spaces? NIhE-post <- post-clause NIhE-no-SA-handling <- pre-clause NIhE post-clause ; new paragraph; change of subject NIhO-clause <- sentence-sa* NIhO-pre NIhO-post NIhO-pre <- pre-clause NIhO spaces? NIhO-post <- su-clause* post-clause NIhO-no-SA-handling <- pre-clause NIhO su-clause* post-clause ; attaches a subordinate clause to a sumti NOI-clause <- NOI-pre NOI-post NOI-pre <- pre-clause NOI spaces? NOI-post <- post-clause NOI-no-SA-handling <- pre-clause NOI post-clause ; abstraction NU-clause <- NU-pre NU-post NU-pre <- pre-clause NU spaces? NU-post <- post-clause NU-no-SA-handling <- pre-clause NU post-clause ; change operator to selbri; inverse of MOhE NUhA-clause <- NUhA-pre NUhA-post NUhA-pre <- pre-clause NUhA spaces? NUhA-post <- post-clause NUhA-no-SA-handling <- pre-clause NUhA post-clause ; marks the start of a termset NUhI-clause <- NUhI-pre NUhI-post NUhI-pre <- pre-clause NUhI spaces? NUhI-post <- post-clause NUhI-no-SA-handling <- pre-clause NUhI post-clause ; marks the middle and end of a termset NUhU-clause <- NUhU-pre NUhU-post NUhU-pre <- pre-clause NUhU spaces? NUhU-post <- post-clause NUhU-no-SA-handling <- pre-clause NUhU post-clause ; numbers and numeric punctuation PA-clause <- PA-pre PA-post PA-pre <- pre-clause PA spaces? PA-post <- post-clause PA-no-SA-handling <- pre-clause PA post-clause ; afterthought termset connective prefix PEhE-clause <- PEhE-pre PEhE-post PEhE-pre <- pre-clause PEhE spaces? PEhE-post <- post-clause PEhE-no-SA-handling <- pre-clause PEhE post-clause ; forethought (Polish) flag PEhO-clause <- PEhO-pre PEhO-post PEhO-pre <- pre-clause PEhO spaces? PEhO-post <- post-clause PEhO-no-SA-handling <- pre-clause PEhO post-clause ; directions in time PU-clause <- PU-pre PU-post PU-pre <- pre-clause PU spaces? PU-post <- post-clause PU-no-SA-handling <- pre-clause PU post-clause ; flag for modified interpretation of GOhI RAhO-clause <- RAhO-pre RAhO-post RAhO-pre <- pre-clause RAhO spaces? RAhO-post <- post-clause RAhO-no-SA-handling <- pre-clause RAhO post-clause ; converts number to extensional tense ROI-clause <- ROI-pre ROI-post ROI-pre <- pre-clause ROI spaces? ROI-post <- post-clause ROI-no-SA-handling <- pre-clause ROI post-clause SA-clause <- SA-pre SA-post SA-pre <- pre-clause SA spaces? SA-post <- spaces? ; metalinguistic eraser to the beginning of ; the current utterance ; conversions SE-clause <- SE-pre SE-post SE-pre <- pre-clause SE spaces? SE-post <- post-clause SE-no-SA-handling <- pre-clause SE post-clause ; metalinguistic bridi insert marker SEI-clause <- SEI-pre SEI-post SEI-pre <- pre-clause SEI spaces? SEI-post <- post-clause SEI-no-SA-handling <- pre-clause SEI post-clause ; metalinguistic bridi end marker SEhU-clause <- SEhU-pre SEhU-post SEhU-pre <- pre-clause SEhU spaces? SEhU-post <- post-clause SEhU-no-SA-handling <- pre-clause SEhU post-clause ; metalinguistic single word eraser SI-clause <- spaces? SI spaces? ; reciprocal sumti marker SOI-clause <- SOI-pre SOI-post SOI-pre <- pre-clause SOI spaces? SOI-post <- post-clause SOI-no-SA-handling <- pre-clause SOI post-clause ; metalinguistic eraser of the entire text SU-clause <- SU-pre SU-post SU-pre <- pre-clause SU spaces? SU-post <- post-clause ; tense interval properties TAhE-clause <- TAhE-pre TAhE-post TAhE-pre <- pre-clause TAhE spaces? TAhE-post <- post-clause TAhE-no-SA-handling <- pre-clause TAhE post-clause ; closing gap for MEX constructs TEhU-clause <- TEhU-pre TEhU-post TEhU-pre <- pre-clause TEhU spaces? TEhU-post <- post-clause TEhU-no-SA-handling <- pre-clause TEhU post-clause ; start compound lerfu TEI-clause <- TEI-pre TEI-post TEI-pre <- pre-clause TEI spaces? TEI-post <- post-clause TEI-no-SA-handling <- pre-clause TEI post-clause ; left discursive parenthesis TO-clause <- TO-pre TO-post TO-pre <- pre-clause TO spaces? TO-post <- post-clause TO-no-SA-handling <- pre-clause TO post-clause ; right discursive parenthesis TOI-clause <- TOI-pre TOI-post TOI-pre <- pre-clause TOI spaces? TOI-post <- post-clause TOI-no-SA-handling <- pre-clause TOI post-clause ; multiple utterance scope mark TUhE-clause <- TUhE-pre TUhE-post TUhE-pre <- pre-clause TUhE spaces? TUhE-post <- su-clause* post-clause TUhE-no-SA-handling <- pre-clause TUhE su-clause* post-clause ; multiple utterance end scope mark TUhU-clause <- TUhU-pre TUhU-post TUhU-pre <- pre-clause TUhU spaces? TUhU-post <- post-clause TUhU-no-SA-handling <- pre-clause TUhU post-clause ; attitudinals, observationals, discursives UI-clause <- UI-pre UI-post UI-pre <- pre-clause UI spaces? UI-post <- post-clause UI-no-SA-handling <- pre-clause UI post-clause ; distance in space-time VA-clause <- VA-pre VA-post VA-pre <- pre-clause VA spaces? VA-post <- post-clause VA-no-SA-handling <- pre-clause VA post-clause ; end simple bridi or bridi-tail VAU-clause <- VAU-pre VAU-post VAU-pre <- pre-clause VAU spaces? VAU-post <- post-clause VAU-no-SA-handling <- pre-clause VAU post-clause ; left MEX bracket VEI-clause <- VEI-pre VEI-post VEI-pre <- pre-clause VEI spaces? VEI-post <- post-clause VEI-no-SA-handling <- pre-clause VEI post-clause ; right MEX bracket VEhO-clause <- VEhO-pre VEhO-post VEhO-pre <- pre-clause VEhO spaces? VEhO-post <- post-clause VEhO-no-SA-handling <- pre-clause VEhO post-clause ; MEX operator VUhU-clause <- VUhU-pre VUhU-post VUhU-pre <- pre-clause VUhU spaces? VUhU-post <- post-clause VUhU-no-SA-handling <- pre-clause VUhU post-clause ; space-time interval size VEhA-clause <- VEhA-pre VEhA-post VEhA-pre <- pre-clause VEhA spaces? VEhA-post <- post-clause VEhA-no-SA-handling <- pre-clause VEhA post-clause ; space-time dimensionality marker VIhA-clause <- VIhA-pre VIhA-post VIhA-pre <- pre-clause VIhA spaces? VIhA-post <- post-clause VIhA-no-SA-handling <- pre-clause VIhA post-clause VUhO-clause <- VUhO-pre VUhO-post VUhO-pre <- pre-clause VUhO spaces? VUhO-post <- post-clause VUhO-no-SA-handling <- pre-clause VUhO post-clause ; glue between logically connected sumti and relative clauses ; subscripting operator XI-clause <- XI-pre XI-post XI-pre <- pre-clause XI spaces? XI-post <- post-clause XI-no-SA-handling <- pre-clause XI post-clause ; hesitation ; Very very special case. Handled in the morphology section. ; Y-clause <- spaces? Y spaces? ; event properties - inchoative, etc. ZAhO-clause <- ZAhO-pre ZAhO-post ZAhO-pre <- pre-clause ZAhO spaces? ZAhO-post <- post-clause ZAhO-no-SA-handling <- pre-clause ZAhO post-clause ; time interval size tense ZEhA-clause <- ZEhA-pre ZEhA-post ZEhA-pre <- pre-clause ZEhA spaces? ZEhA-post <- post-clause ZEhA-no-SA-handling <- pre-clause ZEhA post-clause ; lujvo glue ZEI-clause <- ZEI-pre ZEI-post ZEI-clause-no-SA <- ZEI-pre-no-SA ZEI ZEI-post ZEI-pre <- pre-clause ZEI spaces? ZEI-pre-no-SA <- pre-clause ZEI-post <- spaces? ZEI-no-SA-handling <- pre-clause ZEI post-clause ; time distance tense ZI-clause <- ZI-pre ZI-post ZI-pre <- pre-clause ZI spaces? ZI-post <- post-clause ZI-no-SA-handling <- pre-clause ZI post-clause ; conjoins relative clauses ZIhE-clause <- ZIhE-pre ZIhE-post ZIhE-pre <- pre-clause ZIhE spaces? ZIhE-post <- post-clause ZIhE-no-SA-handling <- pre-clause ZIhE post-clause ; single word metalinguistic quote marker ZO-clause <- ZO-pre ZO-post ZO-pre <- pre-clause ZO spaces? any-word spaces? ZO-post <- post-clause ZO-no-SA-handling <- pre-clause ZO spaces? any-word spaces? ; delimited quote marker ZOI-clause <- ZOI-pre ZOI-post ZOI-pre <- pre-clause ZOI spaces? zoi-open zoi-word* zoi-close spaces? ZOI-post <- post-clause ZOI-no-SA-handling <- pre-clause ZOI spaces? zoi-open zoi-word* zoi-close spaces? ; prenex terminator (not elidable) ZOhU-clause <- ZOhU-pre ZOhU-post ZOhU-pre <- pre-clause ZOhU spaces? ZOhU-post <- post-clause ZOhU-no-SA-handling <- pre-clause ZOhU post-clause ; --- MORPHOLOGY --- CMENE <- cmene BRIVLA <- gismu / lujvo / fuhivla CMAVO <- A / BAI / BAhE / BE / BEI / BEhO / BIhE / BIhI / BO / BOI / BU / BY / CAhA / CAI / CEI / CEhE / CO / COI / CU / CUhE / DAhO / DOI / DOhU / FA / FAhA / FAhO / FEhE / FEhU / FIhO / FOI / FUhA / FUhE / FUhO / GA / GAhO / GEhU / GI / GIhA / GOI / GOhA / GUhA / I / JA / JAI / JOhI / JOI / KE / KEhE / KEI / KI / KOhA / KU / KUhE / KUhO / LA / LAU / LAhE / LE / LEhU / LI / LIhU / LOhO / LOhU / LU / LUhU / MAhO / MAI / ME / MEhU / MOhE / MOhI / MOI / NA / NAI / NAhE / NAhU / NIhE / NIhO / NOI / NU / NUhA / NUhI / NUhU / PA / PEhE / PEhO / PU / RAhO / ROI / SA / SE / SEI / SEhU / SI / SOI / SU / TAhE / TEhU / TEI / TO / TOI / TUhE / TUhU / UI / VA / VAU / VEI / VEhO / VUhU / VEhA / VIhA / VUhO / XI / ZAhO / ZEhA / ZEI / ZI / ZIhE / ZO / ZOI / ZOhU / cmavo ; This is a Parsing Expression Grammar for the morphology of Lojban. ; See http://www.pdos.lcs.mit.edu/~baford/packrat/ ; ; All rules have the form ; ; name <- peg-expression ; ; which means that the grammatical construct "name" is parsed using ; "peg-expression". ; ; 1) Concatenation is expressed by juxtaposition with no operator symbol. ; 2) / represents *ORDERED* alternation (choice). If the first ; option succeeds, the others will never be checked. ; 3) ? indicates that the element to the left is optional. ; 4) * represents optional repetition of the construct to the left. ; 5) + represents one-or-more repetition of the construct to the left. ; 6) () serves to indicate the grouping of the other operators. ; 7) & indicates that the element to the right must follow (but the ; marked element itself does not absorb anything). ; 8) ! indicates that the element to the right must not follow (the ; marked element itself does not absorb anything). ; 9) . represents any character. ; 10) ' ' or " " represents a literal string. ; 11) [] represents a character class. ; ; Repetitions grab as much as they can. ; ; ; --- GRAMMAR --- ; This grammar classifies words by their morphological class (cmene, ; gismu, lujvo, fuhivla, cmavo, and non-lojban-word). ; ;The final section sorts cmavo into grammatical classes (A, BAI, BAhE, ..., ZOhU). ; ; mi'e ((xorxes)) ;------------------------------------------------------------------- words <- pause? (word pause?)* word <- lojban-word / non-lojban-word lojban-word <- cmene / cmavo / brivla ;------------------------------------------------------------------- cmene <- !h &consonant-final coda? (any-syllable / digit)* &pause consonant-final <- (non-space &non-space)* consonant &pause ;cmene <- !h cmene-syllable* &consonant coda? consonantal-syllable* onset &pause ;cmene-syllable <- !doi-la-lai-lahi coda? consonantal-syllable* onset nucleus / digit ;doi-la-lai-lahi <- (d o i / l a (h? i)?) !h !nucleus ;------------------------------------------------------------------- cmavo <- !cmene !CVCy-lujvo cmavo-form &post-word CVCy-lujvo <- CVC-rafsi y h? initial-rafsi* brivla-core / stressed-CVC-rafsi y short-final-rafsi cmavo-form <- !h !cluster onset (nucleus h)* (!stressed nucleus / nucleus !cluster) / y+ / digit ;------------------------------------------------------------------- brivla <- !cmavo initial-rafsi* brivla-core brivla-core <- fuhivla / gismu / CVV-final-rafsi / stressed-initial-rafsi short-final-rafsi stressed-initial-rafsi <- stressed-extended-rafsi / stressed-y-rafsi / stressed-y-less-rafsi initial-rafsi <- extended-rafsi / y-rafsi / !any-extended-rafsi y-less-rafsi ;------------------------------------------------------------------- any-extended-rafsi <- fuhivla / extended-rafsi / stressed-extended-rafsi fuhivla <- fuhivla-head stressed-syllable consonantal-syllable* final-syllable stressed-extended-rafsi <- stressed-brivla-rafsi / stressed-fuhivla-rafsi extended-rafsi <- brivla-rafsi / fuhivla-rafsi stressed-brivla-rafsi <- &unstressed-syllable brivla-head stressed-syllable h y brivla-rafsi <- &(syllable consonantal-syllable* syllable) brivla-head h y h? stressed-fuhivla-rafsi <- fuhivla-head stressed-syllable &consonant onset y fuhivla-rafsi <- &unstressed-syllable fuhivla-head &consonant onset y h? fuhivla-head <- !rafsi-string brivla-head brivla-head <- !cmavo !slinkuhi !h &onset unstressed-syllable* slinkuhi <- consonant rafsi-string rafsi-string <- y-less-rafsi* (gismu / CVV-final-rafsi / stressed-y-less-rafsi short-final-rafsi / y-rafsi / stressed-y-rafsi / stressed-y-less-rafsi? initial-pair y) ;------------------------------------------------------------------- gismu <- stressed-long-rafsi &final-syllable vowel &post-word CVV-final-rafsi <- consonant stressed-vowel h &final-syllable vowel &post-word short-final-rafsi <- &final-syllable (consonant diphthong / initial-pair vowel) &post-word stressed-y-rafsi <- (stressed-long-rafsi / stressed-CVC-rafsi) y stressed-y-less-rafsi <- stressed-CVC-rafsi !y / stressed-CCV-rafsi / stressed-CVV-rafsi stressed-long-rafsi <- (stressed-CCV-rafsi / stressed-CVC-rafsi) consonant stressed-CVC-rafsi <- consonant stressed-vowel consonant stressed-CCV-rafsi <- initial-pair stressed-vowel stressed-CVV-rafsi <- consonant (unstressed-vowel h stressed-vowel / stressed-diphthong) r-hyphen? y-rafsi <- (long-rafsi / CVC-rafsi) y h? y-less-rafsi <- !y-rafsi (CVC-rafsi !y / CCV-rafsi / CVV-rafsi) !any-extended-rafsi long-rafsi <- (CCV-rafsi / CVC-rafsi) consonant CVC-rafsi <- consonant unstressed-vowel consonant CCV-rafsi <- initial-pair unstressed-vowel CVV-rafsi <- consonant (unstressed-vowel h unstressed-vowel / unstressed-diphthong) r-hyphen? r-hyphen <- r &consonant / n &r ;------------------------------------------------------------------- final-syllable <- onset !y !stressed nucleus !cmene &post-word stressed-syllable <- &stressed syllable / syllable &stress stressed-diphthong <- &stressed diphthong / diphthong &stress stressed-vowel <- &stressed vowel / vowel &stress unstressed-syllable <- !stressed syllable !stress / consonantal-syllable unstressed-diphthong <- !stressed diphthong !stress unstressed-vowel <- !stressed vowel !stress stress <- consonant* y? syllable pause stressed <- onset comma* [AEIOU] any-syllable <- onset nucleus coda? / consonantal-syllable syllable <- onset !y nucleus coda? consonantal-syllable <- consonant syllabic &(consonantal-syllable / onset) (consonant &spaces)? coda <- !any-syllable consonant &any-syllable / syllabic? consonant? &pause onset <- h / consonant? glide / initial nucleus <- vowel / diphthong / y !nucleus ;----------------------------------------------------------------- glide <- (i / u) &nucleus !glide diphthong <- (a i / a u / e i / o i) !nucleus !glide vowel <- (a / e / i / o / u) !nucleus a <- comma* [aA] e <- comma* [eE] i <- comma* [iI] o <- comma* [oO] u <- comma* [uU] y <- comma* [yY] ;------------------------------------------------------------------- cluster <- consonant consonant+ initial-pair <- &initial consonant consonant !consonant initial <- (affricate / sibilant? other? liquid?) !consonant !glide affricate <- t c / t s / d j / d z liquid <- l / r other <- p / t !l / k / f / x / b / d !l / g / v / m / n !liquid sibilant <- c / s !x / (j / z) !n !liquid consonant <- voiced / unvoiced / syllabic syllabic <- l / m / n / r voiced <- b / d / g / j / v / z unvoiced <- c / f / k / p / s / t / x l <- comma* [lL] !h !l m <- comma* [mM] !h !m !z n <- comma* [nN] !h !n !affricate r <- comma* [rR] !h !r b <- comma* [bB] !h !b !unvoiced d <- comma* [dD] !h !d !unvoiced g <- comma* [gG] !h !g !unvoiced v <- comma* [vV] !h !v !unvoiced j <- comma* [jJ] !h !j !z !unvoiced z <- comma* [zZ] !h !z !j !unvoiced s <- comma* [sS] !h !s !c !voiced c <- comma* [cC] !h !c !s !x !voiced x <- comma* [xX] !h !x !c !k !voiced k <- comma* [kK] !h !k !x !voiced f <- comma* [fF] !h !f !voiced p <- comma* [pP] !h !p !voiced t <- comma* [tT] !h !t !voiced h <- comma* ['h] &nucleus ;------------------------------------------------------------------- digit <- comma* [0123456789] !h !nucleus post-word <- pause / !nucleus lojban-word pause <- comma* space-char / EOF EOF <- comma* !. comma <- [,] non-lojban-word <- !lojban-word non-space+ non-space <- !space-char . ;Unicode-style and escaped chars not compatible with cl-peg ; space-char <- [.\t\n\r?!\u0020] space-char <- [.?! ] / space-char1 / space-char2 space-char1 <- ' ' space-char2 <- ' ' ;------------------------------------------------------------------- spaces <- !Y initial-spaces initial-spaces <- (comma* space-char / !ybu Y)+ EOF? / EOF ybu <- Y space-char* BU lujvo <- !gismu !fuhivla brivla ;------------------------------------------------------------------- A <- &cmavo ( a / e / j i / o / u ) &post-word BAI <- &cmavo ( d u h o / s i h u / z a u / k i h i / d u h i / c u h u / t u h i / t i h u / d i h o / j i h u / r i h a / n i h i / m u h i / k i h u / v a h u / k o i / c a h i / t a h i / p u h e / j a h i / k a i / b a i / f i h e / d e h i / c i h o / m a u / m u h u / r i h i / r a h i / k a h a / p a h u / p a h a / l e h a / k u h u / t a i / b a u / m a h i / c i h e / f a u / p o h i / c a u / m a h e / c i h u / r a h a / p u h a / l i h e / l a h u / b a h i / k a h i / s a u / f a h e / b e h i / t i h i / j a h e / g a h a / v a h o / j i h o / m e h a / d o h e / j i h e / p i h o / g a u / z u h e / m e h e / r a i ) &post-word BAhE <- &cmavo ( b a h e / z a h e ) &post-word BE <- &cmavo ( b e ) &post-word BEI <- &cmavo ( b e i ) &post-word BEhO <- &cmavo ( b e h o ) &post-word BIhE <- &cmavo ( b i h e ) &post-word BIhI <- &cmavo ( m i h i / b i h o / b i h i ) &post-word BO <- &cmavo ( b o ) &post-word BOI <- &cmavo ( b o i ) &post-word BU <- &cmavo ( b u ) &post-word BY <- ybu / &cmavo ( j o h o / r u h o / g e h o / j e h o / l o h a / n a h a / s e h e / t o h a / g a h e / y h y / b y / c y / d y / f y / g y / j y / k y / l y / m y / n y / p y / r y / s y / t y / v y / x y / z y ) &post-word CAhA <- &cmavo ( c a h a / p u h i / n u h o / k a h e ) &post-word CAI <- &cmavo ( p e i / c a i / c u h i / s a i / r u h e ) &post-word CEI <- &cmavo ( c e i ) &post-word CEhE <- &cmavo ( c e h e ) &post-word CO <- &cmavo ( c o ) &post-word COI <- &cmavo ( j u h i / c o i / f i h i / t a h a / m u h o / f e h o / c o h o / p e h u / k e h o / n u h e / r e h i / b e h e / j e h e / m i h e / k i h e / v i h o ) &post-word CU <- &cmavo ( c u ) &post-word CUhE <- &cmavo ( c u h e / n a u ) &post-word DAhO <- &cmavo ( d a h o ) &post-word DOI <- &cmavo ( d o i ) &post-word DOhU <- &cmavo ( d o h u ) &post-word FA <- &cmavo ( f a i / f a / f e / f o / f u / f i h a / f i ) &post-word FAhA <- &cmavo ( d u h a / b e h a / n e h u / v u h a / g a h u / t i h a / n i h a / c a h u / z u h a / r i h u / r u h u / r e h o / t e h e / b u h u / n e h a / p a h o / n e h i / t o h o / z o h i / z e h o / z o h a / f a h a ) &post-word FAhO <- &cmavo ( f a h o ) &post-word FEhE <- &cmavo ( f e h e ) &post-word FEhU <- &cmavo ( f e h u ) &post-word FIhO <- &cmavo ( f i h o ) &post-word FOI <- &cmavo ( f o i ) &post-word FUhA <- &cmavo ( f u h a ) &post-word FUhE <- &cmavo ( f u h e ) &post-word FUhO <- &cmavo ( f u h o ) &post-word GA <- &cmavo ( g e h i / g e / g o / g a / g u ) &post-word GAhO <- &cmavo ( k e h i / g a h o ) &post-word GEhU <- &cmavo ( g e h u ) &post-word GI <- &cmavo ( g i ) &post-word GIhA <- &cmavo ( g i h e / g i h i / g i h o / g i h a / g i h u ) &post-word GOI <- &cmavo ( n o h u / n e / g o i / p o h u / p e / p o h e / p o ) &post-word GOhA <- &cmavo ( m o / n e i / g o h u / g o h o / g o h i / n o h a / g o h e / g o h a / d u / b u h a / b u h e / b u h i / c o h e ) &post-word GUhA <- &cmavo ( g u h e / g u h i / g u h o / g u h a / g u h u ) &post-word I <- &cmavo ( i ) &post-word JA <- &cmavo ( j e h i / j e / j o / j a / j u ) &post-word JAI <- &cmavo ( j a i ) &post-word JOhI <- &cmavo ( j o h i ) &post-word JOI <- &cmavo ( f a h u / p i h u / j o i / c e h o / c e / j o h u / k u h a / j o h e / j u h e ) &post-word KE <- &cmavo ( k e ) &post-word KEhE <- &cmavo ( k e h e ) &post-word KEI <- &cmavo ( k e i ) &post-word KI <- &cmavo ( k i ) &post-word KOhA <- &cmavo ( d a h u / d a h e / d i h u / d i h e / d e h u / d e h e / d e i / d o h i / m i h o / m a h a / m i h a / d o h o / k o h a / f o h u / k o h e / k o h i / k o h o / k o h u / f o h a / f o h e / f o h i / f o h o / v o h a / v o h e / v o h i / v o h o / v o h u / r u / r i / r a / t a / t u / t i / z i h o / k e h a / m a / z u h i / z o h e / c e h u / d a / d e / d i / k o / m i / d o ) &post-word KU <- &cmavo ( k u ) &post-word KUhE <- &cmavo ( k u h e ) &post-word KUhO <- &cmavo ( k u h o ) &post-word LA <- &cmavo ( l a i / l a h i / l a ) &post-word LAU <- &cmavo ( c e h a / l a u / z a i / t a u ) &post-word LAhE <- &cmavo ( t u h a / l u h a / l u h o / l a h e / v u h i / l u h i / l u h e ) &post-word LE <- &cmavo ( l e i / l o i / l e h i / l o h i / l e h e / l o h e / l o / l e ) &post-word LEhU <- &cmavo ( l e h u ) &post-word LI <- &cmavo ( m e h o / l i ) &post-word LIhU <- &cmavo ( l i h u ) &post-word LOhO <- &cmavo ( l o h o ) &post-word LOhU <- &cmavo ( l o h u ) &post-word LU <- &cmavo ( l u ) &post-word LUhU <- &cmavo ( l u h u ) &post-word MAhO <- &cmavo ( m a h o ) &post-word MAI <- &cmavo ( m o h o / m a i ) &post-word ME <- &cmavo ( m e ) &post-word MEhU <- &cmavo ( m e h u ) &post-word MOhE <- &cmavo ( m o h e ) &post-word MOhI <- &cmavo ( m o h i ) &post-word MOI <- &cmavo ( m e i / m o i / s i h e / c u h o / v a h e ) &post-word NA <- &cmavo ( j a h a / n a ) &post-word NAI <- &cmavo ( n a i ) &post-word NAhE <- &cmavo ( t o h e / j e h a / n a h e / n o h e ) &post-word NAhU <- &cmavo ( n a h u ) &post-word NIhE <- &cmavo ( n i h e ) &post-word NIhO <- &cmavo ( n i h o / n o h i ) &post-word NOI <- &cmavo ( v o i / n o i / p o i ) &post-word NU <- &cmavo ( n i / d u h u / s i h o / n u / l i h i / k a / j e i / s u h u / z u h o / m u h e / p u h u / z a h i ) &post-word NUhA <- &cmavo ( n u h a ) &post-word NUhI <- &cmavo ( n u h i ) &post-word NUhU <- &cmavo ( n u h u ) &post-word PA <- &cmavo ( d a u / f e i / g a i / j a u / r e i / v a i / p i h e / p i / f i h u / z a h u / m e h i / n i h u / k i h o / c e h i / m a h u / r a h e / d a h a / s o h a / j i h i / s u h o / s u h e / r o / r a u / s o h u / s o h i / s o h e / s o h o / m o h a / d u h e / t e h o / k a h o / c i h i / t u h o / x o / p a i / n o h o / n o / p a / r e / c i / v o / m u / x a / z e / b i / s o / digit ) &post-word PEhE <- &cmavo ( p e h e ) &post-word PEhO <- &cmavo ( p e h o ) &post-word PU <- &cmavo ( b a / p u / c a ) &post-word RAhO <- &cmavo ( r a h o ) &post-word ROI <- &cmavo ( r e h u / r o i ) &post-word SA <- &cmavo ( s a ) &post-word SE <- &cmavo ( s e / t e / v e / x e ) &post-word SEI <- &cmavo ( s e i / t i h o ) &post-word SEhU <- &cmavo ( s e h u ) &post-word SI <- &cmavo ( s i ) &post-word SOI <- &cmavo ( s o i ) &post-word SU <- &cmavo ( s u ) &post-word TAhE <- &cmavo ( r u h i / t a h e / d i h i / n a h o ) &post-word TEhU <- &cmavo ( t e h u ) &post-word TEI <- &cmavo ( t e i ) &post-word TO <- &cmavo ( t o h i / t o ) &post-word TOI <- &cmavo ( t o i ) &post-word TUhE <- &cmavo ( t u h e ) &post-word TUhU <- &cmavo ( t u h u ) &post-word UI <- &cmavo ( i h a / i e / a h e / u h i / i h o / i h e / a h a / i a / o h i / o h e / e h e / o i / u o / e h i / u h o / a u / u a / a h i / i h u / i i / u h a / u i / a h o / a i / a h u / i u / e i / o h o / e h a / u u / o h a / o h u / u h u / e h o / i o / e h u / u e / i h i / u h e / b a h a / j a h o / c a h e / s u h a / t i h e / k a h u / s e h o / z a h a / p e h i / r u h a / j u h a / t a h o / r a h u / l i h a / b a h u / m u h a / d o h a / t o h u / v a h i / p a h e / z u h u / s a h e / l a h a / k e h u / s a h u / d a h i / j e h u / s a h a / k a u / t a h u / n a h i / j o h a / b i h u / l i h o / p a u / m i h u / k u h i / j i h a / s i h a / p o h o / p e h a / r o h i / r o h e / r o h o / r o h u / r o h a / r e h e / l e h o / j u h o / f u h i / d a i / g a h i / z o h o / b e h u / r i h e / s e h i / s e h a / v u h e / k i h a / x u / g e h e / b u h o ) &post-word VA <- &cmavo ( v i / v a / v u ) &post-word VAU <- &cmavo ( v a u ) &post-word VEI <- &cmavo ( v e i ) &post-word VEhO <- &cmavo ( v e h o ) &post-word VUhU <- &cmavo ( g e h a / f u h u / p i h i / f e h i / v u h u / s u h i / j u h u / g e i / p a h i / f a h i / t e h a / c u h a / v a h a / n e h o / d e h o / f e h a / s a h o / r e h a / r i h o / s a h i / p i h a / s i h i ) &post-word VEhA <- &cmavo ( v e h u / v e h a / v e h i / v e h e ) &post-word VIhA <- &cmavo ( v i h i / v i h a / v i h u / v i h e ) &post-word VUhO <- &cmavo ( v u h o ) &post-word XI <- &cmavo ( x i ) &post-word Y <- &cmavo ( y+ ) &post-word ZAhO <- &cmavo ( c o h i / p u h o / c o h u / m o h u / c a h o / c o h a / d e h a / b a h o / d i h a / z a h o ) &post-word ZEhA <- &cmavo ( z e h u / z e h a / z e h i / z e h e ) &post-word ZEI <- &cmavo ( z e i ) &post-word ZI <- &cmavo ( z u / z a / z i ) &post-word ZIhE <- &cmavo ( z i h e ) &post-word ZO <- &cmavo ( z o ) &post-word ZOI <- &cmavo ( z o i / l a h o ) &post-word ZOhU <- &cmavo ( z o h u ) &post-word