summaryrefslogtreecommitdiff
path: root/examples/godis-tram/Common/GodisLangFin.gf
blob: bc7f6265281c1685e5c102b4f5b5540c66a132bc (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
151
152
153
154
--# -path=.:prelude:alltenses

instance GodisLangFin of GodisLang = 
    open Prelude, PredefCnc, GrammarFin, 
         ParadigmsFin, (ResFin=ResFin), ParamX, ConstructX, 
         (Lex=LangFin) in {

--flags optimize = noexpand ;

oper

TODO : (a : Type) -> a = Predef.error "TODO" ;

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

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


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

userGreet = ss ["hei"];
userQuit  = ss (variants{ ["näkemiin"]; ["lopetetaan"] });
userNo    = ss ["ei"];
userYes   = ss ["kyllä"];
userOkay  = variants { ss ["okei"]; ss ["selvä"] };

userCoordinate x y = ss (x.s ++ "ja" ++ optStr "sitten" ++ y.s);

thank_you_Str = variants {"kiitos"; "loistavaa"; "kiitti"};
i_want_to_Str = variants {"haluan"; "haluaisin"} ;

please_Str    = ["ole hyvä"] ;
this_that_Str = variants{"tämä"; "tuo"};

not_user_prop  p = ss ( Predef.toStr Predet not_Predet ++ p.s );
not_user_short a = ss ( Predef.toStr Predet not_Predet ++ a.s );

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

hello           = mkUtt ["Valmis"];
goodbye         = mkUtt ["Näkemiin"];
yes             = mkUtt ["Kyllä"];
no              = mkUtt ["Ei"];

is_that_correct_Post   = mkUtt [", pitääkö paikkansa"];
returning_to_Pre       = mkUtt ["Takaisin kohtaan"];
returning_to_act_Pre   = mkUtt ["Takaisin kohtaan"];
returning_to_issue_Pre = mkUtt ["Takaisin aiheeseen"];
what_did_you_say       = mkUtt ["Mitä sanoit"];
what_do_you_mean       = mkUtt ["Mitä tarkoitat"];
i_dont_understand      = mkUtt ["Anteeksi, en ymmärrä"];
cant_answer_que_Pre    = mkUtt ["Anteeksi, en tiedä mitään aiheesta"];
not_valid_Post         = mkUtt ["ei ole mahdollinen vaihtoehto"];

icm_acc_pos     = variants { mkUtt ["Okei"]; mkUtt thank_you_Str }; 
icm_con_neg     = mkUtt ["No?"];
icm_reraise     = mkUtt ["No niin, "];
icm_loadplan    = mkUtt ["Katsotaan"];
icm_accommodate = mkUtt ["Selvä"];

icm_per_pos   x = mkUtt (["Luulin että sanoit että"] ++ x.s);


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

sing_NP    s = mkNP (nLinux s) singular ; ----
plur_NP    s = mkNP (nLinux s) plural ;

NPgen_NP np1 np2 = AdvNP np2 (PrepNP possess_Prep np1) ; ----

NP_Cl np = TODO Cl ;

prefix_N n1 n2 = n2 ; ----

----------------------------------------------------------------------
-- verb phrases, actions

VPing  vp = case vp.clform of {
  HasDone => vp; 
  IsDoing => ProgrVP vp
  };

vp2Utt vp = UttVP vp ;


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

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

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

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

see_V           = Lex.see_V2 ** {lock_V = <>}; ----

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

know_VQ         = mkVQ (reg2V "tietää" "tiesi") ;
wonder_VQ       = Lex.wonder_VQ;

say_VS          = Lex.say_VS;

fail_VV         = mkVV (regV "epäonnistua");
like_VV         = mkVV (regV "haluta"); ----

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

information_N   = regN "informaatio";

you_NP          = UsePron Lex.youSg_Pron;

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

of_på_Prep      = casePrep genitive ;
for_Prep        = casePrep allative ;

not_Predet      = {s = \\n,c => "ei" ; lock_Predet = <>} ; ----

no_Quant        = TODO Quant ;
all_Quant       = TODO QuantPl ;


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

i_dont_want_to = variants { ["en halua"];
                            ["en tahdo"] };

-- Finnish-specific

-- local cases in free variation

in_Case   : Case = variants {adessive ; inessive} ;
to_Case   : Case = variants {allative ; illative} ;
from_Case : Case = variants {ablative ; elative} ;

}