Commit 7fc5e4c5 authored by jfschaefer's avatar jfschaefer
Browse files

added german grammar (with many errors)

parent c9cc87cd
concrete FGrammarGer of FGrammar = FGrammarI, MCatsGer, CatGer ** open ParadigmsGer, ResGer, Prelude in {
oper
mkMathCN_sg : Str -> CN = \s -> lin CN {
s = table { _ => table { _ => table { _ => s } } }; -- TODO: FIX POLARITY!
rc = table { _ => s };
ext = s;
adv = s;
g = Neutr;
};
lin
fstatement_to_statement fstmt = lin Cl {
s = table { _ => table { _ => table { _ => table { _ => table { _ => fstmt } } } } };
};
fcomplexidentifier_to_identifer fci = { s = "$" ++ fci ++ "$"; m = one };
-- mkMathCN_sg ("$" ++ (wrap_mml "mrow" (a ++ (wrap_mml "mo" r1) ++ b ++ (wrap_mml "mo" r2) ++ c)) ++ "$");
}
concrete FLexiconGer of FLexicon = FGrammarGer ** {
lin
n_FIdentifier = "n";
m_FIdentifier = "m";
A_FIdentifier = "A";
a_FIdentifier = "a";
one_FNumeral = "1";
two_FNumeral = "2";
lessThan_FBinRelation = "<";
greaterThan_FBinRelation = ">";
divides_FBinRelation = "|";
}
concrete MCatsGer of MCats = MCatsI with (Syntax=SyntaxGer) ** {
}
concrete MNlpGer of MNlp = NLexiconGer, NGrammarGer, FGrammarGer, FLexiconGer ** {
}
concrete NGrammarGer of NGrammar = MCatsGer, GrammarGer** open SyntaxGer, ParadigmsGer, UtilsGer, ResGer, ParamX, Prelude in {
oper
call_V2A : V2A = mkV2A (ParadigmsGer.mkV "heißen");
call_V3 : V3 = mkV3 (ParadigmsGer.mkV "heißen");
exist_V2 : V2 = mkV2 (ParadigmsGer.mkV ("geben" | "existieren"));
lin
PosPol = GrammarGer.PPos;
NegPol = GrammarGer.PNeg;
no_identifier = { s = ""; m = one | many };
restrict_mobj prop obj = mobjPrepMObjProp obj prop;
mobj_such_that obj restr = mobjAddSuffix obj restr.rs;
-- def_descr_mobj obj = mkNP the_Art obj;
-- appo_mobj obj mcn = lin CN { s = \\number,case_ => obj.s ! number ! case_ ++ mcn.s ! number ! case_; g = obj.g };
-- it_pron_defmobj = mkNP it_Pron;
--
exists_statement obj id = mkCl (DetCN aSg_Det (mobjToCN obj id)) | mkCl (mkVP exist_V2 (DetCN aSg_Det (mobjToCN obj id)));
not_exists_statement obj id = mkCl (DetCN (DetQuant no_Quant NumSg) (mobjToCN obj id)) |
mkCl (mkVP exist_V2 (DetCN (DetQuant no_Quant NumSg) (mobjToCN obj id)));
-- eq_defmobj_defmobj a b = mkCl a b;
--
state stmt pol = { s = mkS pol stmt; rs = mkRS pol (mkRCl stmt) };
-- iff_statementfin a b = { s = mkS (mkConj "iff") a.s b.s; rs = mkRS (mkConj "iff") a.rs b.rs };
-- and_statementfin a b = { s = mkS (mkConj "and") a.s b.s; rs = mkRS (mkConj "and") a.rs b.rs };
-- or_statementfin a b = { s = mkS (mkConj "or") a.s b.s; rs = mkRS (mkConj "or") a.rs b.rs };
--
def_mobj_mobjprop obj id prop = mkS (mkCl
(DetCN aSg_Det (mobjToCN obj id)) -- (mkNP aSg_Det (mobjToCN obj))
(PastPartAP (mkVPSlash call_V2A prop)));
-- iff_definition defi condition = lin S { s = "iff" }; -- better solution for this?
iff_definition defi condition = lin S { s = \\order => (defi.s!order) ++ "genau dann wenn" ++ condition.s.s!Sub }; -- better solution for this?
-- def_defmobj_defmobj a b = mkCl a b;
def_mobj_is_mobj definiendum id definiens =
mkS (mkCl (DetCN aSg_Det (mobjToCN definiens id)) (mobjToCN definiendum)) -- a unitary quasigroup is a loop
| mkS (mkCl (DetCN aSg_Det (mobjToCN definiens id)) -- a unitary quasigroup is called a loop
(PastPartAP (mkVPSlash call_V3 (DetCN aSg_Det (mobjToCN definiendum)))));
-- mkS (mkCl (DetCN {- mkNP is for some reason ambiguous -}
-- aSg_Det (appo_mobj definiendum representative)) definiens);
-- let_id_be_a_mobj id obj = ImpP3 (identifierToNP id) (mkVP (mobjToCN obj));
-- let_then_stmt id obj stmt = {
-- s = mkS (mkConj "then") { s = (ImpP3 (identifierToNP id) (mkVP (mobjToCN obj))).s } stmt.s;
-- rs = mkRS (mkConj "then") { s = (ImpP3 (identifierToNP id) (mkVP (mobjToCN obj))).s } stmt.rs;
-- };
utter_statement s = mkUtt s.s;
utter_declaration s = mkUtt s;
utter_definition s = mkUtt s;
-- copied from ExtraGer (which cannot be imported without errors :/)
PastPartAP vp = {
s = \\af => (vp.nn ! agrP3 Sg).p1 ++ (vp.nn ! agrP3 Sg).p2 ++ vp.a2 ++ vp.inf ++
vp.ext ++ vp.infExt ++ vp.s.s ! VPastPart af ;
isPre = True ;
c = <[],[]> ;
ext = []
} ;
}
concrete NLexiconGer of NLexicon = MCatsGer ** open SyntaxGer, ParadigmsGer, UtilsGer in {
lin
-- integer_MObj = mkCN (mkN "integer");
-- set_MObj = mkCN (mkN "set");
-- alphabet_MObj = mkCN (mkN "alphabet");
quasigroup_MObj = mkMObj (mkN "Quasigruppe");
loop_MObj = mkMObj (mkN "Loop");
integer_MObj = mkMObj (mkN "ganze Zahl");
finite_MObjProp = mkAP (mkA "endlich");
empty_MObjProp = mkAP (mkA "leer");
even_MObjProp = mkAP (mkA "gerade");
positive_MObjProp = mkAP (mkA "positiv");
prime_MObjProp = mkAP (mkA "primzahlig");
unital_MObjProp = mkAP (mkA "unitär");
}
resource UtilsGer = MCatsGer ** open SyntaxGer, ParadigmsGer, ResGer, ParamX, Prelude in {
-- CONSTRUCTORS
oper
mkMObj_helper : N -> Str -> Str -> boolean -> boolean -> MObj
= \n,p1,p2,hp1,hp2 -> lin MObj {
core = mkCN n; -- core of the declaration (e.g. "continuous function")
suffix = \\n => ""; -- suffix (usually starting with a preposition, e.g. "on the real numbers")
prep1 = p1; -- preposition 1 (e.g. "from")
prep2 = p2; -- preposition 2 (e.g. "to")
hasp1 = hp1;
hasp2 = hp2;
};
mkMObj = overload {
mkMObj : N -> Str -> Str -> boolean -> boolean -> MObj
= mkMObj_helper;
mkMObj : Str -> MObj
= \s -> mkMObj_helper (ParadigmsGer.mkN s) "" "" false false;
mkMObj : N -> MObj
= \n -> mkMObj_helper n "" "" false false;
};
-- MODIFIERS
oper
mobj_set_suffix : MObj -> (ParamX.Number => Str) -> MObj
= \mobj,s -> lin MObj {
core = mobj.core;
suffix = s;
prep1 = mobj.prep1;
prep2 = mobj.prep2;
hasp1 = mobj.hasp1;
hasp2 = mobj.hasp2;
};
mobjAddSuffix = overload {
mobjAddSuffix : MObj -> Str -> MObj
= \mobj,s -> mobj_set_suffix mobj (\\n => (mobj.suffix!n) ++ s);
mobjAddSuffix : MObj -> RS -> MObj
= \mobj,rs -> mobj_set_suffix mobj (table {
Sg => (mobj.suffix ! Sg) ++ (rs.s ! RGenNum (GSg Neutr));
Pl => (mobj.suffix ! Pl) ++ (rs.s ! RGenNum GPl)
});
};
mobjPrepMObjProp : MObj -> MObjProp -> MObj
= \mobj,prop -> mobj ** { core = mkCN prop mobj.core };
mobjToCN = overload {
mobjToCN : MObj -> CN = \mobj ->
lin CN { s = \\adjf,number,case_ => mobj.core.s ! adjf ! number ! case_ ++ mobj.suffix ! number;
rc = mobj.core.rc; ext = mobj.core.ext; adv = mobj.core.ext; g = mobj.core.g };
mobjToCN : MObj -> Identifier -> CN = \mobj,id ->
lin CN { s = \\adjf,number,case_ => mobj.core.s ! adjf ! number ! case_ ++ id.s ++ mobj.suffix ! number;
rc = mobj.core.rc; ext = mobj.core.ext; adv = mobj.core.ext; g = mobj.core.g };
};
identifierToNP : Identifier -> NP = \id -> lin NP { s = table { _ => id.s };
rc = id.s; ext = id.s; adv = id.s; isPron = False;
a = table { one => Ag Neutr Sg P3; many => Ag Neutr Pl P3 } ! id.m };
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment