1
0
forked from GitHub/gf-core

completions of PhrasebookGer

This commit is contained in:
aarne
2010-04-12 21:26:36 +00:00
parent 93e3635bea
commit 1668caf59c
4 changed files with 53 additions and 13 deletions

View File

@@ -1,9 +1,13 @@
compile = runghc Compile compile = runghc Compile
all: demo missing all: fin demo missing
demo: demo: compdemo linkdemo
compdemo:
$(compile) Eng Fre Ger Ita Ron Swe DisambPhrasebookEng $(compile) Eng Fre Ger Ita Ron Swe DisambPhrasebookEng
linkdemo:
$(compile) -link Eng Fin Fre Ger Ita Ron Swe DisambPhrasebookEng $(compile) -link Eng Fin Fre Ger Ita Ron Swe DisambPhrasebookEng
#separate, because slow... #separate, because slow...

View File

@@ -244,7 +244,8 @@ Notice that also negations and questions can be formed from these.
AWantGo : Person -> Place -> Action ; -- I want to go to the hospital AWantGo : Person -> Place -> Action ; -- I want to go to the hospital
</pre> </pre>
miscellaneous phrases Miscellaneous phrases. Notice that also negations and questions can be formed from
propositions.
<pre> <pre>
QWhatAge : Person -> Question ; -- how many years are you QWhatAge : Person -> Question ; -- how many years are you
QWhatName : Person -> Question ; -- what is your name QWhatName : Person -> Question ; -- what is your name

View File

