Skip to content

Commit

Permalink
Split denoteLittleV
Browse files Browse the repository at this point in the history
  • Loading branch information
lynn committed Sep 5, 2023
1 parent 6b67a27 commit 8769d44
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
19 changes: 12 additions & 7 deletions src/semantics/denote.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { VerbEntry } from '../dictionary';
import { Branch, Leaf, StrictTree, Word } from '../tree';
import { Branch, CovertValue, Leaf, StrictTree, Word } from '../tree';
import {
after,
afterNear,
Expand Down Expand Up @@ -351,12 +351,19 @@ const littleVAgent = λ('e', ['s'], c =>
// λ𝘗. 𝘗
const na = λ(['e', 't'], [], c => v(0, c));

function denoteLittleV(toaq: string | null): Expr | null {
switch (toaq) {
function denoteCovertLittleV(value: CovertValue): Expr | null {
switch (value) {
case 'CAUSE':
return littleVAgent;
case 'BE':
return null;
default:
throw new Error(`Unrecognized 𝘷: ${value}`);
}
}

function denoteOvertLittleV(toaq: string | null): Expr | null {
switch (toaq) {
case 'nä':
return na;
default:
Expand Down Expand Up @@ -517,15 +524,13 @@ function denoteLeaf(leaf: Leaf, cCommand: StrictTree | null): DTree {
covertResumptive: binding,
};
} else if (leaf.label === '𝘷') {
let toaq: string | null;
if (leaf.word.covert) {
toaq = leaf.word.value;
denotation = denoteCovertLittleV(leaf.word.value);
} else if (leaf.word.entry === undefined) {
throw new Error(`Unrecognized 𝘷: ${leaf.word.text}`);
} else {
toaq = leaf.word.entry.toaq;
denotation = denoteOvertLittleV(leaf.word.entry.toaq);
}
denotation = denoteLittleV(toaq);
} else if (leaf.label === 'Asp') {
let toaq: string;
if (leaf.word.covert) {
Expand Down
2 changes: 1 addition & 1 deletion src/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface Word {
entry: Entry | undefined;
}

type CovertValue = '∅' | 'BE' | 'CAUSE' | 'PRO';
export type CovertValue = '∅' | 'BE' | 'CAUSE' | 'PRO';

export interface CovertWord {
covert: true;
Expand Down

0 comments on commit 8769d44

Please sign in to comment.