summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2006-10-10 20:24:15 +0000
committeraarne <aarne@cs.chalmers.se>2006-10-10 20:24:15 +0000
commit72699f446f21e014989af8f31e7a554ffa0359a8 (patch)
treec7a13d930cbeebd94e0441ab76c1a98ab1bcadc4 /examples
parent65fd6edb6c57d4aed46f91d727ccf3b86b9bc982 (diff)
italian disamb example
Diffstat (limited to 'examples')
-rw-r--r--examples/disamb/ConversationIta.gf57
1 files changed, 57 insertions, 0 deletions
diff --git a/examples/disamb/ConversationIta.gf b/examples/disamb/ConversationIta.gf
new file mode 100644
index 000000000..6728a38b0
--- /dev/null
+++ b/examples/disamb/ConversationIta.gf
@@ -0,0 +1,57 @@
+--# -path=.:prelude
+
+concrete ConversationIta of Conversation = open Prelude in {
+
+ lincat
+ Q = {s : Str} ;
+ NP = {s : Str ; g : Gen ; n : Num ; p : Pol} ;
+ A = {s : Gen => Num => Str} ;
+ Gender = {s : Str ; g : Gen} ;
+ Number = {s : Str ; n : Num} ;
+ Politeness = {s : Str ; p : Pol} ;
+
+ param
+ Num = Sg | Pl ;
+ Gen = Masc | Fem ;
+ Pol = Fam | Resp ;
+ lin
+ PredA np a = ss (np.s ++ essere np.n np.p ++ a.s ! np.g ! np.n) ;
+
+ GMasc = ss [] ** {g = Masc} ;
+ GFem = ss [] ** {g = Fem} ;
+ NSg = ss [] ** {n = Sg} ;
+ NPl = ss [] ** {n = Pl} ;
+ PFamiliar = ss [] ** {p = Fam} ;
+ PPolite = ss [] ** {p = Resp} ;
+
+ You n p g =
+ {g = g.g ; n = n.n ; p = p.p ;
+ s = case <n.n, p.p> of {
+ <Sg,Fam> => "tu" ;
+ <Sg,Resp> => "Lei" ;
+ <Pl,Fam> => "voi" ;
+ <Pl,Resp> => "Loro"
+ } ++ g.s ++ p.s ++ n.s
+ } ;
+
+ Ready = regA "pronto" ;
+
+ oper
+ essere : Num -> Pol -> Str = \n,p -> case <n,p> of {
+ <Sg,Fam> => "sei" ;
+ <Sg,Resp> => "รจ" ;
+ <Pl,Fam> => "siete" ;
+ <Pl,Resp> => "sono"
+ } ;
+
+ regA : Str -> {s : Gen => Num => Str} = \nero ->
+ let ner = init nero in {
+ s = \\g,n => case <n,g> of {
+ <Sg,Fem> => ner + "a" ;
+ <Sg,Masc> => nero ;
+ <Pl,Fem> => ner + "e" ;
+ <Pl,Mas> => ner + "i"
+ }
+ } ;
+
+}