diff options
| author | krasimir <krasimir@chalmers.se> | 2010-02-17 11:07:24 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2010-02-17 11:07:24 +0000 |
| commit | f7f0112256b738a7c640c37d5bcbfc8a33bdb307 (patch) | |
| tree | e75a57edda742cbda74326331655cdf31e943649 /examples/SUMO/RGLExt | |
| parent | a4d41ef3e32af4f5e2fb2f5e97ff7024aa4dd068 (diff) | |
added examples/SUMO
Diffstat (limited to 'examples/SUMO/RGLExt')
| -rw-r--r-- | examples/SUMO/RGLExt/DictLang.gf | 13 | ||||
| -rw-r--r-- | examples/SUMO/RGLExt/DictLangEng.gf | 9 | ||||
| -rw-r--r-- | examples/SUMO/RGLExt/DictLangFre.gf | 10 | ||||
| -rw-r--r-- | examples/SUMO/RGLExt/DictLangRon.gf | 10 | ||||
| -rw-r--r-- | examples/SUMO/RGLExt/Extension.gf | 32 | ||||
| -rw-r--r-- | examples/SUMO/RGLExt/ExtensionEng.gf | 58 | ||||
| -rw-r--r-- | examples/SUMO/RGLExt/ExtensionFre.gf | 64 | ||||
| -rw-r--r-- | examples/SUMO/RGLExt/ExtensionRon.gf | 61 | ||||
| -rw-r--r-- | examples/SUMO/RGLExt/ExtraLexicon.gf | 7 | ||||
| -rw-r--r-- | examples/SUMO/RGLExt/ExtraLexiconFre.gf | 18 | ||||
| -rw-r--r-- | examples/SUMO/RGLExt/ExtraLexiconRon.gf | 18 | ||||
| -rw-r--r-- | examples/SUMO/RGLExt/ParamBasic.gf | 5 |
12 files changed, 305 insertions, 0 deletions
diff --git a/examples/SUMO/RGLExt/DictLang.gf b/examples/SUMO/RGLExt/DictLang.gf new file mode 100644 index 000000000..1b21e8fdf --- /dev/null +++ b/examples/SUMO/RGLExt/DictLang.gf @@ -0,0 +1,13 @@ +--1 Lang: a Test Module for the Resource Grammar
+
+-- This grammar is for testing the resource as included in the
+-- language-independent API, consisting of a grammar and a lexicon.
+-- The grammar without a lexicon is [``Grammar`` Grammar.html],
+-- which may be more suitable to open in applications.
+
+abstract DictLang =
+ Grammar,
+ Extension
+ ** {
+ -- flags startcat=NP ;
+ } ;
diff --git a/examples/SUMO/RGLExt/DictLangEng.gf b/examples/SUMO/RGLExt/DictLangEng.gf new file mode 100644 index 000000000..4e5aa5335 --- /dev/null +++ b/examples/SUMO/RGLExt/DictLangEng.gf @@ -0,0 +1,9 @@ +--# -path=.:../../../lib/src/abstract:../../../lib/src/english:../../../lib/src/common
+
+concrete DictLangEng of DictLang =
+ GrammarEng,
+ ExtensionEng ** {
+
+flags unlexer = text ; lexer = text ;
+
+} ;
diff --git a/examples/SUMO/RGLExt/DictLangFre.gf b/examples/SUMO/RGLExt/DictLangFre.gf new file mode 100644 index 000000000..c4417408e --- /dev/null +++ b/examples/SUMO/RGLExt/DictLangFre.gf @@ -0,0 +1,10 @@ +--# -path=.:../abstract:../common:../prelude:../romance:
+
+concrete DictLangFre of DictLang =
+ GrammarFre,
+ ExtensionFre
+ ** {
+
+flags unlexer = text ; lexer = text ;
+
+} ;
diff --git a/examples/SUMO/RGLExt/DictLangRon.gf b/examples/SUMO/RGLExt/DictLangRon.gf new file mode 100644 index 000000000..9c124d229 --- /dev/null +++ b/examples/SUMO/RGLExt/DictLangRon.gf @@ -0,0 +1,10 @@ +--# -path=.:../abstract:../common:../prelude
+
+concrete DictLangRon of DictLang =
+ GrammarRon,
+ ExtensionRon
+ ** {
+
+flags unlexer = text ; lexer = text ;
+
+} ;
diff --git a/examples/SUMO/RGLExt/Extension.gf b/examples/SUMO/RGLExt/Extension.gf new file mode 100644 index 000000000..170403983 --- /dev/null +++ b/examples/SUMO/RGLExt/Extension.gf @@ -0,0 +1,32 @@ +
+-- other functions needed for parsing
+
+abstract Extension = Cat ** {
+
+
+
+cat
+ PolSentence;
+ StmtS ;
+ [CN]{2};
+fun
+
+VerbToNounV2 : V2 -> N2 ; -- discovering
+VerbToNoun : V -> N ; -- walking is healthy
+VerbToGerundA : V -> A ; -- singing bird
+VerbToParticipeA : V -> A ; -- the required number
+ConjCN : Conj -> [CN] -> CN ; -- set or class
+mkPolSent : Cl -> PolSentence ;
+sentToNoun : PolSentence -> NP ;
+UsePolSentence : Pol -> PolSentence -> StmtS ;
+
+at_Prep : Prep ;
+per_Prep : Prep ;
+O1 : NP ;
+O2 : NP ;
+O3 : NP ;
+O4 : NP ;
+O5 : NP ;
+
+
+};
\ No newline at end of file diff --git a/examples/SUMO/RGLExt/ExtensionEng.gf b/examples/SUMO/RGLExt/ExtensionEng.gf new file mode 100644 index 000000000..649288fca --- /dev/null +++ b/examples/SUMO/RGLExt/ExtensionEng.gf @@ -0,0 +1,58 @@ +concrete ExtensionEng of Extension = CatEng ** open MorphoEng, ResEng, ConjunctionEng, StructuralEng, Prelude, ParadigmsEng, Coordination,ParamBasic in {
+
+
+lincat
+ PolSentence = {s : SentForm => Polarity => Str ; flag : Flag};
+ [CN] = {s1,s2 : Number => Case => Str ; g : Gender} ;
+ StmtS = {s : Str};
+lin
+
+VerbToNounV2 vs = VerbToNoun vs ** {c2 = vs.c2};
+
+VerbToNoun v = {s = \\_,_ => v.s ! VPresPart;
+ g = Masc};
+
+VerbToGerundA v = {s = \\_ => v.s ! VPresPart};
+
+VerbToParticipeA v = {s = \\_ => v.s ! VPPart};
+
+mkPolSent cl = {s = \\f,b => case b of
+ {Pos => cl.s ! Pres ! Simul ! CPos ! ODir;
+ _ => cl.s ! Pres ! Simul ! CNeg False ! ODir};
+ flag = NothingS ;
+ lock_PolSentence = <>};
+
+sentToNoun ps = {s = \\_ => "\"" ++ ps.s ! Indep ! Pos ++ "\"";
+ a = agrP3 Sg};
+
+ConjCN conj ss = conjunctDistrTable2 Number Case conj ss ** {g = ss.g};
+
+BaseCN x y ={s1 = \\n,c => x.s ! n ! c ;
+ s2 = \\n,c => y.s ! n ! c ;
+ g = x.g} ;
+
+ConsCN xs x = consrTable2 Number Case comma xs x ** {g = Masc} ;
+
+
+UsePolSentence p ps = {s = ps.s ! Indep ! p.p};
+
+at_Prep = mkPrep "at" ;
+per_Prep = mkPrep "per" ;
+
+O1 = {s = \\_ => "o1" ;
+ a = agrP3 Sg};
+
+O2 = {s = \\_ => "o2" ;
+ a = agrP3 Sg};
+
+O3 = {s = \\_ => "o3" ;
+ a = agrP3 Sg};
+
+O4 = {s = \\_ => "o4" ;
+ a = agrP3 Sg};
+
+O5 = {s = \\_ => "o5" ;
+ a = agrP3 Sg};
+
+
+}
\ No newline at end of file diff --git a/examples/SUMO/RGLExt/ExtensionFre.gf b/examples/SUMO/RGLExt/ExtensionFre.gf new file mode 100644 index 000000000..16040d03e --- /dev/null +++ b/examples/SUMO/RGLExt/ExtensionFre.gf @@ -0,0 +1,64 @@ +--# -path=.:../romance:../common:../abstract:../prelude:
+concrete ExtensionFre of Extension = CatFre ** open MorphoFre, Prelude, Coordination,ParamBasic, ResFre, GrammarFre, ParadigmsFre in {
+
+
+lincat
+ PolSentence = {s : SentForm => Polarity => Str ; flag : Flag};
+ [CN] = {s1,s2 : Number => Str ; g : Gender} ;
+ SS = {s : Str};
+
+
+
+lin
+
+VerbToNoun v = {s = \\_ => v.s ! (VInfin True);
+ g = Masc};
+
+VerbToNounV2 v2 = VerbToNoun v2 ** {c2 = v2.c2};
+
+VerbToGerundA v = {s = \\_,af => case af of
+ {AF g n => v.s ! VGer; -- need more data for feminine and plural forms
+ AA => "en" ++ v.s ! VGer
+ };
+ isPre = False};
+
+VerbToParticipeA v = {s = \\_,af => case af of
+ {AF g n => v.s ! (VPart g n);
+ AA => "en" ++ v.s ! VGer
+ };
+ isPre = False} ;
+
+mkPolSent cl = {s = \\f,b => cl.s ! DDir ! RPres ! Simul ! b ! Indic ;
+ flag = NothingS ;
+ lock_PolSentence = <>
+ };
+
+sentToNoun ps = heavyNP {s = \\_ => "\"" ++ ps.s ! Indep ! Pos ++ "\"";
+ a = agrP3 Masc Sg
+ };
+
+at_Prep = mkPreposition "à" ;
+per_Prep = mkPreposition "per" ;
+
+ConjCN conj ss = conjunctDistrTable Number conj ss ** {
+ g = ss.g
+ };
+
+BaseCN x y ={
+ s1 = \\n => x.s ! n ;
+ s2 = \\n => y.s ! n ;
+ g = x.g};
+
+ConsCN xs x = consrTable Number comma xs x ** {g = x.g} ;
+
+UsePolSentence p ps = {s = ps.s ! Indep ! p.p};
+
+O1 = UsePN (mkPN "o1") ;
+O2 = UsePN (mkPN "o2") ;
+O3 = UsePN (mkPN "o3") ;
+O4 = UsePN (mkPN "o4") ;
+O5 = UsePN (mkPN "o5") ;
+
+
+
+}
\ No newline at end of file diff --git a/examples/SUMO/RGLExt/ExtensionRon.gf b/examples/SUMO/RGLExt/ExtensionRon.gf new file mode 100644 index 000000000..e8e12ba10 --- /dev/null +++ b/examples/SUMO/RGLExt/ExtensionRon.gf @@ -0,0 +1,61 @@ +concrete ExtensionRon of Extension = CatRon ** open MorphoRon, ResRon, ConjunctionRon, StructuralRon, Prelude, Coordination,ParamBasic, ParadigmsRon, NounRon in {
+
+
+lincat
+ PolSentence = {s : SentForm => Polarity => Str ; flag : Flag};
+ [CN] = {s1,s2 : Number => Species => ACase => Str; g : NGender; a : Animacy ; isComp : Bool} ;
+ StmtS = {s : Str};
+lin
+
+VerbToNounV2 v2 = VerbToNoun v2 ** {c2 = v2.c2};
+
+
+VerbToNoun vp = { s = \\n,sp,c => vp.s ! PPasse Masc n sp c ;
+ g = NNeut ; a = Inanimate };
+
+
+VerbToGerundA vp = {s = \\af => vp.s ! Ger;
+ isPre = False
+ };
+
+VerbToParticipeA v = {s = \\af => case af of
+ {AF g n sp c => v.s ! PPasse g n sp c;
+ AA => v.s ! PPasse Masc Sg Indef ANomAcc
+ };
+ isPre = False
+ };
+
+mkPolSent cl = {s = \\f,b => cl.s ! DDir ! RPres ! Simul ! b ! Indic ;
+ flag = NothingS ;
+ lock_PolSentence = <>
+ };
+
+sentToNoun ps = heavyNP {s = \\_ => "\"" ++ ps.s ! Indep ! Pos ++ "\"";
+ a = agrP3 Masc Sg; hasClit = HasClit ; isComp = True ;
+ ss = "\"" ++ ps.s ! Indep ! Pos ++ "\""
+ };
+
+ConjCN conj ss = conjunctDistrTable3 Number Species ACase conj ss ** {
+ g = ss.g; a = ss.a; isComp = ss.isComp
+ };
+
+
+BaseCN x y ={
+ s1 = \\n,sp,c => x.s ! n ! sp ! c ;
+ s2 = \\n,sp,c => y.s ! n ! sp ! c ;
+ g = x.g; a = x.a ; isComp = x.isComp};
+
+ConsCN xs x = consrTable3 Number Species ACase comma xs x ** {g = x.g; a = x.a; isComp = x.isComp} ;
+
+at_Prep = mkPrep "la" Ac True;
+per_Prep = mkPrep "per" Ac True;
+
+UsePolSentence p ps = {s = ps.s ! Indep ! p.p};
+
+O1 = UsePN (mkPN "o1") ;
+O2 = UsePN (mkPN "o2") ;
+O3 = UsePN (mkPN "o3") ;
+O4 = UsePN (mkPN "o4") ;
+O5 = UsePN (mkPN "o5") ;
+
+}
\ No newline at end of file diff --git a/examples/SUMO/RGLExt/ExtraLexicon.gf b/examples/SUMO/RGLExt/ExtraLexicon.gf new file mode 100644 index 000000000..fa5ea52bd --- /dev/null +++ b/examples/SUMO/RGLExt/ExtraLexicon.gf @@ -0,0 +1,7 @@ +abstract ExtraLexicon = Cat ** {
+fun
+ time_N : N ;
+ square_A : A ;
+ value_N : N ;
+ element_N : N ;
+}
diff --git a/examples/SUMO/RGLExt/ExtraLexiconFre.gf b/examples/SUMO/RGLExt/ExtraLexiconFre.gf new file mode 100644 index 000000000..6daabbaec --- /dev/null +++ b/examples/SUMO/RGLExt/ExtraLexiconFre.gf @@ -0,0 +1,18 @@ +--# -path=.:../romance:../common:../abstract:../../prelude
+
+concrete ExtraLexiconFre of ExtraLexicon = CatFre **
+ open ParadigmsFre,MorphoFre,BeschFre in {
+
+flags
+ optimize=values ;
+
+lin
+ value_N = regGenN "valeur" feminine ;
+ square_A = regA "caré" ;
+ time_N = regN "heure" ;
+ element_N = mkN "élément" ;
+
+
+
+
+} ;
diff --git a/examples/SUMO/RGLExt/ExtraLexiconRon.gf b/examples/SUMO/RGLExt/ExtraLexiconRon.gf new file mode 100644 index 000000000..8846a05de --- /dev/null +++ b/examples/SUMO/RGLExt/ExtraLexiconRon.gf @@ -0,0 +1,18 @@ +--# -path=.:../romance:../common:../abstract:../../prelude
+
+concrete ExtraLexiconRon of ExtraLexicon = CatRon **
+ open ParadigmsRon,MorphoRon,BeschRon in {
+
+flags
+ optimize=values ;
+
+lin
+ value_N = mkN "valoare" "valori" ;
+ square_A = regA "patrat" ;
+ time_N = mkNR "timp" ;
+ element_N = mkN "element" ;
+
+
+
+
+} ;
diff --git a/examples/SUMO/RGLExt/ParamBasic.gf b/examples/SUMO/RGLExt/ParamBasic.gf new file mode 100644 index 000000000..83471801a --- /dev/null +++ b/examples/SUMO/RGLExt/ParamBasic.gf @@ -0,0 +1,5 @@ +resource ParamBasic = {
+param Flag = ExistS NumQuant | ForallS NumQuant | NothingS ;
+param SentForm = Indep | Attrib ;
+param NumQuant = One | Many ;
+}
\ No newline at end of file |