@@ -1,7 +1,7 @@
-- (c) 2009 Aarne Ranta under LGPL -- (c) 2009 Aarne Ranta under LGPL
concrete WordsGer of Words = SentencesGer ** concrete WordsGer of Words = SentencesGer **
open SyntaxGer, ParadigmsGer, IrregGer, (L = LexiconGer), Prelude in { open SyntaxGer, ParadigmsGer, IrregGer, (L = LexiconGer), ExtraGer, Prelude in {
lin lin
@@ -23,6 +23,7 @@ concrete WordsGer of Words = SentencesGer **
-- properties -- properties
Bad = L.bad_A ; Bad = L.bad_A ;
Cheap = mkA "billig" ;
Boring = mkA "langweilig" ; Boring = mkA "langweilig" ;
Cold = L.cold_A ; Cold = L.cold_A ;
Delicious = mkA "lecker" ; Delicious = mkA "lecker" ;
@@ -46,11 +47,11 @@ concrete WordsGer of Words = SentencesGer **
-- currencies -- currencies
DanishCrown = mkCN (mkA "Dänisch") (mkN "Krone") ; DanishCrown = mkCN (mkA "Dänisch") (mkN "Krone") | mkCN (mkN "Krone") ;
-- Dollar = mkCN (mkN "dollar" "dollar") ; -- Dollar = mkCN (mkN "dollar" "dollar") ;
Euro = mkCN (mkN "Euro" "Euro" "Euro" "Euro" "Euro" "Euro" neuter) ; Euro = mkCN (mkN "Euro" "Euro" "Euro" "Euro" "Euro" "Euro" neuter) ;
-- Lei = mkCN (mkN "lei" "lei") ; -- Lei = mkCN (mkN "lei" "lei") ;
-- SwedishCrown = mkCN (mkA "svensk") (mkN "krona") ; SwedishCrown = mkCN (mkA "Schwedisch") (mkN "Krone") | mkCN (mkN "Krone") ;
-- nationalities -- nationalities
@@ -58,21 +59,31 @@ concrete WordsGer of Words = SentencesGer **
Belgium = mkNP (mkPN "Belgien") ; Belgium = mkNP (mkPN "Belgien") ;
English = mkNat "Englisch" "England" ; English = mkNat "Englisch" "England" ;
Finnish = mkNat "Finnisch" "Finnland" ; Finnish = mkNat "Finnisch" "Finnland" ;
-- Flemish = mkNP (mkPN "flamländska") ; Flemish = mkNP (mkPN "Flämisch") ;
French = mkNat "Französisch" "Frankreich" ; French = mkNat "Französisch" "Frankreich" ;
Italian = mkNat "Italienisch" "Italien" ; Italian = mkNat "Italienisch" "Italien" ;
-- Romanian = mkNat "rumänsk" "Rumänien" ; Romanian = mkNat "Rumänisch" "Rumänien" ;
-- Swedish = mkNat "svensk" "Sverige" ; Swedish = mkNat "Schwedisch" "Schweden" ;
--
-- -- actions
-- actions
AHasAge p num = mkCl p.name (mkNP num L.year_N) ;
AHasName p name = mkCl p.name (mkV2 heißen_V) name ; AHasName p name = mkCl p.name (mkV2 heißen_V) name ;
AHungry p = mkCl p.name (mkA "hungrig") ; AHungry p = mkCl p.name (mkA "hungrig") ;
AHasChildren p num = mkCl p.name have_V2 (mkNP num L.child_N) ;
AHasRoom p num = mkCl p.name have_V2
(mkNP (mkNP a_Det (mkN "Zimmer" "Zimmer" neuter))
(SyntaxGer.mkAdv for_Prep (mkNP num (mkN "Persone")))) ;
AHasTable p num = mkCl p.name have_V2
(mkNP (mkNP a_Det (mkN "Tisch"))
(SyntaxGer.mkAdv for_Prep (mkNP num (mkN "Persone")))) ;
AIll p = mkCl p.name (mkA "Krank") ; AIll p = mkCl p.name (mkA "Krank") ;
AKnow p = mkCl p.name wissen_V ; AKnow p = mkCl p.name wissen_V ;
ALike p item = mkCl item (mkV2 (fixprefixV "ge" (fallen_V)) dative) p.name ; ALike p item = mkCl item (mkV2 (fixprefixV "ge" (fallen_V)) dative) p.name ;
ALive p co = mkCl p.name (mkVP (mkVP (mkV "wohnen")) (SyntaxGer.mkAdv in_Prep co)) ; ALive p co = mkCl p.name (mkVP (mkVP (mkV "wohnen")) (SyntaxGer.mkAdv in_Prep co)) ;
ALove p q = mkCl p.name (mkV2 (mkV "lieben")) q.name ; ALove p q = mkCl p.name (mkV2 (mkV "lieben")) q.name ;
AMarried p = mkCl p.name (mkA "verheiratet") ;
AReady p = mkCl p.name (mkA "fertig") ;
AScared p = mkCl p.name have_V2 (mkNP (mkN "Angst" "Angsten" feminine)) ; AScared p = mkCl p.name have_V2 (mkNP (mkN "Angst" "Angsten" feminine)) ;
ASpeak p lang = mkCl p.name (mkV2 sprechen_V) lang ; ASpeak p lang = mkCl p.name (mkV2 sprechen_V) lang ;
AThirsty p = mkCl p.name (mkA "dürstig") ; AThirsty p = mkCl p.name (mkA "dürstig") ;
@@ -84,6 +95,7 @@ concrete WordsGer of Words = SentencesGer **
-- miscellaneous -- miscellaneous
QWhatName p = mkQS (mkQCl how_IAdv (mkCl p.name heißen_V)) ; QWhatName p = mkQS (mkQCl how_IAdv (mkCl p.name heißen_V)) ;
QWhatAge p = mkQS (mkQCl (ICompAP (mkAP L.old_A)) p.name) ;
PropOpen p = mkCl p.name open_Adv ; PropOpen p = mkCl p.name open_Adv ;
PropClosed p = mkCl p.name closed_Adv ; PropClosed p = mkCl p.name closed_Adv ;
@@ -95,6 +107,24 @@ concrete WordsGer of Words = SentencesGer **
HowMuchCost item = mkQS (mkQCl how8much_IAdv (mkCl item (mkV "kosten"))) ; HowMuchCost item = mkQS (mkQCl how8much_IAdv (mkCl item (mkV "kosten"))) ;
ItCost item price = mkCl item (mkV2 (mkV "kosten")) price ; ItCost item price = mkCl item (mkV2 (mkV "kosten")) price ;
-- Building phrases from strings is complicated: the solution is to use
-- mkText : Text -> Text -> Text ;
-- PSeeYou d = mkText (lin Text (ss ("auf Wiedersehen"))) (mkPhrase (mkUtt d)) ;
-- PSeeYouPlace p d =
-- mkText (lin Text (ss ("auf Wiedersehen")))
-- (mkText (mkPhrase (mkUtt p.at)) (mkPhrase (mkUtt d))) ;
-- Relations are expressed as "my wife" or "my son's wife", as defined by $xOf$
-- below. Languages without productive genitives must use an equivalent of
-- "the wife of my son" for non-pronouns.
Wife = xOf sing (mkN "Frau" "Frauen" feminine) ;
Husband = xOf sing L.man_N ;
Son = xOf sing (mkN "Sohn" "Söhne" masculine) ;
Daughter = xOf sing (mkN "Tochter" "Töchter" feminine) ;
Children = xOf plur L.child_N ;
-- week days -- week days
Monday = mkDay "Montag" ; Monday = mkDay "Montag" ;
@@ -105,6 +135,9 @@ concrete WordsGer of Words = SentencesGer **
Saturday = mkDay "Samstag" ; Saturday = mkDay "Samstag" ;
Sunday = mkDay "Sonntag" ; Sunday = mkDay "Sonntag" ;
Tomorrow = ParadigmsGer.mkAdv "morgen" ;
oper oper
mkNat : Str -> Str -> {lang : NP ; prop : A ; country : NP} = \nat,co -> mkNat : Str -> Str -> {lang : NP ; prop : A ; country : NP} = \nat,co ->
{lang = mkNP (mkPN nat) ; {lang = mkNP (mkPN nat) ;
@@ -126,4 +159,6 @@ concrete WordsGer of Words = SentencesGer **
open_Adv = mkAdv "geöffnet" ; ---- Adv to get right word order easily open_Adv = mkAdv "geöffnet" ; ---- Adv to get right word order easily
closed_Adv = mkAdv "geschlossen" ; closed_Adv = mkAdv "geschlossen" ;
xOf : GNumber -> N -> NPPerson -> NPPerson = \n,x,p -> mkRelative n (mkCN x) p ;
} }

View File

@@ -1,8 +1,8 @@
DisambPhrasebookEng : DisambPhrasebookEng :
PhrasebookEng : PhrasebookEng :
PhrasebookFin : PhrasebookFin :
PhrasebookFre : AHasRoom AHasTable AReady Cheap Cinema Hotel PSeeYou PSeeYouPlace Park School Shop Suspect Theatre Tomorrow University PhrasebookFre :
PhrasebookGer : AHasAge AHasChildren AHasRoom AHasTable AMarried AReady Bar Cheap Chicken Children Cinema Coffee Daughter Dollar Flemish GNiceToMeetYou Hotel Husband Lei Meat Museum PSeeYou PSeeYouPlace Park QWhatAge Romanian School Shop Son Suspect Swedish SwedishCrown Tea Theatre Toilet Tomorrow Wife PhrasebookGer : Bar Chicken Cinema Coffee Dollar GNiceToMeetYou Hotel Lei Meat Museum PSeeYou PSeeYouPlace Park School Shop Suspect Tea Theatre Toilet
PhrasebookIta : PhrasebookIta :
PhrasebookRon : AHungry AThirsty Flemish GExcusePol GPleaseGivePol GSorryPol PhrasebookRon : AHungry AThirsty Flemish GExcusePol GPleaseGivePol GSorryPol
PhrasebookSwe : PhrasebookSwe :