Skip to content

Commit

Permalink
Always have ΣP around TP
Browse files Browse the repository at this point in the history
  • Loading branch information
lynn committed May 3, 2024
1 parent 6d81c01 commit ae1a710
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 51 deletions.
49 changes: 26 additions & 23 deletions src/grammar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const grammar: Grammar = {
{"name": "CPrel", "symbols": ["Crel", "Clause_sub"], "postprocess": makeBranch('CPrel')},
{"name": "CPrelna_main", "symbols": ["Clause_main"], "postprocess": makeBranchCovertLeft('CPrel', 'Crel')},
{"name": "CPrelna_sub", "symbols": ["Clause_sub"], "postprocess": makeBranchCovertLeft('CPrel', 'Crel')},
{"name": "CPdet", "symbols": ["MTPdet"], "postprocess": makeBranchCovertLeft('CPrel', 'Crel')},
{"name": "CPdet", "symbols": ["MSPdet"], "postprocess": makeBranchCovertLeft('CPrel', 'Crel')},
{"name": "DP$ebnf$1", "symbols": []},
{"name": "DP$ebnf$1", "symbols": ["DP$ebnf$1", "Free"], "postprocess": (d) => d[0].concat([d[1]])},
{"name": "DP", "symbols": [(lexer.has("pronoun") ? {type: "pronoun"} : pronoun), "DP$ebnf$1"], "postprocess": makeLeaf('DP')},
Expand All @@ -137,38 +137,38 @@ const grammar: Grammar = {
{"name": "nP", "symbols": ["CPdet"], "postprocess": makeBranchCovertLeft('𝘯P', '𝘯')},
{"name": "Clause_main", "symbols": ["Argument", "Bi", "Clause_main"], "postprocess": make3L('TopicP', "Topic'")},
{"name": "Clause_sub", "symbols": ["Argument", "Bi", "Clause_sub"], "postprocess": make3L('TopicP', "Topic'")},
{"name": "Clause_main", "symbols": ["MTP_main"], "postprocess": id},
{"name": "Clause_sub", "symbols": ["MTP_sub"], "postprocess": id},
{"name": "Clause_main", "symbols": ["MSP_main"], "postprocess": id},
{"name": "Clause_sub", "symbols": ["MSP_sub"], "postprocess": id},
{"name": "Clause_main", "symbols": ["Argument", "Na", "CPrelna_main"], "postprocess": make3L('𝘷P', "𝘷'")},
{"name": "Clause_sub", "symbols": ["Argument", "Na", "CPrelna_sub"], "postprocess": make3L('𝘷P', "𝘷'")},
{"name": "Clause_main", "symbols": ["AdjunctPcon", "Na", "CPrelna_main"], "postprocess": make3L('𝘷P', "𝘷'")},
{"name": "Clause_sub", "symbols": ["AdjunctPcon", "Na", "CPrelna_sub"], "postprocess": make3L('𝘷P', "𝘷'")},
{"name": "Clause_main", "symbols": ["ModalP", "Na", "MTP_main"], "postprocess": make3L('𝘷P', "𝘷'")},
{"name": "Clause_sub", "symbols": ["ModalP", "Na", "MTP_sub"], "postprocess": make3L('𝘷P', "𝘷'")},
{"name": "Clause_main", "symbols": ["ModalP", "Na", "MSP_main"], "postprocess": make3L('𝘷P', "𝘷'")},
{"name": "Clause_sub", "symbols": ["ModalP", "Na", "MSP_sub"], "postprocess": make3L('𝘷P', "𝘷'")},
{"name": "ModalP", "symbols": ["ModalT4", "CPsub"], "postprocess": makeBranch('ModalP')},
{"name": "Clause_main", "symbols": ["MTP_main", "Go", "Clause_main"], "postprocess": makeRetroactiveCleft},
{"name": "Clause_sub", "symbols": ["MTP_main", "Go", "Clause_sub"], "postprocess": makeRetroactiveCleft},
{"name": "MTP_main", "symbols": ["TPcon_main"], "postprocess": id},
{"name": "MTP_sub", "symbols": ["TPcon_sub"], "postprocess": id},
{"name": "MTP_main", "symbols": ["Modal", "TPcon_main"], "postprocess": makeT1ModalvP},
{"name": "MTP_sub", "symbols": ["Modal", "TPcon_sub"], "postprocess": makeT1ModalvP},
{"name": "MTP_main", "symbols": ["Sigma", "Modal", "TPcon_main"], "postprocess": makeSigmaT1ModalvP},
{"name": "MTP_sub", "symbols": ["Sigma", "Modal", "TPcon_sub"], "postprocess": makeSigmaT1ModalvP},
{"name": "MTPdet", "symbols": ["TPdet"], "postprocess": id},
{"name": "MTPdet", "symbols": ["Modal", "TPdet"], "postprocess": makeT1ModalvP},
{"name": "MTPdet", "symbols": ["Sigma", "Modal", "TPdet"], "postprocess": makeSigmaT1ModalvP},
{"name": "TPcon_main", "symbols": ["TP_main"], "postprocess": id},
{"name": "TPcon_sub", "symbols": ["TP_sub"], "postprocess": id},
{"name": "TPcon_main", "symbols": ["TP_main", "Conjunction", "TPcon_main"], "postprocess": makeConn},
{"name": "TPcon_sub", "symbols": ["TP_sub", "Conjunction", "TPcon_sub"], "postprocess": makeConn},
{"name": "Clause_main", "symbols": ["MSP_main", "Go", "Clause_main"], "postprocess": makeRetroactiveCleft},
{"name": "Clause_sub", "symbols": ["MSP_main", "Go", "Clause_sub"], "postprocess": makeRetroactiveCleft},
{"name": "MSP_main", "symbols": ["SigmaPcon_main"], "postprocess": id},
{"name": "MSP_sub", "symbols": ["SigmaPcon_sub"], "postprocess": id},
{"name": "MSP_main", "symbols": ["Modal", "SigmaPcon_main"], "postprocess": makeT1ModalvP},
{"name": "MSP_sub", "symbols": ["Modal", "SigmaPcon_sub"], "postprocess": makeT1ModalvP},
{"name": "MSP_main", "symbols": ["Sigma", "Modal", "SigmaPcon_main"], "postprocess": makeSigmaT1ModalvP},
{"name": "MSP_sub", "symbols": ["Sigma", "Modal", "SigmaPcon_sub"], "postprocess": makeSigmaT1ModalvP},
{"name": "MSPdet", "symbols": ["SigmaPdet"], "postprocess": id},
{"name": "MSPdet", "symbols": ["Modal", "SigmaPdet"], "postprocess": makeT1ModalvP},
{"name": "MSPdet", "symbols": ["Sigma", "Modal", "SigmaPdet"], "postprocess": makeSigmaT1ModalvP},
{"name": "SigmaPcon_main", "symbols": ["SigmaP_main"], "postprocess": id},
{"name": "SigmaPcon_sub", "symbols": ["SigmaP_sub"], "postprocess": id},
{"name": "SigmaPcon_main", "symbols": ["SigmaP_main", "Conjunction", "SigmaPcon_main"], "postprocess": makeConn},
{"name": "SigmaPcon_sub", "symbols": ["SigmaP_sub", "Conjunction", "SigmaPcon_sub"], "postprocess": makeConn},
{"name": "SigmaP_main", "symbols": ["Sigmacon", "TP_main"], "postprocess": makeBranch('ΣP')},
{"name": "SigmaP_sub", "symbols": ["Sigmacon", "TP_sub"], "postprocess": makeBranch('ΣP')},
{"name": "SigmaPdet", "symbols": ["Sigmacon", "TPdet"], "postprocess": makeBranch('ΣP')},
{"name": "TP_main", "symbols": ["Tcon", "AspP_main"], "postprocess": makeBranch('TP')},
{"name": "TP_sub", "symbols": ["Tcon", "AspP_sub"], "postprocess": makeBranch('TP')},
{"name": "TP_main", "symbols": ["Sigma", "Tcon", "AspP_main"], "postprocess": make3L('ΣP', 'TP')},
{"name": "TP_sub", "symbols": ["Sigma", "Tcon", "AspP_sub"], "postprocess": make3L('ΣP', 'TP')},
{"name": "TP_main", "symbols": ["EvA", "vP_sub", "DPcon"], "postprocess": makeEvAP},
{"name": "TP_sub", "symbols": ["EvA", "vP_sub", "DPcon"], "postprocess": makeEvAP},
{"name": "TPdet", "symbols": ["Tcon", "AspPdet"], "postprocess": makeBranch('TP')},
{"name": "TPdet", "symbols": ["Sigma", "Tcon", "AspPdet"], "postprocess": make3L('ΣP', 'TP')},
{"name": "TPdet", "symbols": ["EvA", "vP_sub"], "postprocess": makeEvAPdet},
{"name": "AspP_main", "symbols": ["Aspcon", "vP_main"], "postprocess": makeBranch('AspP')},
{"name": "AspP_sub", "symbols": ["Aspcon", "vP_sub"], "postprocess": makeBranch('AspP')},
Expand Down Expand Up @@ -227,6 +227,9 @@ const grammar: Grammar = {
{"name": "CParg", "symbols": ["CPsub"], "postprocess": makeBranchCovertLeft('DP', 'D')},
{"name": "CPrelcon", "symbols": ["CPrel"], "postprocess": id},
{"name": "CPrelcon", "symbols": ["CPrel", "Conjunction", "CPrelcon"], "postprocess": makeConn},
{"name": "Sigmacon", "symbols": [], "postprocess": makeCovertLeaf('Σ')},
{"name": "Sigmacon", "symbols": ["Sigma"], "postprocess": id},
{"name": "Sigmacon", "symbols": ["Sigma", "Conjunction", "Sigmacon"], "postprocess": makeConn},
{"name": "Tcon", "symbols": [], "postprocess": makeCovertLeaf('T')},
{"name": "Tcon", "symbols": ["T"], "postprocess": id},
{"name": "Tcon", "symbols": ["T_prefix"], "postprocess": id},
Expand Down
10 changes: 5 additions & 5 deletions src/semantics/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,10 @@ export const tenses: Record<string, Expr> = {
};

export const polarities: Record<string, Expr> = {
// λ𝘗. ¬𝘗(𝘸)
bu: λ(['s', 't'], ['s'], c => not(app(v(0, c), v(1, c)))),
// λ𝘗. †𝘗(𝘸)
jeo: λ(['s', 't'], ['s'], c => indeed(app(v(0, c), v(1, c)))),
// λ𝘗. ¬𝘗
bu: λ('t', [], c => not(v(0, c))),
// λ𝘗. †𝘗
jeo: λ('t', [], c => indeed(v(0, c))),
};

export const speechActs: Record<string, Expr> = {
Expand Down Expand Up @@ -552,7 +552,7 @@ const conjunctionWords: Record<string, (left: Expr, right: Expr) => Expr> = {
const conjunctTypes: Partial<Record<Label, ExprType>> = {
AdjunctP: ['v', 't'],
CPrel: ['e', 't'],
TP: 't',
ΣP: 't',
};

export const clausalConjunctions: Partial<Record<Label, Record<string, Expr>>> =
Expand Down
14 changes: 8 additions & 6 deletions src/semantics/denote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,15 @@ function denoteLeaf(leaf: Leaf, cCommand: StrictTree | null): DTree {
if (denotation === undefined) throw new Unrecognized(`T: ${toaq}`);
}
} else if (leaf.label === 'Σ') {
if (leaf.word.covert) throw new Impossible('Covert Σ');
if (leaf.word.entry === undefined)
if (leaf.word.covert) {
denotation = null;
} else if (leaf.word.entry === undefined) {
throw new Unrecognized(`Σ: ${leaf.word.text}`);

const toaq = leaf.word.entry.toaq.replace(/-$/, '');
denotation = polarities[toaq];
if (denotation === undefined) throw new Unrecognized(`Σ: ${toaq}`);
} else {
const toaq = leaf.word.entry.toaq.replace(/-$/, '');
denotation = polarities[toaq];
if (denotation === undefined) throw new Unrecognized(`Σ: ${toaq}`);
}
} else if (leaf.label === 'SA') {
let toaq: string;
if (leaf.word.covert) {
Expand Down
2 changes: 1 addition & 1 deletion src/semantics/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ const latex: Format = {
},
infix: (symbol, left, right) => `${left} ${symbol} ${right}`,
polarizerSymbols: {
not: '\\not',
not: '\\neg',
indeed: '\\dagger',
},
polarizer: (symbol, body) => `${symbol} ${body}`,
Expand Down
39 changes: 23 additions & 16 deletions src/toaq.kuna.ne
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ CPrel -> Crel Clause<sub> {% makeBranch('CPrel') %}
# (nä) hao
CPrelna<S> -> Clause<S> {% makeBranchCovertLeft('CPrel', 'Crel') %}
# (sá) ∅ hao
CPdet -> MTPdet {% makeBranchCovertLeft('CPrel', 'Crel') %}
CPdet -> MSPdet {% makeBranchCovertLeft('CPrel', 'Crel') %}

# jí
DP -> %pronoun Free:* {% makeLeaf('DP') %}
Expand All @@ -101,40 +101,44 @@ nP -> CPdet {% makeBranchCovertLeft('𝘯P', '𝘯') %}
# ní bï pu hao
Clause<S> -> Argument Bi Clause<S> {% make3L('TopicP', "Topic'") %}
# pu hao
Clause<S> -> MTP<S> {% id %}
Clause<S> -> MSP<S> {% id %}
# jí nä pu hao hóa
Clause<S> -> Argument Na CPrelna<S> {% make3L('𝘷P', "𝘷'") %}
# râo fíachaq nä pu hao hóa
Clause<S> -> AdjunctPcon Na CPrelna<S> {% make3L('𝘷P', "𝘷'") %}
# shê ꝡä hao nä jıa hao
Clause<S> -> ModalP Na MTP<S> {% make3L('𝘷P', "𝘷'") %}
Clause<S> -> ModalP Na MSP<S> {% make3L('𝘷P', "𝘷'") %}
ModalP -> ModalT4 CPsub {% makeBranch('ModalP') %}
# hao jí gö hao jí
Clause<S> -> MTP<main> Go Clause<S> {% makeRetroactiveCleft %}
Clause<S> -> MSP<main> Go Clause<S> {% makeRetroactiveCleft %}

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

# ao pu chum hao jí
MTP<S> -> TPcon<S> {% id %}
MTP<S> -> Modal TPcon<S> {% makeT1ModalvP %}
MTP<S> -> Sigma Modal TPcon<S> {% makeSigmaT1ModalvP %}
# ao jeo pu chum hao jí
MSP<S> -> SigmaPcon<S> {% id %}
MSP<S> -> Modal SigmaPcon<S> {% makeT1ModalvP %}
MSP<S> -> Sigma Modal SigmaPcon<S> {% makeSigmaT1ModalvP %}

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

# jeo pu chum hao jí
SigmaPcon<S> -> SigmaP<S> {% id %}
SigmaPcon<S> -> SigmaP<S> Conjunction SigmaPcon<S> {% makeConn %}
SigmaP<S> -> Sigmacon TP<S> {% makeBranch('ΣP') %}

# (sá) jeo pu chum hao
SigmaPdet -> Sigmacon TPdet {% makeBranch('ΣP') %}

# pu chum hao jí
TPcon<S> -> TP<S> {% id %}
TPcon<S> -> TP<S> Conjunction TPcon<S> {% makeConn %}
TP<S> -> Tcon AspP<S> {% makeBranch('TP') %}
TP<S> -> Sigma Tcon AspP<S> {% make3L('ΣP', 'TP') %}
# ë marao óguı ráı
TP<S> -> EvA vP<sub> DPcon {% makeEvAP %}

# (sá) pu chum hao
TPdet -> Tcon AspPdet {% makeBranch('TP') %}
TPdet -> Sigma Tcon AspPdet {% make3L('ΣP', 'TP') %}
# (sá) ë marao óguı
TPdet -> EvA vP<sub> {% makeEvAPdet %}

Expand Down Expand Up @@ -194,6 +198,9 @@ CPargfoc -> Focus CParg {% makeBranch('FocusP') %}
CParg -> CPsub {% makeBranchCovertLeft('DP', 'D') %}
CPrelcon -> CPrel {% id %}
CPrelcon -> CPrel Conjunction CPrelcon {% makeConn %}
Sigmacon -> null {% makeCovertLeaf('Σ') %}
Sigmacon -> Sigma {% id %}
Sigmacon -> Sigma Conjunction Sigmacon {% makeConn %}
Tcon -> null {% makeCovertLeaf('T') %}
Tcon -> T {% id %}
Tcon -> T_prefix {% id %}
Expand Down

0 comments on commit ae1a710

Please sign in to comment.