forked from GitHub/gf-core
started Phrasebook with Finnish and Romanian
This commit is contained in:
8
examples/phrasebook/Food.gf
Normal file
8
examples/phrasebook/Food.gf
Normal file
@@ -0,0 +1,8 @@
|
||||
-- (c) 2009 Aarne Ranta under LGPL
|
||||
|
||||
abstract Food = Sentences ** {
|
||||
fun
|
||||
Wine, Cheese, Fish, Pizza : Kind ;
|
||||
Fresh, Warm, Italian,
|
||||
Expensive, Delicious, Boring : Quality ;
|
||||
}
|
||||
24
examples/phrasebook/FoodFin.gf
Normal file
24
examples/phrasebook/FoodFin.gf
Normal file
@@ -0,0 +1,24 @@
|
||||
-- (c) 2009 Aarne Ranta under LGPL
|
||||
|
||||
concrete FoodFin of Food = SentencesFin **
|
||||
open SyntaxFin, ParadigmsFin in {
|
||||
lin
|
||||
Wine = mkCN (mkN "viini") ;
|
||||
Pizza = mkCN (mkN "pizza") ;
|
||||
Cheese = mkCN (mkN "juusto") ;
|
||||
Fish = mkCN (mkN "kala") ;
|
||||
Fresh = mkAP (mkA "tuore") ;
|
||||
Warm = mkAP (mkA
|
||||
(mkN "lämmin" "lämpimän" "lämmintä" "lämpimänä" "lämpimään"
|
||||
"lämpiminä" "lämpimiä" "lämpimien" "lämpimissä" "lämpimiin"
|
||||
)
|
||||
"lämpimämpi" "lämpimin") ;
|
||||
Italian = mkAP (mkA "italialainen") ;
|
||||
Expensive = mkAP (mkA "kallis") ;
|
||||
Delicious = mkAP (mkA "herkullinen") ;
|
||||
Boring = mkAP (mkA "tylsä") ;
|
||||
|
||||
-- oper ---- optimization lasts forever
|
||||
-- mkCNN : Str -> CN = \s -> mkCN (mkN s) ;
|
||||
-- mkAPA : Str -> AP = \s -> mkAP (mkA s) ;
|
||||
}
|
||||
26
examples/phrasebook/FoodRon.gf
Normal file
26
examples/phrasebook/FoodRon.gf
Normal file
@@ -0,0 +1,26 @@
|
||||
-- (c) 2009 Ramona Enache under LGPL
|
||||
|
||||
concrete FoodRon of Food = SentencesRon ** open
|
||||
SyntaxRon,
|
||||
ParadigmsRon in
|
||||
{
|
||||
flags coding=utf8 ;
|
||||
|
||||
lin
|
||||
|
||||
Wine = mkCN (mkN "vin" "vinuri" neuter) ;
|
||||
Cheese = mkCN (mkN "brânzã" "brânzeturi" feminine) ;
|
||||
Fish = mkCN (mkN "peºte" "peºti" masculine) ;
|
||||
Pizza = mkCN (mkN "pizza" "pizze" feminine) ;
|
||||
|
||||
Fresh = mkAPA "proaspãt" "proaspãtã" "proaspeþi" "proaspete" ;
|
||||
Warm = mkAPA "cald" "caldã" "calzi" "calde" ;
|
||||
Italian = mkAPA "italian" "italianã" "italieni" "italiene" ;
|
||||
Expensive = mkAPA "scump" "scumpã" "scumpi" "scumpe" ;
|
||||
Delicious = mkAPA "delicios" "delcioasã" "delicioºi" "delicioase" ;
|
||||
Boring = mkAPA "plictisitor" "plictisitoare" "plictisitori" "plictisitoare" ;
|
||||
|
||||
oper
|
||||
mkAPA : (_,_,_,_ : Str) -> AP = \x,y,z,u -> mkAP (mkA x y z u) ;
|
||||
|
||||
}
|
||||
37
examples/phrasebook/Greetings.gf
Normal file
37
examples/phrasebook/Greetings.gf
Normal file
@@ -0,0 +1,37 @@
|
||||
abstract Greetings = {
|
||||
|
||||
cat
|
||||
Greeting ;
|
||||
Politeness ;
|
||||
|
||||
fun
|
||||
GHello : Greeting ;
|
||||
GThanks : Greeting ;
|
||||
GHowAreYou : Greeting ;
|
||||
GPleaseGive : Greeting ;
|
||||
GExcuse : Greeting ;
|
||||
GSorry : Greeting ;
|
||||
GGoodbye : Greeting ;
|
||||
GBye : Greeting ;
|
||||
GWhatsYourName : Greeting ;
|
||||
GNiceToMeetYou : Greeting ;
|
||||
GSeeYouSoon : Greeting ;
|
||||
GHelp : Greeting ;
|
||||
GLookOut : Greeting ;
|
||||
GGoodMorning : Greeting ;
|
||||
GGoodDay : Greeting ;
|
||||
GGoodEvening : Greeting ;
|
||||
GGoodNight : Greeting ;
|
||||
GImHungry : Greeting ;
|
||||
GImThirsty : Greeting ;
|
||||
GImTired : Greeting ;
|
||||
GImScared : Greeting ;
|
||||
GIdontUnderstand : Greeting ;
|
||||
GWheresTheBathroom : Greeting ;
|
||||
GTheCheck : Greeting ;
|
||||
|
||||
GYes : Greeting ;
|
||||
GNo : Greeting ;
|
||||
|
||||
|
||||
}
|
||||
38
examples/phrasebook/GreetingsFin.gf
Normal file
38
examples/phrasebook/GreetingsFin.gf
Normal file
@@ -0,0 +1,38 @@
|
||||
concrete GreetingsFin of Greetings = open Prelude in {
|
||||
|
||||
flags coding=utf8 ;
|
||||
|
||||
lincat
|
||||
Greeting, Politeness = SS ;
|
||||
|
||||
lin
|
||||
GHello = ss "hei" ;
|
||||
GThanks = ss "kiitos" ;
|
||||
GHowAreYou = ss "mitä kuuluu" ;
|
||||
GPleaseGive = ss "ole hyvä" ;
|
||||
GExcuse = ss "anteeksi" ;
|
||||
GSorry = ss "anteeksi" ;
|
||||
GGoodbye = ss "näkemiin" ;
|
||||
GBye = ss "hei hei" ;
|
||||
GWhatsYourName = ss "mikä sinun nimesi on" ;
|
||||
GNiceToMeetYou = ss "hauska tutustua" ;
|
||||
GSeeYouSoon = ss "nähdään pian" ;
|
||||
GHelp = ss "apua" ;
|
||||
GLookOut = ss "varo" ;
|
||||
GGoodMorning = ss "hyvää huomenta" ;
|
||||
GGoodDay = ss "hyvää päivää" ;
|
||||
GGoodEvening = ss "hyvää iltaa" ;
|
||||
GGoodNight = ss "hyvää yötä" ;
|
||||
GImHungry = ss "minun on nälkä" ;
|
||||
GImThirsty = ss "minun on jano" ;
|
||||
GImTired = ss "minä olen väsynyt" ;
|
||||
GImScared = ss "minua pelottaa" ;
|
||||
GIdontUnderstand = ss "en ymmärrä" ;
|
||||
GWheresTheBathroom = ss "missä on vessa" ;
|
||||
GTheCheck = ss "lasku" ;
|
||||
|
||||
GYes = ss "kyllä" ;
|
||||
GNo = ss "ei" ;
|
||||
|
||||
|
||||
}
|
||||
38
examples/phrasebook/GreetingsRon.gf
Normal file
38
examples/phrasebook/GreetingsRon.gf
Normal file
@@ -0,0 +1,38 @@
|
||||
concrete GreetingsRon of Greetings = open Prelude in {
|
||||
|
||||
flags coding = utf8 ;
|
||||
|
||||
lincat
|
||||
Greeting, Politeness = SS ;
|
||||
|
||||
lin
|
||||
GHello = ss "salut" ;
|
||||
GThanks = ss "mulţumesc" ;
|
||||
GHowAreYou = ss "ce faci" ;
|
||||
GPleaseGive = ss "vă rog" ;
|
||||
GExcuse = ss "pardon" ;
|
||||
GSorry = ss "îmi pare rău" ;
|
||||
GGoodbye = ss "la revedere" ;
|
||||
GBye = ss "pa" ;
|
||||
GWhatsYourName = ss "cum te cheamă" ;
|
||||
GNiceToMeetYou = ss "încântat" ;
|
||||
GSeeYouSoon = ss "pe curând" ;
|
||||
GHelp = ss "ajutor" ;
|
||||
GLookOut = ss "atenţie" ;
|
||||
GGoodMorning = ss "bună dimineaţa" ;
|
||||
GGoodDay = ss "bună ziua" ;
|
||||
GGoodEvening = ss "bună seara" ;
|
||||
GGoodNight = ss "noapte bună" ;
|
||||
GImHungry = ss "mi-e foame" ;
|
||||
GImThirsty = ss "mi-e sete" ;
|
||||
GImTired = ss "mi-e somn" ;
|
||||
GImScared = ss "mi-e frică" ;
|
||||
GIdontUnderstand = ss "nu înţeleg" ;
|
||||
GWheresTheBathroom = ss "unde e toaleta" ;
|
||||
GTheCheck = ss "nota de plată" ;
|
||||
|
||||
GYes = ss "da" ;
|
||||
GNo = ss "nu" ;
|
||||
|
||||
|
||||
}
|
||||
16
examples/phrasebook/Phrasebook.gf
Normal file
16
examples/phrasebook/Phrasebook.gf
Normal file
@@ -0,0 +1,16 @@
|
||||
abstract Phrasebook =
|
||||
Greetings,
|
||||
Food
|
||||
** {
|
||||
|
||||
flags startcat = Phrase ;
|
||||
|
||||
cat
|
||||
Phrase ;
|
||||
fun
|
||||
PNumeral : Numeral -> Phrase ;
|
||||
PGreeting : Greeting -> Phrase ;
|
||||
PSentence : Sentence -> Phrase ;
|
||||
|
||||
|
||||
}
|
||||
23
examples/phrasebook/PhrasebookFin.gf
Normal file
23
examples/phrasebook/PhrasebookFin.gf
Normal file
@@ -0,0 +1,23 @@
|
||||
--# -path=.:present
|
||||
|
||||
concrete PhrasebookFin of Phrasebook =
|
||||
GreetingsFin,
|
||||
FoodFin ** open
|
||||
SyntaxFin,
|
||||
ResFin, ---- for Num to Utt
|
||||
Prelude in {
|
||||
|
||||
lincat
|
||||
Phrase = Utt ;
|
||||
|
||||
lin
|
||||
PNumeral n =
|
||||
mkPhrase (ss ((SyntaxFin.mkCard <n : Numeral>).s ! Sg ! Nom)) ; ----
|
||||
PGreeting g = mkPhrase g ;
|
||||
PSentence s = s ;
|
||||
|
||||
|
||||
oper
|
||||
mkPhrase : SS -> Utt = \s -> lin Utt s ;
|
||||
|
||||
}
|
||||
22
examples/phrasebook/PhrasebookRon.gf
Normal file
22
examples/phrasebook/PhrasebookRon.gf
Normal file
@@ -0,0 +1,22 @@
|
||||
--# -path=.:present
|
||||
|
||||
concrete PhrasebookRon of Phrasebook =
|
||||
GreetingsRon,
|
||||
FoodRon
|
||||
** open
|
||||
SyntaxRon,
|
||||
ResRon, ---- for Num to Utt
|
||||
Prelude in {
|
||||
|
||||
lincat
|
||||
Phrase = Utt ;
|
||||
|
||||
lin
|
||||
PNumeral n = mkPhrase (ss ((mkCard <n : Numeral>).sp ! Masc)) ; ----
|
||||
PGreeting g = mkPhrase g ;
|
||||
PSentence s = s ;
|
||||
|
||||
oper
|
||||
mkPhrase : SS -> Utt = \s -> lin Utt s ;
|
||||
|
||||
}
|
||||
20
examples/phrasebook/Sentences.gf
Normal file
20
examples/phrasebook/Sentences.gf
Normal file
@@ -0,0 +1,20 @@
|
||||
abstract Sentences = Numeral ** {
|
||||
|
||||
cat
|
||||
Sentence ; Object ; Item ; Kind ; Quality ;
|
||||
|
||||
fun
|
||||
Is : Item -> Quality -> Sentence ;
|
||||
IsNot : Item -> Quality -> Sentence ;
|
||||
|
||||
IWant : Object -> Sentence ;
|
||||
DoYouHave : Kind -> Sentence ;
|
||||
WhetherIs : Item -> Quality -> Sentence ;
|
||||
ObjItem : Item -> Object ;
|
||||
ObjNumber : Numeral -> Kind -> Object ;
|
||||
|
||||
This, That, These, Those : Kind -> Item ;
|
||||
SuchKind : Quality -> Kind -> Kind ;
|
||||
Very : Quality -> Quality ;
|
||||
|
||||
}
|
||||
2
examples/phrasebook/SentencesFin.gf
Normal file
2
examples/phrasebook/SentencesFin.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete SentencesFin of Sentences = NumeralFin ** SentencesI with
|
||||
(Syntax = SyntaxFin) ;
|
||||
25
examples/phrasebook/SentencesI.gf
Normal file
25
examples/phrasebook/SentencesI.gf
Normal file
@@ -0,0 +1,25 @@
|
||||
incomplete concrete SentencesI of Sentences = Numeral **
|
||||
open Syntax in {
|
||||
lincat
|
||||
Sentence = Utt ;
|
||||
Item = NP ;
|
||||
Kind = CN ;
|
||||
Quality = AP ;
|
||||
Object = NP ;
|
||||
lin
|
||||
Is item quality = mkUtt (mkCl item quality) ;
|
||||
IsNot item quality = mkUtt (mkS negativePol (mkCl item quality)) ;
|
||||
WhetherIs item quality = mkUtt (mkQCl (mkCl item quality)) ;
|
||||
IWant obj = mkUtt (mkCl (mkNP i_Pron) want_VV (mkVP have_V2 obj)) ;
|
||||
DoYouHave kind =
|
||||
mkUtt (mkQCl (mkCl (mkNP youPol_Pron) have_V2 (mkNP kind))) ;
|
||||
ObjItem i = i ;
|
||||
ObjNumber n k = mkNP <n : Numeral> k ;
|
||||
|
||||
This kind = mkNP this_Quant kind ;
|
||||
That kind = mkNP that_Quant kind ;
|
||||
These kind = mkNP this_Quant plNum kind ;
|
||||
Those kind = mkNP that_Quant plNum kind ;
|
||||
SuchKind quality kind = mkCN quality kind ;
|
||||
Very quality = mkAP very_AdA quality ;
|
||||
}
|
||||
2
examples/phrasebook/SentencesRon.gf
Normal file
2
examples/phrasebook/SentencesRon.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete SentencesRon of Sentences = NumeralRon ** SentencesI with
|
||||
(Syntax = SyntaxRon) ;
|
||||
Reference in New Issue
Block a user