summaryrefslogtreecommitdiff
path: root/examples/godis-tram/Common/GodisLangSwe.gf
blob: 6970f89c6cb8cd371920a74e9897671890eb224d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
--# -path=.:prelude:resource-1.0/abstract:resource-1.0/common:resource-1.0/scandinavian:resource-1.0/swedish

instance GodisLangSwe of GodisLang = 
    open Prelude, PredefCnc, GrammarSwe, ParadigmsSwe, ConstructX,
         MorphoSwe, CommonScand, (Lex=LexiconSwe), (Irreg=IrregSwe) in {

oper

----------------------------------------------------------------------
-- focus

embed_NP a b x = {s = \\c => a ++ (x.s ! c) ++ b; a = x.a; lock_NP = <>};


----------------------------------------------------------------------
-- user utterances

userGreet = ss ["hej"];
userQuit  = ss ["hejdå"];
userNo    = ss ["nej"];
userYes   = ss ["ja"];
userOkay  = variants { ss ["okej"]; ss ["ok"]; ss ["okay"] };

userCoordinate x y = ss (x.s ++ "och" ++ optStr "sedan" ++ y.s);

thank_you_Str = variants{ "schysst"; "tack"; userOkay.s };
i_want_to_Str = variants{ "jag" ++ variants{ "vill"; ["skulle vilja"] };
                          ["kan du"] };
please_Str    = "tack";
this_that_Str = variants{ variants{"den";"det"} ++ optStr "här";
			  "denna"; "detta" };

not_user_prop  p = ss ( "inte" ++ p.s );
not_user_short a = ss ( "inte" ++ a.s );

----------------------------------------------------------------------
-- system utterances

hello           = mkUtt ["MP3 spelaren är redo"];
goodbye         = mkUtt ["Hejdå"];
yes             = mkUtt ["Ja"];
no              = mkUtt ["Nej"];

is_that_correct_Post   = mkUtt [", är det korrekt"];
returning_to_Pre       = mkUtt ["Återgår till"];
returning_to_act_Pre   = mkUtt ["Återgår till att"];
returning_to_issue_Pre = mkUtt ["Återgår till frågan om"];
what_did_you_say       = mkUtt ["Vad sa du"];
what_do_you_mean       = mkUtt ["Vad menar du"];
i_dont_understand      = mkUtt ["Jag förstår inte riktigt"];
cant_answer_que_Pre    = mkUtt ["Ledsen , jag kan inte svara på frågor om"];
not_valid_Post         = mkUtt ["går inte att välja"];

icm_acc_pos     = mkUtt thank_you_Str;
icm_con_neg     = mkUtt ["Hallå?"];
icm_reraise     = mkUtt ["Så ,"];
icm_loadplan    = mkUtt ["Få se"];
icm_accommodate = mkUtt ["Visst"];

icm_per_pos   x = mkUtt (["Jag tyckte du sa"] ++ x.s);


----------------------------------------------------------------------
-- noun phrases

sing_NP    s = regNP s (s+"s") SgUtr ** {lock_NP = <>};
plur_NP    s = regNP s (s+"s") Plg   ** {lock_NP = <>};

NPgen_NP = NP_of_NP;

NP_Cl np = {s = \\t,a,b,o => np.s ! nominative; lock_Cl = <>};

prefix_N n1 n2 = {s = \\n,s,c => n1.s!Sg!Indef!Gen ++ n2.s!n!s!c;
		  g = n2.g;
		  lock_N = <>};


----------------------------------------------------------------------
-- actions/verb phrases

VPing act = act;
vp2Utt vp = mkUtt (infVP vp (agrP3 utrum Sg));
-- UttVP vp;


----------------------------------------------------------------------
-- general syntactical operations

disjunct_QCl q q' = 
    {s = \\t,a,p,x => q.s!t!a!p!x ++ "eller" ++ q'.s!t!a!p!x;
     lock_QCl = <>};

negate_Cl c = 
    {s = \\t,a,p,o => c.s!t!a!(case p of {Neg=>Pos; Pos=>Neg})!o;
     lock_Cl = <>};

-- disjunct_Utt u u' = ss (u.s ++ "eller" ++ u'.s);
-- disjunct_VP vp vp' = 
--     insertObj (\\agr => "eller" ++ (ImpVP vp').s!Pos!(agr.gn)) vp;


----------------------------------------------------------------------
-- verbs

see_V           = Irreg.se_V;

do_V2           = Lex.do_V2;
have_V2         = Lex.have_V2;
understand_V2   = Lex.understand_V2;

know_VQ         = mkVQ Irreg.veta_V;
wonder_VQ       = Lex.wonder_VQ;

say_VS          = Lex.say_VS;

fail_VV         = mkVV (mkV "misslyckas" "misslyckas" "misslyckas" "misslyckades" "misslyckats" "misslyckad");
like_VV         = want_VV;

----------------------------------------------------------------------
-- nouns, proper nouns, common nouns and noun phrases

information_N   = mk2N "information" "informationer";

you_NP          = UsePron youSg_Pron;

----------------------------------------------------------------------
-- closed word categories

of_på_Prep      = mkPrep "på";
for_Prep        = mkPrep "för";

not_Predet      = {s = \\_ => "inte"; lock_Predet = <>};

no_Quant        = {s = table {Sg => \\_ => table {Utr => "ingen"; 
						  Neutr => "inget"};
			      Pl => \\_,_ => "inga"};
		   det = DIndef;
		   lock_Quant = <>};

all_Quant       = {s = \\_,_ => "alla";
		   det = DIndef;
		   lock_QuantPl = <>};



----------------------------------------------------------------------

i_dont_want_to = ["jag vill inte"];

}