Skip to content

Commit

Permalink
Surface parse ꝡä-bï, ꝡä-rú-ꝡä, and ꝡä fragments
Browse files Browse the repository at this point in the history
  • Loading branch information
lynn committed Aug 20, 2023
1 parent 95e9c28 commit 662bd11
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/grammar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const grammar: Grammar = {
Lexer: lexer,
ParserRules: [
{"name": "Fragment", "symbols": ["SAP"], "postprocess": id},
{"name": "Fragment", "symbols": ["DP"], "postprocess": id},
{"name": "Fragment", "symbols": ["term"], "postprocess": id},
{"name": "Fragment", "symbols": ["AdjunctP"], "postprocess": id},
{"name": "SAP", "symbols": ["Interjection", "SAP"], "postprocess": makeBranch('InterjectionP')},
{"name": "SAP", "symbols": ["CP", "SAopt"], "postprocess": makeBranch('SAP')},
Expand All @@ -105,7 +105,7 @@ const grammar: Grammar = {
{"name": "nP", "symbols": ["nP", "CPrel"], "postprocess": makeBranch('nP')},
{"name": "nP", "symbols": ["CPdet"], "postprocess": makeBranchFunctionalLeft('nP', 'n')},
{"name": "Clause", "symbols": ["MTP"], "postprocess": id},
{"name": "Clause", "symbols": ["DP", "Bi", "Clause"], "postprocess": make3L('TopicP', "Topic'")},
{"name": "Clause", "symbols": ["term", "Bi", "Clause"], "postprocess": make3L('TopicP', "Topic'")},
{"name": "Clause", "symbols": ["DP", "Na", "CPrelna"], "postprocess": make3L('𝘷P', "𝘷'")},
{"name": "Clause", "symbols": ["ModalP", "Na", "MTP"], "postprocess": make3L('𝘷P', "𝘷'")},
{"name": "ModalP", "symbols": ["ModalT4", "CPsub"], "postprocess": makeBranch('ModalP')},
Expand Down Expand Up @@ -153,10 +153,12 @@ const grammar: Grammar = {
{"name": "DPincorp", "symbols": ["Dincorp", "nP"], "postprocess": makeBranch('DP')},
{"name": "VPoiv", "symbols": ["Voiv", "DP"], "postprocess": makeBranch('VP')},
{"name": "term", "symbols": ["DP1"], "postprocess": id},
{"name": "term", "symbols": ["CPsub"], "postprocess": id},
{"name": "term", "symbols": ["CPsub1"], "postprocess": id},
{"name": "DP1", "symbols": ["DP"], "postprocess": id},
{"name": "DP1", "symbols": ["DP", "Conjunction", "DP1"], "postprocess": makeConn},
{"name": "DP1", "symbols": ["DP", "Roi", "DP1"], "postprocess": makeConn},
{"name": "CPsub1", "symbols": ["CPsub"], "postprocess": id},
{"name": "CPsub1", "symbols": ["CPsub", "Conjunction", "CPsub1"], "postprocess": makeConn},
{"name": "T1", "symbols": ["T"], "postprocess": id},
{"name": "T1", "symbols": ["T", "Conjunction", "T1"], "postprocess": makeConn},
{"name": "Asp1", "symbols": ["Asp"], "postprocess": id},
Expand Down
8 changes: 5 additions & 3 deletions src/toaq.ne
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const lexer = new ToaqTokenizer();
# Pass your lexer object using the @lexer option:
@lexer lexer

Fragment -> SAP {% id %} | DP {% id %} | AdjunctP {% id %}
Fragment -> SAP {% id %} | term {% id %} | AdjunctP {% id %}

# ua, ꝡa hao da
SAP -> Interjection SAP {% makeBranch('InterjectionP') %}
Expand Down Expand Up @@ -63,7 +63,7 @@ nP -> CPdet {% makeBranchFunctionalLeft('nP', 'n') %}
# pu hao
Clause -> MTP {% id %}
# ní bï pu hao
Clause -> DP Bi Clause {% make3L('TopicP', "Topic'") %}
Clause -> term Bi Clause {% make3L('TopicP', "Topic'") %}
# jí nä pu hao hóa
Clause -> DP Na CPrelna {% make3L('𝘷P', "𝘷'") %}
# shê ꝡä hao nä jıa hao
Expand Down Expand Up @@ -135,11 +135,13 @@ DPincorp -> Dincorp nP {% makeBranch('DP') %}
# po sá ...
VPoiv -> Voiv DP {% makeBranch('VP') %}

term -> DP1 {% id %} | CPsub {% id %}
term -> DP1 {% id %} | CPsub1 {% id %}

DP1 -> DP {% id %}
DP1 -> DP Conjunction DP1 {% makeConn %}
DP1 -> DP Roi DP1 {% makeConn %}
CPsub1 -> CPsub {% id %}
CPsub1 -> CPsub Conjunction CPsub1 {% makeConn %}
T1 -> T {% id %}
T1 -> T Conjunction T1 {% makeConn %}
Asp1 -> Asp {% id %}
Expand Down

0 comments on commit 662bd11

Please sign in to comment.