Get all words (surface forms) from a derivation, left to right
Equations
- CCG.Interpret.getWords (CCG.DerivStep.lex entry) = [entry.form]
- CCG.Interpret.getWords (d1.fapp d2) = CCG.Interpret.getWords d1 ++ CCG.Interpret.getWords d2
- CCG.Interpret.getWords (d1.bapp d2) = CCG.Interpret.getWords d1 ++ CCG.Interpret.getWords d2
- CCG.Interpret.getWords (d1.fcomp d2) = CCG.Interpret.getWords d1 ++ CCG.Interpret.getWords d2
- CCG.Interpret.getWords (d1.bcomp d2) = CCG.Interpret.getWords d1 ++ CCG.Interpret.getWords d2
- CCG.Interpret.getWords (d.ftr a) = CCG.Interpret.getWords d
- CCG.Interpret.getWords (d.btr a) = CCG.Interpret.getWords d
- CCG.Interpret.getWords (d1.coord d2) = CCG.Interpret.getWords d1 ++ ["and"] ++ CCG.Interpret.getWords d2
Instances For
Check if a word form is a scalar item and return its lexical entry
Equations
Instances For
Helper to find scalar items with positions
Equations
Instances For
Find all scalar items in a derivation with their positions
Equations
Instances For
def
CCG.Interpret.toDerivation
(d : DerivStep)
(ty : Semantics.Montague.Ty)
(meaning : Semantics.Montague.toyModel.interpTy ty)
:
Convert a CCG derivation to a Montague semantic derivation.
Note: For a full implementation, we'd need to compositionally compute the meaning from the derivation tree. For now, we provide the structure and a placeholder for the meaning (requiring it to be provided separately).
Equations
- CCG.Interpret.toDerivation d ty meaning = { surface := CCG.Interpret.getWords d, ty := ty, meaning := meaning, scalarItems := CCG.Interpret.findScalarItems d }
Instances For
CCG derivation for "John sleeps"
Equations
- CCG.Interpret.ccg_john_sleeps = (CCG.DerivStep.lex { form := "John", cat := CCG.NP }).bapp (CCG.DerivStep.lex { form := "sleeps", cat := CCG.IV })
Instances For
CCG derivation for "some student sleeps"
Equations
- One or more equations did not get rendered due to their size.
Instances For
Convert to semantic derivation with scalar item
Equations
- One or more equations did not get rendered due to their size.