Skip to content

Commit

Permalink
Surface parse "ao hao jí"
Browse files Browse the repository at this point in the history
  • Loading branch information
lynn committed Aug 14, 2023
1 parent a563bb4 commit 262e3ed
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 6 deletions.
13 changes: 10 additions & 3 deletions src/grammar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ declare var event_accessor: any;
declare var focus_particle: any;
declare var interjection: any;
declare var name_verb: any;
declare var modality: any;
declare var modality_with_complement: any;
declare var cleft_verb: any;
declare var plural_coordinator: any;
Expand All @@ -47,6 +48,7 @@ const {
makeRose2,
makeSerial,
makeSingleChild,
makeT1ModalvP,
makeWord,
makevP,
makevPdet,
Expand Down Expand Up @@ -93,17 +95,21 @@ const grammar: Grammar = {
{"name": "CPincorp", "symbols": ["Cincorp", "Clause"], "postprocess": makeBranch('CP')},
{"name": "CPrel", "symbols": ["Crel", "Clause"], "postprocess": makeBranch('CPrel')},
{"name": "CPrelna", "symbols": ["Clause"], "postprocess": makeBranchCovertLeft('CPrel', 'Crel')},
{"name": "CPdet", "symbols": ["TPdet"], "postprocess": makeBranchCovertLeft('CPrel', 'Crel')},
{"name": "CPdet", "symbols": ["MTPdet"], "postprocess": makeBranchCovertLeft('CPrel', 'Crel')},
{"name": "DP", "symbols": [(lexer.has("pronoun") ? {type: "pronoun"} : pronoun)], "postprocess": makeLeaf('DP')},
{"name": "DP", "symbols": ["D", "nP"], "postprocess": makeBranch('DP')},
{"name": "DP", "symbols": ["Focus", "DP"], "postprocess": makeBranch('FocusP')},
{"name": "nP", "symbols": ["nP", "CPrel"], "postprocess": makeBranch('nP')},
{"name": "nP", "symbols": ["CPdet"], "postprocess": makeBranchFunctionalLeft('nP', 'n')},
{"name": "Clause", "symbols": ["TP"], "postprocess": id},
{"name": "Clause", "symbols": ["MTP"], "postprocess": id},
{"name": "Clause", "symbols": ["DP", "Bi", "Clause"], "postprocess": make3L('TopicP', "Topic'")},
{"name": "Clause", "symbols": ["DP", "Na", "CPrelna"], "postprocess": make3L('𝘷P', "𝘷'")},
{"name": "Clause", "symbols": ["ModalP", "Na", "TP"], "postprocess": make3L('𝘷P', "𝘷'")},
{"name": "Clause", "symbols": ["ModalP", "Na", "MTP"], "postprocess": make3L('𝘷P', "𝘷'")},
{"name": "ModalP", "symbols": ["ModalT4", "CPsub"], "postprocess": makeBranch('ModalP')},
{"name": "MTP", "symbols": ["TP"], "postprocess": id},
{"name": "MTP", "symbols": ["Modal", "TP"], "postprocess": makeT1ModalvP},
{"name": "MTPdet", "symbols": ["TPdet"], "postprocess": id},
{"name": "MTPdet", "symbols": ["Modal", "TPdet"], "postprocess": makeT1ModalvP},
{"name": "TP", "symbols": ["AspP"], "postprocess": makeBranchCovertLeft('TP', 'T')},
{"name": "TP", "symbols": ["T1", "AspP"], "postprocess": makeBranch('TP')},
{"name": "TP", "symbols": ["Sigma", "T1", "AspP"], "postprocess": make3L('ΣP', 'TP')},
Expand Down Expand Up @@ -186,6 +192,7 @@ const grammar: Grammar = {
{"name": "Focus", "symbols": [(lexer.has("focus_particle") ? {type: "focus_particle"} : focus_particle)], "postprocess": makeLeaf('Focus')},
{"name": "Interjection", "symbols": [(lexer.has("interjection") ? {type: "interjection"} : interjection)], "postprocess": makeLeaf('Interjection')},
{"name": "Mi", "symbols": [(lexer.has("name_verb") ? {type: "name_verb"} : name_verb)], "postprocess": makeLeaf('mı')},
{"name": "Modal", "symbols": [(lexer.has("modality") ? {type: "modality"} : modality)], "postprocess": makeLeaf('Modal')},
{"name": "ModalT4", "symbols": [(lexer.has("modality_with_complement") ? {type: "modality_with_complement"} : modality_with_complement)], "postprocess": makeLeaf('Modal')},
{"name": "Na", "symbols": [(lexer.has("cleft_verb") ? {type: "cleft_verb"} : cleft_verb)], "postprocess": makeLeaf('𝘷')},
{"name": "Roi", "symbols": [(lexer.has("plural_coordinator") ? {type: "plural_coordinator"} : plural_coordinator)], "postprocess": makeLeaf('&')},
Expand Down
18 changes: 15 additions & 3 deletions src/toaq.ne
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const {
makeRose2,
makeSerial,
makeSingleChild,
makeT1ModalvP,
makeWord,
makevP,
makevPdet,
Expand Down Expand Up @@ -45,7 +46,7 @@ CPrel -> Crel Clause {% makeBranch('CPrel') %}
# (nä) hao
CPrelna -> Clause {% makeBranchCovertLeft('CPrel', 'Crel') %}
# (sá) ∅ hao
CPdet -> TPdet {% makeBranchCovertLeft('CPrel', 'Crel') %}
CPdet -> MTPdet {% makeBranchCovertLeft('CPrel', 'Crel') %}

# jí
DP -> %pronoun {% makeLeaf('DP') %}
Expand All @@ -59,15 +60,25 @@ nP -> nP CPrel {% makeBranch('nP') %}
nP -> CPdet {% makeBranchFunctionalLeft('nP', 'n') %}

# pu hao
Clause -> TP {% id %}
Clause -> MTP {% id %}
# ní bï pu hao
Clause -> DP Bi Clause {% make3L('TopicP', "Topic'") %}
# jí nä pu hao hóa
Clause -> DP Na CPrelna {% make3L('𝘷P', "𝘷'") %}
# shê ꝡä hao nä jıa hao
Clause -> ModalP Na TP {% make3L('𝘷P', "𝘷'") %}
Clause -> ModalP Na MTP {% make3L('𝘷P', "𝘷'") %}
ModalP -> ModalT4 CPsub {% makeBranch('ModalP') %}

# "MTP" is a TP that can have a t1 modal in front.

# ao pu chum hao jí
MTP -> TP {% id %}
MTP -> Modal TP {% makeT1ModalvP %}

# (sá) ao hao
MTPdet -> TPdet {% id %}
MTPdet -> Modal TPdet {% makeT1ModalvP %}

# pu chum hao jí
TP -> AspP {% makeBranchCovertLeft('TP', 'T') %}
TP -> T1 AspP {% makeBranch('TP') %}
Expand Down Expand Up @@ -163,6 +174,7 @@ EvA -> %event_accessor {% makeLeaf('EvA') %}
Focus -> %focus_particle {% makeLeaf('Focus') %}
Interjection -> %interjection {% makeLeaf('Interjection') %}
Mi -> %name_verb {% makeLeaf('') %}
Modal -> %modality {% makeLeaf('Modal') %}
ModalT4 -> %modality_with_complement {% makeLeaf('Modal') %}
Na -> %cleft_verb {% makeLeaf('𝘷') %}
Roi -> %plural_coordinator {% makeLeaf('&') %}
Expand Down
26 changes: 26 additions & 0 deletions src/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,3 +314,29 @@ export function makeAdjunctPT(
right: { label: 'VP', left: serial, right: obj },
};
}

export function makeT1ModalvP(
[modal, tp]: [Tree, Tree],
location: number,
reject: Object,
) {
return {
label: '𝘷P',
left: {
label: 'ModalP',
left: modal,
right: {
label: 'CP',
word: 'covert',
},
},
right: {
label: "𝘷'",
left: {
label: '𝘷',
word: 'functional',
},
right: tp,
},
};
}

0 comments on commit 262e3ed

Please sign in to comment.