This grammar covers some Czech sentences. The difference to the
ema
grammar is that this grammar includes an additional TH
graph dimension (THematic) modeling tectogrammatical structure. It
was written by Ondrej Bojar.
usedim id usedim th usedim lp usedim lex %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% define dimension id defdim id { %% %%%%%%%%%%%%%%%%%%%%%%%%%%%% %% define types defattrstype "id.attrs" defentrytype "id.entry" deflabeltype "id.label" deftype "id.person" {first second third} deftype "id.number" {sg pl} deftype "id.gender" {masc fem neut inan} deftype "id.case" {nom gen dat acc voc loc ins} deftype "id.agr" tuple("id.person" "id.number" "id.gender" "id.case") deftype "id.agrs" iset("id.agr") deftype "id.attrs" {agr: "id.agr"} deftype "id.entry" {in: iset("id.label") out: valency("id.label") agrs: "id.agrs" lagrs: vec("id.label" "id.agrs") lpreps: vec("id.label" "th.preps") } deftype "id.label" { sent subj obj auxr vfin subj_inf obj_inf adv adj auxp } %% %%%%%%%%%%%%%%%%%%%%%%%%%%%% %% use principles useprinciple "principle.graph1" { dims {D: id}} useprinciple "principle.agr" { dims {D: id} args {Agr: _.D.attrs.agr Agrs: _.D.entry.agrs}} useprinciple "principle.agreement" { dims {D: id} args {Agr1: ^.D.attrs.agr Agr2: _.D.attrs.agr Agree: {subj}}} useprinciple "principle.government" { dims {D: id} args {Agr2: _.D.attrs.agr Govern: ^.D.entry.lagrs}} useprinciple "principle.government1" { dims {D: id D1: th} args {Agr2: _.D1.attrs.prep Govern: ^.D.entry.lpreps}} useprinciple "principle.tree" { dims {D: id}} useprinciple "principle.in" { dims {D: id}} useprinciple "principle.out" { dims {D: id}} %% %%%%%%%%%%%%%%%%%%%%%%%%%%%% %% use and choose outputs output "output.dag" output "output.latex" output "output.pretty" %% useoutput "output.dag" } defdim th { defattrstype "th.attrs" defentrytype "th.entry" deflabeltype "th.label" deftype "th.prep" {no_prep na_acc na_loc v_loc do_gen} deftype "th.preps" iset("th.prep") deftype "th.attrs" {prep: "th.prep"} deftype "th.entry" { in: iset("th.label") out: valency("th.label") end: vec("th.label" set("id.label")) preps: "th.preps" lpreps: vec("th.label" "th.preps") } deftype "th.label" { act pat pred dir3 dummy } useprinciple "principle.agr" { dims {D: th} args {Agr: _.D.attrs.prep Agrs: _.D.entry.preps}} useprinciple "principle.government" { dims {D: th} args {Agr2: _.D.attrs.prep Govern: ^.D.entry.lpreps}} useprinciple "principle.graph1" { dims {D: th}} useprinciple "principle.tree" { dims {D: th}} useprinciple "principle.in" { dims {D: th}} useprinciple "principle.out" { dims {D: th}} useprinciple "principle.linkingEnd" { dims {D1: th D2: id D3: th}} output "output.dag" output "output.latex" output "output.pretty" %% useoutput "output.dag" } %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% define dimension lp defdim lp { %% %%%%%%%%%%%%%%%%%%%%%%%%%%%% %% define types defentrytype "lp.entry" deflabeltype "lp.label" deftype "lp.entry" {in: iset("lp.label") out: valency("lp.label") on: iset("lp.label") blocks: set("id.label")} deftype "lp.label" { prepf adjf noun vinf verb auxrf vmodf mod refl preclitf clitf postclitf sent prep postprepf } %% %%%%%%%%%%%%%%%%%%%%%%%%%%%% %% use principles useprinciple "principle.graph1" { dims {D: lp}} useprinciple "principle.tree" { dims {D: lp}} useprinciple "principle.in" { dims {D: lp}} useprinciple "principle.out" { dims {D: lp}} useprinciple "principle.order" { dims {D: lp} args {Order: [ % Every line is used for a different ordering, % lines among one another are incomparable. % In every line, there should be only fields (to let daughters % land in) +exactly one element, the head. % Lines with only one element are used for nodes that do not % offer any place for daughter. prepf adjf noun vinf verb auxrf vmodf mod refl preclitf clitf postclitf sent prep postprepf ] Yields: true}} useprinciple "principle.projectivity" { dims {D: lp}} useprinciple "principle.climbing" { dims {D1: lp D2: id}} useprinciple "principle.barriers" { dims {D1: lp D2: id D3: lp}} %% %%%%%%%%%%%%%%%%%%%%%%%%%%%% %% use and choose outputs output "output.dag" output "output.latex" output "output.pretty" %% useoutput "output.dag" } %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% define dimension lex defdim lex { %% %%%%%%%%%%%%%%%%%%%%%%%%%%%% %% define types defentrytype {word: string}} %% %%%%%%%%%%%%%%%%%%%%%%%%%%%% %% define classes defclass "sent" Word { % final punctuation of the sent dim id { in: {} out: {vfin} } dim th { in: {} out: {pred dummy*} } dim lex {word: Word} dim lp {in: {} on: {sent} out: ({preclitf#{1 2} clitf+ postclitf+} | {postclitf*}) } } defclass "cnoun" Word Agrs { dim id {in: {subj obj} out: {adj?} agrs: Agrs} dim th { in: {act pat dir3} out: {} } dim lp {in: {preclitf postclitf postprepf} on: {noun} out: {adjf*} } dim lex {word: Word}} defclass "pname" Word Agrs { dim id {in: {subj obj} agrs: Agrs} dim th { in: {act pat dir3} out: {} } dim lp {in: {preclitf postclitf postprepf} on: {noun}} dim lex {word: Word}} defclass "reflpart" Word { dim id { in: {auxr} out: {} } dim th { in: {dummy pat} out: {} } dim lp { on: {refl} in: {clitf auxrf} out: {} } dim lex {word: Word} } defclass "prep" Word Agrs PrepAgrs { dim id { in: {auxp} out: {obj} lagrs: {obj: Agrs} lpreps: {obj: PrepAgrs } } dim th { in: {dummy} out: {} } dim lp { on: {prep} in: {preclitf postclitf} out: {postprepf} } dim lex {word: Word} } defclass "fin" Word Agrs { dim id {in: {vfin} out: {subj?} agrs: Agrs lagrs: {subj: $ nom} } dim th { in: {pred} out: {act} end: { act: {subj} pat: {obj} } } dim lp {in: {preclitf postclitf} % out: {mf* vxf?} out: {} on: {verb} % blocks: {det subj obj vbse vprt vinf} } dim lex {word: Word} } defclass "inf" Word { dim id {in: {subj_inf obj_inf} out: {} % agrs: Agrs % lagrs: {subj: $ nom} } dim lp {in: {preclitf postclitf} % out: {mf* vxf?} out: {} on: {vinf} % blocks: {det subj obj vbse vprt vinf} } dim lex {word: Word} } % defclass "can" Word { % dim id {in: {vbse vprt vinf}} % dim lp {in: {vcf} % on: {v}} % dim lex {word: Word}} % % defclass "noncan" Word { % dim id {in: {vbse vprt vinf}} % dim lp {in: {vxf} % on: {v} % out: {mf* vxf?}} % dim lex {word: Word}} % % defclass "ersatz" { % dim id {in: {vbse vprt}}} % % defclass "vbse" { % dim id {in: {vbse}}} % % defclass "vinf" { % dim id {in: {vinf} % out: {prt}} % dim lp {out: {pf}}} % % defclass "vprt" { % dim id {in: {vprt}}} defclass "vclass_refl" { dim id {out: {auxr}} dim lp {out: {auxrf?}} } defclass "vclass_tr" { dim id {out: {obj} lagrs: {obj: $ acc} lpreps: {obj: {no_prep} } } dim th { out: {pat} end: { pat: {obj} } lpreps: { pat: {no_prep} } } dim lp {out: {vmodf?}} } defclass "vclass_dir3" { dim id {out: {auxp} } dim th { out: {dir3} end: { dir3: {obj} } lpreps: { dir3: {na_acc do_gen} } } dim lp {out: {vmodf?}} } defclass "vclass_trmod" { dim id {out: {adv}} dim lp {out: {vmodf?}} } defclass "vclass_trinf" { dim id {out: {obj_inf}} dim lp {out: {vmodf?}} } defclass "adv" Word { dim id { in: {vfin adj adv} out: {adv?} } dim lp { in: {preclitf postclitf vmodf} on: {mod} out: {} } dim lex {word: Word} } % defclass "vbsec" { % dim id {out: {vbse}} % dim lp {out: {vcf?}}} % % defclass "vprtc" { % dim id {out: {vprt}} % dim lp {out: {vcf?}}} % % defclass "vinfc" { % dim id {out: {vinf}} % dim lp {out: {vcf?}}} % % defclass "prt" Word { % dim id {in: {prt}} % dim lp {in: {pf} % on: {p}} % dim lex {word: Word}} %% %%%%%%%%%%%%%%%%%%%%%%%%%%%% %% define entries % Punctuation defentry { "sent" {Word: "."} } % Common nouns defentry { "cnoun" {Agrs: ($ fem & third & sg & nom) Word: "mísa"}} defentry { "cnoun" {Agrs: ($ fem & third & sg & acc) Word: "mísu"}} defentry { "cnoun" {Agrs: ($ fem & third & sg & gen) Word: "mísy"}} defentry { "cnoun" {Agrs: ($ inan & third & sg & (nom|acc)) Word: "soubor"}} defentry { "cnoun" {Agrs: ($ inan & third & sg & (gen|dat|voc)) Word: "souboru"}} % Proper names defentry { "pname" {Agrs: ($ fem & sg & third & nom) Word: "ema"}} defentry { "pname" {Agrs: ($ masc & sg & third & nom) Word: "petr"}} % Reflective particle defentry { "reflpart" {Word: "se"} } % Prepositions defentry { "prep" { Word: "na" Agrs: ($ acc|loc) PrepAgrs: {na_acc na_loc} } } defentry { "prep" { Word: "do" Agrs: ($ gen) PrepAgrs: {do_gen} } } % Finite verbs defentry { "fin" {Agrs: ($ third & sg & nom) Word: "má" } "vclass_tr"} defentry { "fin" {Agrs: ($ third & sg & nom) Word: "má" } "vclass_refl" "vclass_trmod" } defentry { "fin" {Agrs: ($ third & sg & nom) Word: "dá" } "vclass_tr" "vclass_dir3" } defentry { "fin" {Agrs: ($ third & sg & nom) Word: "nepodařilo" } "vclass_refl" "vclass_trinf" } % Infinitives defentry { "inf" {Word: "otevřít"} "vclass_tr"} % Adverbs defentry { "adv" {Word: "dobře"} } % defentry { % "fin" {Agrs: ($ third & sg & nom) % Word: "hat"} % "vprtc"} % % defentry { % "fin" {Agrs: ($ third & sg & nom) % Word: "versucht"} % "vinfc"} % % defentry { % "fin" {Agrs: ($ third & sg & nom) % Word: "liebt"} % "tr"} % % % Non-finite verbs % defentry { % "can" {Word: "lieben"} % "tr" % "vbse"} % defentry { % "can" {Word: "geliebt"} % "tr" % "vprt"} % % defentry { % "can" {Word: "koennen"} % "vbsec" % "vbse"} % defentry { % "noncan" {Word: "koennen"} % "vbsec" % "ersatz"} % % defentry { % "noncan" {Word: "haben"} % "vprtc" % "vbse"} % % defentry { % "can" {Word: "lieben"} % "tr" % "vinf"} % defentry { % "noncan" {Word: "lieben"} % "tr" % "vinf"} % % % zu-particle % defentry { % "prt" {Word: "zu"}} % }