lojban の現行文法の PEG に日本語解説を追加。 文責: 重城良国 注: 見直す時間が無いのでまちがい等多々あると思いますが、 その都度直していこうかと思います。 十分に吟味する時間がなく、要点をしぼっていないので、 くどくなっている。 とりあえず、今の段階では現行文法について通して見たうえで、 新文法については違いをメインに説明していこうかと考えている。 おそらく新文法のほうが簡単なので、こっちを見ておけば、 さらっとできると考えられる。 sa の廃止や、bo の右結合の廃止、NOI がセルブリにつけられる点、 シュメネをセルブリとしたことにより文法は単純化されている。 また、セルマホの統廃合も文法を単純化するのに貢献しているかと。 a. 全体の構造 このファイルの全体の構造は以下のようになっている。 0. PEG の記法とこのファイルでのルールの説明 1. 文章、段落、記述 (文よりも大きなまとまり) 2. 文やブリディ 3. 項、スムティ 4. 関係節、関係句 5. セルブリ、タンル単位 6. 付加引数 (be ... bei ... be'o) 7. 数式 8. 接続句 9. 時制、法制タグ 10. 自由修飾句 11. マジックワード (zei による複合単語や bu による文字を表す単語) 12. BAhE や UI 等の単語の前後にくっつけるもの 13. 空白として扱われる構造 14. それぞれのセルマホに属する単語の前後に BAhE や UI をつけたもの 15. 単語の形態に関するもの(cmene は子音で終わる、とか brivla は二重子音を含むとか、許される二重子音は何かとか) b. 全体の構成についてのコメント 14 はそれぞれのセルマホに BAhE や UI 等をつけた構造を定義している。 ほぼすべてのセルマホについて定義されているので、 このファイルのほとんど半分を占める。 15 は母音や子音の話等の単語の構造に関する話である。 cmavo の列挙部分がその半分を占める。 また、それ自身は全体の1/4ほどを占める。 さらに、多くの行が sa による打ち消しを実現するために使われている。 よって実質的に重要なのは全体の 1/3 ほどであると思われる。 ; This is a Parsing Expression Grammar for Lojban. ; See http://www.pdos.lcs.mit.edu/~baford/packrat/ ; 0. PEG の記法とこのファイルでのルールの説明 ; 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. 基本的に以下の形で表される。 name <- peg-expression 1) 小文字は複合的な構造 2) 大文字はセルマホを表しこれが末端(単語)となる 3) 単純に並べることで順接を表す 4) / が優先順位つきの選択を示す 5) ? は 0個か 1つを示す 6) * は 0個かそれ以上を示す 7) + は 1つかそれ以上を示す 8) () はグループにまとめる ?, *, + は最長マッチである 上記説明に足りないものとして !exp はその位置に exp が来ないことを、 &exp はその位置に exp が来ることを示す。 また ; ではじまる行はコメント。 また、このファイルでは左結合を a <- b b* のように表し、 右結合を a <- b a のように表している。 PEG が左再帰を扱えないためこのようになっている。 本来ならば左結合は a <- a b のようになる(BNF ならそう表現すると思う)。 1. 文章、段落、記述 (文よりも大きなまとまり) ; --- GRAMMAR --- ;------------------------------------------------------------------- ;-- #01 text paragraph statement 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)? 上記の text は text-1 に、文章全体にかかる NAI や UI 、 名前等をつけて、最後に fa'o をつけたもの。 intro-null は空白や sa, si を扱うだけ。 ; 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 文章の頭に .i や ni'o を置いても良いし 置かなくても良いということを示している。 さらに言えば、.i や ni'o のみでも文章として成立することも読み取れる。 paragraphs <- paragraph (NIhO-clause+ free* su-clause* paragraphs)? 段落はそれぞれ ni'o で区切られる。また su は ni'o の後までを消す。 詳細は su-clause の説明で。 paragraph <- (statement / fragment) (I-clause !jek !joik !joik-jek free* (statement / fragment)?)* 段落は記述(または断片)を .i でつないだもの。 .i に jek や joik がついたものはより強く結合するということで、 より下で扱うためここでは !jek !joik 等となっている。 statement <- statement-1 / prenex statement 記述には prenex がいくつでもつけられる。 以下、joik-jek や bo の存在による結合性の強さを区別するために 何段階かに分かれている。 また、この位置に prenex の付加がきていることで、 prenex は単なる .i よりも強く結合するが .ije 等よりは弱く結合することが示される。 つまり、 [lo xanto zo'u (lo nazbi cu clani .ije lo xadni cu barda)] .i mi gleki 文法的には上記のようになり、 「私が喜んでいる」のは象についてでなくても良い。 ただし、CLL に書かれているように、意味論的には .i mi gleki にまで zo'u がかかると解釈しても良いようだ。 statement-1 <- statement-2 (I-clause joik-jek statement-2?)* 本質的にはふたつ上と同様、文を .i でつなげるということを言っているが、 ただの .i よりも joik-jek のついた .i のほうが結合力が強いということを 示している。 statement-2 <- statement-3 (I-clause (jek / joik)? stag? BO-clause free* statement-2)? / statement-3 (I-clause (jek / joik)? stag? BO-clause free*)? bo がついた場合には .i や .ije 等よりも強く結びつくことを示している。 bo 同士では右結合となることも示している。 また、2行目では、.i bo .i のような構造も可能であることを示している。 が、意味論的あるいは実用的にどのような意味があるのかは僕にはわからない。 (注) このファイルでは a <- b (op c)* は左結合を、a <- b (op a)? は右結合を 表している。 ちなみに、左結合は本来ならば a <- a (op b)? とするべきだが、 PEG では左再帰を扱えない(無限ループになる)ために * による くりかえしを使っている。 statement-3 <- sentence / tag? TUhE-clause free* text-1 TUhU-clause? free* 上記で .i 等で結びつけられる構造は、文または tu'e ... tu'u で かこまれた文章である。 fragment <- prenex / terms VAU-clause? free* / ek free* / gihek free* / quantifier / NA-clause !JA-clause free* / relative-clauses / links / linkargs 上記の「記述」の代わりに置くことのできる「断片」。 上のほうの (statement / fragment) という定義を見よ。 質問の答えに使われる。それ以外の用途があるかどうかは知らない。 prenex <- terms ZOhU-clause free* 複数の項のあとに zo'u を置いたものが prenex である。 ;; sentence <- (terms CU-clause? free*)? bridi-tail / bridi-tail 2. 文やブリディ 7 の途中まで予習したので、今日はそこまで。 次回、slabu gerna を終わらせて、次々回に zasni gerna をする予定。 ;------------------------------------------------------------------- ;-- #02 sentence bridi sentence <- (terms bridi-tail-sa* CU-clause? free*)? bridi-tail-sa* bridi-tail bridi-tail-sa は消された bridi-tail であり、 それ(ら)の代わりに本当の bridi-tail が来る。 複数の項の後に cu が来てそのあとに bridi-tail が来るという構造。 bridi-tail の前に項が来ない場合には cu をつけてはならない ということも(括弧と?によって)示されている。 sentence-sa <- sentence-start (!sentence-start (sa-word / SA-clause !sentence-start ) )* SA-clause &text-1 文というレベルでの sa による打ち消し。 SA-clause は sa の前後に BAhE や UI 等がついたもの。 [SELMAHO]-clause という形の多くはそのような構造を表している。 また、sa-word はいくつかの特殊な構造を除いたほとんどの単語。 つまり文レベルでの sa による打ち消しは、 文の開始に普通の単語または「文の開始の前に来ない」sa がいくつか来て、 そのあとに sa が来て、その先に文章が続くという形をとるということ。 最後の text-1 に & がついていることに注意。 これは後に text-1 が来るという条件を示すが、 それ自体は sentence-sa を構成しないということを示している。 &text-1 は「トークンを消費しない」ということ。 sentence-start <- I-pre / NIhO-pre ...-start という形は sa による打ち消しのためだけに使われる。 ほとんどの構造にこれら sa のための文法構造が必要。 zasni gerna で sa を廃止することにしたのは、 このような、本質的でない部分が、 文法を複雑にするのを避けるためもあるだろう。 また、sa は文法的に同等の構造を打ち消すということだが、 何が文法的に同等であると考えるのかという点にも恣意性がある。 (もちろん、PEG で唯一に決めることはできるが、 それを人間の頭で正確にパースすることは困難と思われる。 たとえば、.e と joi は 同じ構造と見なされるかどうか、等。) subsentence <- sentence / prenex subsentence subsentence は noi や nu によって作られる構造内で使われる 文の特殊な形。 sentence との違いは(複数の) prenex がつけられるという点である。 (単文しかとれないが prenex はとれるような場所において使われる) bridi-tail <- bridi-tail-1 (gihek stag? KE-clause free* bridi-tail KEhE-clause? free* tail-terms)? この bridi-tail と bridi-tail-1, bridi-tail-2 とは ke による結合性の低下、そのままの結合性、bo による結合性の強化 の三者で、それぞれのレベルで gi'e 等を足している。 また、gi'e によって結合された bridi-tail はそれぞれの 末端項(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 レベルの sa による打ち消し。詳述しない。 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 sa による打ち消しのために必要な構造。詳述しない。 bridi-tail-1 <- bridi-tail-2 (gihek !(stag? BO-clause) !(stag? KE-clause) free* bridi-tail-2 tail-terms)* 上記 gi'e ke の構造と同様だが bo も ke もついていない。 ! によってそこに bo も ke も来ないことを示している。 ノーマルな結合性。 bridi-tail-2 <- bridi-tail-3 (gihek stag? BO-clause free* bridi-tail-2 tail-terms)? 上記の構造と同様だが bo がついている。強い結合性を持つ。 bo は現行文法では右結合なので、a <- b a のような構造になっている。 bridi-tail-3 <- selbri tail-terms / gek-sentence ブリディ末端の基本形は(セルブリ + 末端項)である。 つまり、klama tu ti ta lo karce など。 gek-sentence <- gek subsentence gik subsentence tail-terms / tag? KE-clause free* gek-sentence KEhE-clause? free* / NA-clause free* gek-sentence gek-sentence も bridi-tail となる。 これは、[ge 文 gi 文] という構造。これも共通の末端項を取れる。 また、これを ke ... ke'e でくくったり、これに na をつけたりすることも できる。 また、sentence ではなく subsentence となっているのは、 prenex をつけることができるということ。 mi ge lo gerku zo'u do klama gi lo mlatu zo'u ti klama (私は犬についてはあなたのところへ行き、猫についてはそこに行く) 犬をつれて聞き手の家に行き、 猫をつれてどこか他の場所に行くといった感じ。 3. 項、スムティ ;------------------------------------------------------------------- ;-- #03 term sumti 3-1. 項 tail-terms <- terms? VAU-clause? free* terms <- terms-1+ 末端項は複数の項-1に任意の vau がついた構造。 今までも出てきたが free* は自由修飾句。 現行文法では自由修飾句は置ける場所に制限がある。 この制限のために文法が複雑化してしまっているため、 新文法ではより自由な位置に置けるような形になっていると思われる。 ;; 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)* 今後 ...-sa は読み取ばしていく。また free* も無いものとして考えよう。 すると上記は terms-2 (PEhE-clause joik-jek terms-2)* となりわかりやすい。 つまり、項-2 pe'e je 項-2 pe'e je 項-2 ... という構造を示す。 terms-2 <- term (cehe-sa* CEhE-clause free* term)* これは term を ce'e でつないだもの。 つまり、上記と合わせると、 (項 ce'e 項 ...) pe'e je (項 ce'e 項 ...) ... のような構造となる。 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 上記は pe'e や ce'e というレベルでの sa による打ち消し。 ;;term <- sumti / ( !gek (tag / FA-clause free*) (sumti / KU-clause? free*) ) / termset / NA-clause KU-clause free* term <- term-sa* term-1 sa による打ち消しを追加しているだけ。 term-1 <- sumti / ( !gek (tag / FA-clause free*) (sumti / KU-clause? free*) ) / termset / NA-clause KU-clause free* 項はスムティ、タグ + スムティ、名辞組、または na ku 。 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 ...-sa と ...-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 (ge 項1 項2 項3 項4 gi 項1' 項2' 項3' 項4')という構造。 こういう形の名辞組について CLL に記載があったかどうか覚えていないが、 意味は類推できるように思う。 (nu'i ge ... nu'u gi ...)と意味は思じように思うが。 terms-gik-terms <- term (gik / terms-gik-terms) term gik の前後に同じ数の term が来ることを示す。 (注) 20章であったような nu'i ... nu'u .e ... という構造は この文法のなかには見当たらない。 camxes でも error になるので、廃止されたのかもしれない。 (注2) 名辞組については僕自身が十分に理解していない。 3-2. スムティ sumti <- sumti-1 (VUhO-clause free* relative-clauses)? vu'o はスムティと関係節(句)の結合性を下げる。 接続詞よりも弱く結合する。 つまり、 (mi .e do) vu'o (noi klama lo zarci) mi .e (do noi klama lo zarci) といった感じ。 sumti-1 <- sumti-2 (joik-ek stag? KE-clause free* sumti KEhE-clause? free*)? スムティ接続の ke により結合性の低下したもの。 mi .e (ke do .a ti) や mi joi (ke do .a ti) のような構造。 stag は法制タグや時制タグ。 mi .e pu ke do .a ti のようにできる。 意味はちょっと今のところ僕にはわからない。 (BAI と PU の関係には混乱させられる) sumti-2 <- sumti-3 (joik-ek sumti-3)* スムティ接続の結合性がノーマルなもの。 ここに stag がないので mi .e pu do とはできないことがわかる。 camxes で確認ずみ。 sumti-3 <- sumti-4 (joik-ek stag? BO-clause free* sumti-3)? スムティ接続の結合性強化版。 mi .e pu bo do .a ti とできる。 やはり意味はわからない。 「私の前にあなた」なのか「私があなたの前」なのか。 たぶん .i pu bo と同じ意味だと思うので、 多分あなたのほうが前なのだと思う。 (BAI と PU の関係には混乱させられる。 あとで整理する必要がある -> 自分。) sumti-4 <- sumti-5 / gek sumti gik sumti-4 スムティの前置接続。 つまり、ge mi gi do ということ。 そして、それ自体が sumti-4 のところに入れられるので、 ge ti gi (ge mi gi do) ともできるということ。 もちろん sumti は sumti-4 よりも上にあるので、 ge (ge ti gi ta) gi do ともできる。 sumti-5 <- quantifier? sumti-6 relative-clauses? / quantifier selbri KU-clause? free* relative-clauses? 一行目はスムティに数量と関係節(句)をつけたもの。 二行目は短縮形で、冠詞(lo)を省略した形。 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 ここでスムティになれるものが定義されている。 zo, zoi, lo'u, lu による引用、レルフ列、代スムティ、 la, le, lo 等による描写、li による数、 そして、la'e や na'e bo を付加した sumti がスムティとなる。 li-clause <- LI-clause free* mex LOhO-clause? free* 数のスムティ化。lo'o は li の終端子。 sumti-tail <- (sumti-6 relative-clauses?)? sumti-tail-1 / relative-clauses sumti-tail-1 一行目で、lo mi gerku のような構造を示している。 ()内の relative-clauses は lo (mi ne do) gerku のような構造を示す。 二行目では描写(la, le, lo)内でセルブリの前につく 関係節(句)が定義されている。 lo pe mi gerku のような感じ。 sumti-tail-1 <- selbri relative-clauses? / quantifier selbri relative-clauses? / quantifier sumti スムティ末端。 セルブリに数量詞と関係節(句)がついたもの。 これに lo 等が前置されスムティとなる。 三行目は lo re mi のような構造を定義している。 4. 関係節、関係句 ;------------------------------------------------------------------- ;-- #04 relative clauses relative-clauses <- relative-clause (ZIhE-clause free* relative-clause)* 関係節は zi'e でつなぐことができる。 ;; relative-clause <- ;; GOI-clause free* term GEhU-clause? free* / ;; NOI-clause free* subsentence KUhO-clause? free* relative-clause <- relative-clause-sa* relative-clause-1 sa の追加。 relative-clause-sa <- relative-clause-start (!relative-clause-start (sa-word / SA-clause !relative-clause-start ) )* SA-clause &relative-clause-1 sa の定義。 relative-clause-1 <- GOI-clause free* term GEhU-clause? free* / NOI-clause free* subsentence KUhO-clause? free* NOI による関係節と GOI による関係句を定義している。 relative-clause-start <- GOI-clause / NOI-clause sa のための構造。 5. セルブリ、タンル単位 ;------------------------------------------------------------------- ;-- #05 selbri 5-1. セルブリ selbri <- tag? selbri-1 セルブリにはタグをつけることができる。 mi bai tavla bau la lojban や、mi pu klama のような構造。 ただし、本当は mi pu klama と書くと mi pu ku klama と書いたように構文解析 されてしまう(camxes と自作のパーサで確認)。 mi cu pu klama と書かないと上記の構造にならない。 意味論は文法構造からはある程度独立しているので問題ないのかもしれないが、 厳密に言えば、mi pu ku klama と mi cu pu klama とは意味に違いがあるように思う。 前者では pu のあとにスムティが省略されていると考えられるので、 「私は(何らかの出来事)の前に行く」となり後者は「私は(今より前に)行った」となり、 意味が変わってくるだろう。 mi pu klama は mi cu pu klama と解釈されて欲しいように思う。 ここらへんは文法を書き換える必要がある。 時制の場合には selbri に直接ついたときに基準を「今」とするというきまりがあるため、 上記の問題が生じるが、BAI に関してはどちらにしてもタグがつく対象は「暗黙の何か」 なので問題は生じない。 selbri-1 <- selbri-2 / NA-clause free* selbri selbri には na をつけることができる。 NA-clause selbri-1 ではなく NA-clause selbri となっているので、 mi na bai na bau tavla のように na と tag を交互に入れることができる。 na の連続は許されるが、tag の連続は許されない。 意味はよくわからない。 一見すると「私は強いられてでもなく、何らかの言語ででもなくしゃべる」 としそうだが、 mi na (bai (na (bau tavla) なので、 「私は、(強いられて、何らかの言語で話さない)わけではない」となるだろうか。 文法構造から直接的に意味を導けば後者となるだろう。 前者は mi na'e bai je na'e bau tavla となるだろうか。 selbri-2 <- selbri-3 (CO-clause free* selbri-2)? co によるタンルの生成。 ここを見ると co は右結合となっているが、CLL でそういう記述は無かったように思うが、 mi (gerku zdani) klama (私は犬小屋的に行く)を、 mi klama co (zdani co gerku) とするためには右結合のほうが都合がいい。 selbri-3 <- selbri-4+ co, ke, bo のいずれもつかないタンル。 ここまで見てきた ke の処理のしかたは、 ke の前後の結びつきを弱くするという形だったが、 ここでは、ke の後の構造のまとまりを強くするという形で同様のことを行っている。 上と同様のことをしようとすれば、selbri-x <- selbri-3 (ke selbri-x ke'e?)? のようになるだろうか。 ただし、これだと ke melbi cmalu ke'e nixli ckule のような構造は作れない。 selbri-4 <- selbri-5 (joik-jek selbri-5 / joik stag? KE-clause free* selbri-3 KEhE-clause? free*)* joi や je でつながれたタンル。 joik stag? KE-clause selbri-3 の部分は klama joi bai ke prami のような構造を許す。 しかし、klama je bai ke prami のような構造は許されない。 理由は不明。 selbri-5 <- selbri-6 ((jek / joik) stag? BO-clause free* selbri-5)? (joi or je) + bo でつながれたタンル。 これは、klama je bai bo prami のような構造も許す。 joik-jek と jek / joik の使い分けはよくわからない。 違いは順番の違いと free* がつくかつかないかの違いだが。 selbri-6 <- tanru-unit (BO-clause free* selbri-6)? / NAhE-clause? free* guhek selbri gik selbri-6 タンル単位を bo でつないだもの。 または gu'e klama gi prami のような構造。 5-2. タンル単位 tanru-unit <- tanru-unit-1 (CEI-clause free* tanru-unit-1)* cei による代入は複数つけられる。 tanru-unit-1 <- tanru-unit-2 linkargs? linkargs は be ... bei ... be'o の構造。 ; ** 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* タンル単位になれるものの一覧。 ブリブラそのもの、任意の RAhO のつく GOhA、ke でくくられたセルブリ。 そして、me (sumti / lerfu-string) やそれに moi 等がついたもの、 または (number / lerfu-string) MOI。 nu'a によってセルブリ化された演算子。 タンル単位に SE, JAI または NAhE をつけたもの。 または nu 節。 6. 付加引数 (be ... bei ... be'o) ;------------------------------------------------------------------- ;-- #06 linkargs ;; linkargs <- BE-clause free* term links? BEhO-clause? free* linkargs <- linkargs-sa* linkargs-1 sa については説明しない。 linkargs-1 <- BE-clause free* term links? BEhO-clause? free* 付加引数は be の後に項が来てその後に任意の bei ... bei ... が続き be'o で終わる。 linkargs-sa <- linkargs-start (!linkargs-start (sa-word / SA-clause !linkargs-start ) )* SA-clause &linkargs-1 sa については説明しない。 linkargs-start <- BE-clause sa については説明しない。 ;; links <- BEI-clause free* term links? links <- links-sa* links-1 sa については説明しない。 links-1 <- BEI-clause free* term links? bei term という構造のくりかえし、ここでは右結合となっている。 links-sa <- links-start (!links-start (sa-word / SA-clause !links-start ) )* SA-clause &links-1 links-start <- BEI-clause sa については説明しない。 7. 数式 ;------------------------------------------------------------------- ;-- #07 mex 7-1. 数式全体 quantifier と mex の二つがあり、前者は主にスムティの修飾に使われ、 後者は li によるスムティ化等に使われる。 quantifier <- number !MOI-clause BOI-clause? free* / VEI-clause free* mex VEhO-clause? free* MOI の続かない number に任意の BOI が続いたもの、 または vei と ve'o でくくられた mex がスムティを修飾できる。 ;;mex <- mex-1 (operator mex-1)* / rp-clause mex <- mex-sa* mex-0 sa については(以下略) mex-0 <- mex-1 (operator mex-1)* / rp-clause mex-0 は mex-1 を演算子でつないだもの(左結合)または、逆ポーランド記法の数式。 mex-sa <- mex-start (!mex-start (sa-word / SA-clause !mex-start) )* SA-clause &mex-0 mex-start <- FUhA-clause / PEhO-clause / operand-start sa については ... rp-clause <- FUhA-clause free* rp-expression 逆ポーランド記法の数式には fu'a をつける。 mex-1 <- mex-2 (BIhE-clause free* operator mex-1)? bi'e によって結合を強化された演算子。 x <- y (op x)? の形で右結合ということを示している。 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+ 任意の pe'o のついた演算子に複数の数式(mex-2)が続いたもの。 任意の ku'e で終わる。 前置式で書かれた数式のなかには(明示的なかっこが無い限り)中置式の数式は 入らないということが 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 ... (2) ; AKA (almost; this one allows a single operand; above does not. ;rp-expression <- rp-expression rp-expression operator / operand ... (1) ; Right recursive version. rp-expression <- operand rp-expression-tail rp-expression-tail <- rp-expression operator rp-expression-tail / () ... (3) 逆ポーランド記法。 左再帰から右再帰に変換したためわかりにくくなっている。 (1) -> (2) -> (3) と見ていくとわかりやすい。 まずは、(1) は {(式) とは (式) (式) (演算子) または (被演算子)} という形。 つまり、1 2 + や (1 2 +) 2 * のような形(括弧は見やすさのためにつけた)。 (2) は (1) で被演算子のみを (式) としないための変形。 (3) は (1) を右再帰の形にしたもの。 (本来は (2) を右再帰の形にするべき?) 7-2. 演算子 ;; operator <- operator-1 (joik-jek operator-1 / joik stag? KE-clause free* operator KEhE-clause? free*)* operator <- operator-sa* operator-0 また、sa だ。 sa のためにどんだけの行を費さなければならんのだ! 以下試論。 ---> 新文法では sa は廃止にしよう。しかし代替案は? ---> lo'ai ... sa'ai ... le'ai は PEG では扱えない。 ---> PEG 文法内で変数が使えればできる(papillon では可能かも)。 ---> もともと、打ち消しは字句解析が得意とする部分。 ---> 字句解析と構文解析とを分ければ解決するが、 ---> そうすると PEG の良さが半減してしまう。 ---> si, sa, su, ba'e, ui 等はもともと字句解析に向いた文法要素。 ---> (sa には微妙な所があるが) ---> もともと yacc が使われていた(つまり字句解析が別だった)ため、 ---> よく合っていた。 ---> PEG に移行するにあたって、大幅な文法構造の改善が必要なのかも。 ---> 一次元的な構造と樹構造とが混在する構造と言える。 ---> UI は単に並列な並びだし、fu'e ... fu'o を見るとよくわかる。 ---> ここらへんは yacc の字句解析 -> 構文解析 というやりかたの影響があるかも。 ---> 例えば、fu'e ... fu'o が文法構造を踏み越える必要があるかどうか。 ---> 樹構造に統一することで表現力の低下はあるだろうか。 ---> それが無ければ樹構造に統一するべきだろう。 ---> たとえば、sa を文法的に完成した構造だけを消去するようにすれば、 ---> 構文解析の邪魔にはなりにくいかもしれない。 ---> ただし、そうすると「まちがった」言葉を取り消すという sa の ---> 存在意義が薄れる。 ---> si, sa, su を簡単に適用するには字句解析が必要 -> ---> PEG でも字句解析をする -> 字句解析がダブる -> 美しくない operator-0 <- operator-1 ( joik-jek operator-1 / joik stag? KE-clause free* operator KEhE-clause? free*)* 演算子の論理-非論理接続。 joik のあとの、ke, ke'e でくくられた演算子の前にタグを置くことができる。 jek のあとにその構造を許さない理由は不明。 operator-sa <- operator-start (!operator-start (sa-word / SA-clause !operator-start) )* SA-clause &operator-0 sa については ... operator-start <- guhek / KE-clause / SE-clause? NAhE-clause / SE-clause? MAhO-clause / SE-clause? VUhU-clause sa については ... operator-1 <- operator-2 / guhek operator-1 gik operator-2 / operator-2 (jek / joik) stag? BO-clause free* operator-1 operator-2 またはそれを論理-非論理接続したもの。 ge ... gi ... という構造と bo による結合力強化版。 operator-2 <- mex-operator / KE-clause free* operator KEhE-clause? free* operator-2 は以下で列挙されるものまたは ke, ke'e でくくられた operator。 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* 単一の(つまり接続詞で接続されていない)演算子を列挙。 複数の SE, NAhE をつけることができることも示される。 本質的には、ma'o + mex、na'u + selbri または VUhU が演算子となる。 7-3. 被演算子 ;; operand <- operand-1 (joik-ek stag? KE-clause free* operand KEhE-clause? free*)? operand <- operand-sa* operand-0 sa については ... operand-0 <- operand-1 (joik-ek stag? KE-clause free* operand KEhE-clause? free*)? 被演算子はタグを前置した ke を取る joik-ek で接続することができる。 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 sa については ... operand-1 <- operand-2 (joik-ek operand-2)* 被演算子の接続(ノーマル)。 operand-2 <- operand-3 (joik-ek stag? BO-clause free* operand-2)? 被演算子の接続(bo による結合力の強化)。 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* 被演算子となりうるものの列挙。 quantifier そのもの(number または vei mex ve'o)。 レルフ列。ni'e + selbri、mo'e + sumti、jo'i + 複数の数式。 ge ... gi ... により接続された operand。 LAhE や NAhE BO をつけた operand。 number <- PA-clause (PA-clause / lerfu-word)* PA のあとに PA またはレルフが続いたものが number。 lerfu-string <- lerfu-word (PA-clause / lerfu-word)* lerfu-word のあとに PA が続いたものが lerfu-string。 ; ** BU clauses are part of BY-clause lerfu-word <- BY-clause / LAU-clause lerfu-word / TEI-clause lerfu-string FOI-clause lerf-word は BY-clause (by. や .abu 等) そのものか、 LAU + レルフまたは、TEI + lerfu-string + FOI。 8. 接続句 ;------------------------------------------------------------------- ;-- #08 ek gihek jek joik gek guhek gik ek <- NA-clause? SE-clause? A-clause NAI-clause? A にオプショナルな NA, SE, NAI がついたもの ;; gihek <- NA-clause? SE-clause? GIhA-clause NAI-clause? gihek <- gihek-sa* gihek-1 sa については ... gihek-1 <- NA-clause? SE-clause? GIhA-clause NAI-clause? GIhA にオプショナルな NA, SE, NAI がついたもの gihek-sa <- gihek-1 (!gihek-1 (sa-word / SA-clause !gihek-1 ) )* SA-clause &gihek sa については ... jek <- NA-clause? SE-clause? JA-clause NAI-clause? JA に(同上) joik <- SE-clause? JOI-clause NAI-clause? / interval / GAhO-clause interval GAhO-clause interval <- SE-clause? BIhI-clause NAI-clause? jiok は JOI にオプショナルな SE や NAI がついたもの、 または、区間を表す BIhI の同じような構造にオプショナルな GAhO がついたもの ;; joik-ek <- joik free* / ek free* joik-ek <- joik-ek-sa* joik-ek-1 sa については ... joik-ek-1 <- (joik free* / ek free*) joik または ek joik-ek-sa <- joik-ek-1 (!joik-ek-1 (sa-word / SA-clause !joik-ek-1 ) )* SA-clause &joik-ek sa については ... joik-jek <- joik free* / jek free* joik または jek gek <- SE-clause? GA-clause NAI-clause? free* / joik GI-clause free* / stag gik GA にオプショナルな SE, NAI がついたもの、または joik gi や tag gi という構造 guhek <- SE-clause? GUhA-clause NAI-clause? free* GUhA にオピショナルな SE, NAI がついたもの。 gik <- GI-clause NAI-clause? free* gi にオプショナルな NAI がついたもの 9. 時制、法制タグ ;------------------------------------------------------------------- ;-- #09 tense and modal tag tag <- tense-modal (joik-jek tense-modal)* タグは joik-jek でつなぐことができる ;stag <- simple-tense-modal ((jek / joik) simple-tense-modal)* stag <- simple-tense-modal ((jek / joik) simple-tense-modal)* / tense-modal (joik-jek tense-modal)* tag と stag を分けている理由は不明 tense-modal <- simple-tense-modal free* / FIhO-clause free* selbri FEhU-clause? free* 単純なタグと fi'o selbri がタグである 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 単純なタグは BAI にオプショナルな NAhE, SE, NAI, KI のついたもの、 または、時や場所と CAhA のどちらかまたは両方に NAhE, KI のついたもの、 KI そのもの、または CUhE である 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+ これは本当は単純だが形式的に書くために複雑になっている。 ZI-clause, time-offset, ZEhA-clause (PU-clause NAI-clause?)?, interval-property の四者がすくなくともどれかひとつは存在する必要があるということ time-offset <- PU-clause NAI-clause? ZI-clause? PU のあとにオプショナルな NAI や ZI がくる 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 これも同上。 VA-clause, space-offset, space-interval, MOhI-clause space-offset の四者のすくなくともどれかひとつは存在する必要があるということ space-offset <- FAhA-clause NAI-clause? VA-clause? FAhA にオプショナルな NAI や VA がついたもの 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 これも同上。 VEhA / VIhA / VEhA VIhA または space-int-props のどちらかが必ず存在する。 前者の後ろにはオプショナルな (オプショナルな NAI もつく) FAhA がつく space-int-props <- (FEhE-clause interval-property)+ FEhE がついた interval-property interval-property <- number ROI-clause NAI-clause? / TAhE-clause NAI-clause? / ZAhO-clause NAI-clause? 数 ROI (NAI)、TAhE (NAI)、ZAhO (NAI) 10. 自由修飾句 ;------------------------------------------------------------------- ;-- #0a free 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 sei、soi による挿入、vocative + selbri、vocative + cmene、vocative + sumti、 (数, 文字列) + MAI、to による挿入、xi による添字付け。 xi-clause <- XI-clause free* (number / lerfu-string) BOI-clause? / XI-clause free* VEI-clause free* mex VEhO-clause? xi + (数, 文字列) または xi + mex vocative <- (COI-clause NAI-clause?)+ DOI-clause / (COI-clause NAI-clause?) (COI-clause NAI-clause?)* / DOI-clause vocative はひとつ以上の COI または、ひとつの DOI またはその両方 indicators <- FUhE-clause? indicator+ 任意の fu'e のあとに下で定義する indicator がひとつ以上続いたもの indicator <- ((UI-clause / CAI-clause) NAI-clause? / DAhO-clause / FUhO-clause) !BU-clause UI, CAI に任意の NAI が続いたもの、DAhO、または FUhO が続いたもの。 BU が続いた場合は indicator とはならない。 11. マジックワード (zei による複合単語や bu による文字を表す単語) ;------------------------------------------------------------------- ;-- #0b Magic words zei-clause <- pre-clause zei-clause-no-pre pre-clause とは BAhE。 つまり、BAhE のついたもの zei-clause-no-pre <- pre-zei-bu (zei-tail? bu-tail)* zei-tail post-clause sa がある場合のルール。 zei-clause-no-SA <- pre-zei-bu-no-SA (zei-tail? bu-tail)* zei-tail こっちは sa が無かった場合には「簡単に書けますよ」という例だと思う。 こっちを説明する。 pre-zei-bu-no-SA はいわば「普通の語」。 (zei-tail? bu-tail) の部分は zei zo'e zei zo'e bu という形。 途中に bu が来ても最終的に zei zo'e となれば全体としては zei による構造であるということを示す。 bu-clause <- pre-clause bu-clause-no-pre BAhE のついたもの 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 同上 (bu-tail? zei-tail) の部分は bu zei zo'e zei zo'e という構造。 途中に zei が来ても最終的に bu が来れば全体としては bu による構造であることを示す。 zei-tail <- (ZEI-clause any-word)+ ひとつ以上の (zei + 語) bu-tail <- BU-clause+ 複数の bu 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? sa がある場合のバージョン。 説明は下の sa 無しバージョンで。 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? lo'u, zo, zoi はそれぞれ独自の、一語として数えられる構文を構成するので、 特別扱いが必要。 それ以外のものはほとんどのものがそのまま一語として pre-zei-bu となれる。 si-clause は複数の(語, si)のペア。 zei, bu, fa'o, si, sa, su は zei や bu の対象にはなれない。 dot-star <- .* fa'o の後には何が来ても無視するというルールのための定義 12. BAhE や UI 等の単語の前後にくっつけるもの ;------------------------------------------------------------------- ;-- #0c 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* 単語の後ろには空白、si による打ち消し、が来て複数の指標が来る。 pre-clause <- BAhE-clause? 単語の前には BAhE が来る。 ;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 sa については省略 13. 空白として扱われる構造 ;------------------------------------------------------------------- ;-- #0d Handling of spaces and things like spaces. ; --- SPACE --- ; Do *NOT* delete the line above! ; SU clauses su-clause <- (erasable-clause / su-word)* SU-clause su による打ち消し ; Handling of SI and interactions with zo and lo'u...le'u si-clause <- ((erasable-clause / si-word / SA-clause) si-clause? SI-clause)+ si による打ち消し erasable-clause <- bu-clause-no-pre !ZEI-clause !BU-clause / zei-clause-no-pre !ZEI-clause !BU-clause BU や ZEI によって作られる構造は一語として打ち消される。 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 14. セルマホ ここでは、それぞれのセルマホに属する単語の前後に BAhE や UI を つけたものを扱う。 本来字句解析で扱うべきものなのかもしれない。 それをむりやり構文解析で扱っているため文法が肥大している。 ここは説明を省略する。 ;------------------------------------------------------------------- ;-- #0e SELMAHO 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 15. 単語の形態に関するもの yacc では扱わなかった字句解析に含まれる部分 cmene は子音で終わる、とか brivla は二重子音を含むとか そういう話 #11 の cmene から見ていく この部分は良くできていて、space で区切った文も、 space 無しで強勢で表現したものもちゃんと parse できる。 しかし、かなり複雑で、僕自身が何となく理解したという程度 であり、あまり整理できていないが、参考までに説明する。 ;------------------------------------------------------------------- ;--- MORPHOLOGY --- ;------------------------------------------------------------------- ;-- #0f CMENE BRIVLA CMAVO 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)) ;------------------------------------------------------------------- ;-- #10 words words <- pause? (word pause?)* word <- lojban-word / non-lojban-word lojban-word <- cmene / cmavo / brivla ;------------------------------------------------------------------- ;-- #11 cmene 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 ;------------------------------------------------------------------- ;-- #12 cmavo 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 onset は音節のはじまり。 nucleus は音節の核、つまり母音または l, r, m, n。 ;------------------------------------------------------------------- ;-- #13 brivla brivla <- !cmavo initial-rafsi* brivla-core brivla-core に initial-rafsi を 0 を含む任意の数つけたもの brivla-core <- fuhivla / gismu / CVV-final-rafsi / stressed-initial-rafsi short-final-rafsi brivla-core は fuhivla または gismu に ... 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 いろいろなラフシの強勢のない版 ;------------------------------------------------------------------- ;-- #14 fuhivla any-extended-rafsi <- fuhivla / extended-rafsi / stressed-extended-rafsi fuhivla または extended-rafsi または その強勢版。 fuhivla <- fuhivla-head stressed-syllable consonantal-syllable* final-syllable fuhivla-head に強勢のある音節が続き、オプショナルな子音による音節が続き、 終わりの音節が続くもの stressed-extended-rafsi <- stressed-brivla-rafsi / stressed-fuhivla-rafsi 下の強勢版 extended-rafsi <- brivla-rafsi / fuhivla-rafsi brivla-rafsi または fuhivla-rafsi stressed-brivla-rafsi <- &unstressed-syllable brivla-head stressed-syllable h y brivla-head に強勢のある音節が続いたもの brivla-rafsi <- &(syllable consonantal-syllable* syllable) brivla-head h y h? brivla-head に h y のついたもの stressed-fuhivla-rafsi <- fuhivla-head stressed-syllable &consonant onset y fuhivla-head に強勢のある音節が続き子音ではじまる音節に y がついたもの fuhivla-rafsi <- &unstressed-syllable fuhivla-head &consonant onset y h? fuhivla-head に子音ではじまる音節のはじまりに y がついたもの fuhivla-head <- !rafsi-string brivla-head ラフシのつながりではない brivla-head brivla-head <- !cmavo !slinkuhi !h &onset unstressed-syllable* slinku'i テストを通る強勢のない音節の連続。 また onset の条件も満たす必要がある。 slinkuhi <- consonant rafsi-string slinku'i テストで無効な fu'ivla をチェックする。 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) y-less-rafsi の後にいろいろな rafsi が続いたもの。 ;------------------------------------------------------------------- ;-- #15 gismu gismu <- stressed-long-rafsi &final-syllable vowel &post-word 強勢のある四文字ラフシに音節の終わりである母音がついたものが gismu CVV-final-rafsi <- consonant stressed-vowel h &final-syllable vowel &post-word 単語の最後の音節である母音の前に、子音 - 強勢のある母音 - h がついたもの。 つまり、CV'V の形。 short-final-rafsi <- &final-syllable (consonant diphthong / initial-pair vowel) &post-word 単語の最後の音節であり CVV または CCV の形のラフシ 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 つきのラフシ y-less-rafsi <- !y-rafsi (CVC-rafsi !y / CCV-rafsi / CVV-rafsi) !any-extended-rafsi y なしのラフシ 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 子音の前の r または r の前の n ;------------------------------------------------------------------- ;-- #16 syllable 音節 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 pause の前にひとつ音節が来てその前に y や子音が来ている。 stress という名前は、その前の音節に強勢が来ることを示す。 stressed <- onset comma* [AEIOU] 大文字は強勢 any-syllable <- onset nucleus coda? / consonantal-syllable 母音または l, m, n, r によって作られる音節 syllable <- onset !y nucleus coda? 母音による音節 consonantal-syllable <- consonant syllabic &(consonantal-syllable / onset) (consonant &spaces)? 母音の代わりに l, m, n, r が来る音節。 coda <- !any-syllable consonant &any-syllable / syllabic? consonant? &pause それ自体は後の音と音節を構成しない、音節が後に続く子音。 または子音の後に pause が来るもの。 つまり、音節の最後に来る子音ということ。 onset <- h / consonant? glide / initial h、オプショナルな子音 + 半母音、または、単語の頭に来られる子音 nucleus <- vowel / diphthong / y !nucleus 音節の核(母音または二重母音) ;----------------------------------------------------------------- ;-- #17 vowel 母音 glide <- (i / u) &nucleus !glide 半母音(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] ;------------------------------------------------------------------- ;-- #18 consonant 子音 cluster <- consonant consonant+ 多重子音。 initial-pair <- &initial consonant consonant !consonant 下の条件を満たす二重子音。 initial <- (affricate / sibilant? other? liquid?) !consonant !glide 単語の頭に来られる子音の条件。 破擦音、またはオプショナルな歯擦音、その他、流音がこの順に来る。 その音には子音は続かない。 また半母音(ia, ii, iu, ie, io や ua, uo)も来ない。 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 子音の分類1 consonant <- voiced / unvoiced / syllabic syllabic <- l / m / n / r voiced <- b / d / g / j / v / z unvoiced <- c / f / k / p / s / t / x 子音の分類2 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 それぞれの文字(または発音)の定義、後に来られないものも定義 ;------------------------------------------------------------------- ;-- #19 other chars digit <- comma* [0123456789] !h !nucleus 数字の定義 post-word <- pause / !nucleus lojban-word pause または nucleus ではない lojban-word が語の後に来る。 pause <- comma* space-char / EOF オプショナルな複数のコンマに空白文字が続いたものが pause 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 <- ' ' 空白文字の定義 ;------------------------------------------------------------------- ; #1a Spaces, LUJVO spaces <- !Y initial-spaces .y 以外の空白 initial-spaces <- (comma* space-char / !ybu Y)+ EOF? / EOF コンマと空白文字、.y や入力の終わりが空白 ybu <- Y space-char* BU ybu は特別に定義しておかないと .y が空白として扱われてしまう。 lujvo <- !gismu !fuhivla brivla lujvo は gismu でも fuhivla でもない brivla 以下 CMAVO の列挙なので説明しない。 ;------------------------------------------------------------------- ; #1b CMAVO 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