Attention: Maintenance on monday 19.04.2021 from 07:00 - 13:00 (Gitlab and Mattermost are offline!)

Commit 9fcb5dd9 by jfschaefer

### even more gf sentences can be parsed

parent c09b7db9
 ... ... @@ -6,6 +6,7 @@ abstract MathLex = Cat ** { MathBinOp; -- binary operator MathUnOp; -- unary operator MathPrefixedAdj; -- like "_-dimensional" MathPrefixedNoun; -- like "_-tuple" fun cartesian_A : A ; ... ... @@ -16,18 +17,43 @@ abstract MathLex = Cat ** { prime_A : A ; even_A : A ; permutation_N : N; permutation_N : N ; character_N : N ; alphabet_N : N ; element_N : N ; integer_N : N ; product_N : N ; string_N : N ; space_N : N ; word_N : N ; sign_N : N ; set_N : N ; dimensional_MPA : MathPrefixedAdj; tuple_MPN : MathPrefixedNoun; three_PN : PN; divides_MathBinRel : MathBinRel; power_MathBinOp : MathBinOp; xtimes_MathBinOp : MathBinOp; in_MathBinOp : MathBinOp; neg_MathUnOp : MathUnOp; lessThan_MathBinRel : MathBinRel; equals_MathBinRel : MathBinRel; i_MathExpr : MathExpr; n_MathExpr : MathExpr; m_MathExpr : MathExpr; s_MathExpr : MathExpr; a_MathExpr : MathExpr; sigma_MathExpr : MathExpr; ldots_MathExpr : MathExpr; bigA_MathExpr : MathExpr; one_MathExpr : MathExpr; each_Det : Det; call_V2A : V2A; -- we call it prime call_V3 : V3; -- we call it an integer iff_Subj : Subj; ... ... @@ -38,6 +64,7 @@ abstract MathLex = Cat ** { AdvSInEnd : Adv -> S -> S; -- for the Math Grammar mathPrefixNoun : MathNP -> MathPrefixedNoun -> N; mathPrefixAdj : MathNP -> MathPrefixedAdj -> A; applyRel : MathBinRel -> MathExpr -> MathExpr -> MathExpr; applyBinOp : MathBinOp -> MathExpr -> MathExpr -> MathExpr; ... ...
 ... ... @@ -13,6 +13,7 @@ lincat MathBinOp = Str; MathUnOp = Str; MathPrefixedAdj = A; MathPrefixedNoun = N; lin cartesian_A = regA "cartesian" ; ... ... @@ -24,17 +25,42 @@ lin even_A = regA "even" ; permutation_N = regN "permutation" ; character_N = regN "character" ; alphabet_N = regN "alphabet" ; integer_N = regN "integer" ; element_N = regN "element" ; product_N = regN "product" ; string_N = regN "string" ; space_N = regN "space" ; word_N = regN "word" ; sign_N = regN "sign" ; set_N = regN "set" ; dimensional_MPA = regA "dimensional" ; tuple_MPN = regN "tuple"; three_PN = mkPN (mkN nonhuman (mkN "three")) ; divides_MathBinRel = "\\divides"; lessThan_MathBinRel = "<"; equals_MathBinRel = "="; power_MathBinOp = "^"; in_MathBinOp = "\\in"; xtimes_MathBinOp = "\\times"; neg_MathUnOp = "-"; i_MathExpr = "i"; n_MathExpr = "n"; m_MathExpr = "m"; s_MathExpr = "s"; a_MathExpr = "a"; sigma_MathExpr = "\\sigma"; ldots_MathExpr = "\\ldots"; bigA_MathExpr = "A"; one_MathExpr = "1"; each_Det = lin Det { s = "each" ; sp = table { NCase Gen => "each's"; _ => "each" }; n = Sg; hasNum = False }; -- how correct is this? call_V2A = mkV2A (mkV "call" "calls" "called" "called" "calling") noPrep ; call_V3 = mkV3 "call" ; iff_Subj = mkSubj "iff"; ... ... @@ -45,6 +71,7 @@ lin AdvSInEnd a s = lin S { s = s.s ++ a.s } ; -- for the Math Grammar mathPrefixNoun mathnp noun = lin N { s = \\number,case_ => mathnp ++ "-" ++ noun.s ! number ! case_; g = noun.g }; mathPrefixAdj mathnp adj = lin A { s = \\x => mathnp ++ "-" ++ adj.s ! x }; applyRel rel a b = a ++ rel ++ b; -- e.g. "m < n" applyBinOp op a b = a ++ op ++ b; -- e.g. "m + n" ... ... @@ -57,20 +84,4 @@ lin _ => table { _ => table { _ => "???" } } }; _ => table { _ => table { _ => table { _ => "???" } } } } }; exprToN expr = lin N { s = table { _ => table { _ => "$" ++ expr ++ "$" } } ; g = Neutr }; -- N = {s : Number => Case => Str ; g : Gender} ; divides_MathBinRel = "\\divides"; lessThan_MathBinRel = "<"; equals_MathBinRel = "="; power_MathBinOp = "^"; xtimes_MathBinOp = "\\times"; neg_MathUnOp = "-"; i_MathExpr = "i"; n_MathExpr = "n"; m_MathExpr = "m"; sigma_MathExpr = "\\sigma"; ldots_MathExpr = "\\ldots"; bigA_MathExpr = "A"; one_MathExpr = "1"; }
 ... ... @@ -2,6 +2,8 @@ import MathEng.gf parse "we call a positive integer $n$ prime , iff there is no integer $1 < m < n$ such that $m \\divides n$" parse "the empty set is the set without elements" parse "we call a set empty , iff it is the empty set" parse "an alphabet $A$ is a finite set" -- Warning: the following sentences have very many parse trees! -- parse "we call each element $a \\in A$ a character , and an $n$ - tuple of $s \\in A ^ n$ a word of $A$" -- parse "we call an $n$ - dimensional cartesian product $A _ 1 \\times \\ldots \\times A _ n$ an $n$ - dimensional cartesian space , iff $A _ i = A$ for some set $A$ for all $i$" -- parse "the sign of a permutation $\\sigma$ of a finite totally ordered set is $1$ if $\\sigma$ is even and $1$ else"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!