refreshing gfe example

This commit is contained in:
aarne
2006-03-01 17:36:34 +00:00
parent 3d1b3dcd91
commit 09e6c6c9a3
12 changed files with 125 additions and 10 deletions

View File

@@ -0,0 +1,12 @@
-- The Question grammar specialized to animals.
abstract Animals = Questions ** {
flags startcat=Phrase ;
fun
-- a lexicon of animals and actions among them
Dog, Cat, Mouse, Lion, Zebra : Entity ;
Chase, Eat, See : Action ;
}

View File

@@ -0,0 +1,16 @@
--# -path=.:present:prelude
--resource/english:resource/abstract:resource/../prelude
concrete AnimalsEng of Animals = QuestionsEng **
open LangEng, ParadigmsEng, IrregEng in {
lin
Dog = regN "dog" ;
Cat = regN "cat" ;
Mouse = mk2N "mouse" "mice" ;
Lion = regN "lion" ;
Zebra = regN "zebra" ;
Chase = dirV2 (regV "chase") ;
Eat = dirV2 eat_V ;
See = dirV2 see_V ;
}

View File

@@ -0,0 +1,15 @@
--# -path=.:present:prelude
concrete AnimalsFre of Animals = QuestionsFre **
open LangFre, ParadigmsFre, IrregFre in {
lin
Dog = regN "chien" masculine ;
Cat = regN "chat" masculine ;
Mouse = regN "souris" feminine ;
Lion = regN "lion" masculine ;
Zebra = regN "zèbre" masculine ;
Chase = dirV2 (regV "chasser") ;
Eat = dirV2 (regV "manger") ;
See = voir_V2 ;
}

View File

@@ -0,0 +1,15 @@
--# -path=.:present:prelude
concrete AnimalsSwe of Animals = QuestionsSwe **
open LangSwe, ParadigmsSwe, IrregSwe in {
lin
Dog = regN "hund" utrum ;
Cat = mk2N "katt" "katter" ;
Mouse = mkN "mus" "musen" "möss" "mössen" ;
Lion = mk2N "lejon" "lejon" ;
Zebra = regN "zebra" utrum ;
Chase = dirV2 (regV "jaga") ;
Eat = dirV2 äta_V ;
See = dirV2 se_V ;
}

View File

@@ -0,0 +1,10 @@
-- Simple questions and answers, in present tense.
abstract Questions = {
cat
Phrase ; Entity ; Action ;
fun
Who : Action -> Entity -> Phrase ; -- who chases X
Whom : Entity -> Action -> Phrase ; -- whom does X chase
Answer : Entity -> Action -> Entity -> Phrase ; -- X chases Y
}

View File

@@ -0,0 +1,2 @@
concrete QuestionsEng of Questions = QuestionsI with
(Lang = LangEng) ;

View File

@@ -0,0 +1,2 @@
concrete QuestionsFre of Questions = QuestionsI with
(Lang = LangFre) ;

View File

@@ -0,0 +1,22 @@
-- File generated by GF from QuestionsI.gfe
--# -resource=../../lib/resource-1.0/english/LangEng.gf
-- to compile: gf -examples QuestionsI.gfe
-- or use directly gf <mkAnimals.gfs
incomplete concrete QuestionsI of Questions = open Lang in {
lincat
Phrase = Phr ;
Entity = N ;
Action = V2 ;
lin
Who love_V2 man_N = PhrUtt NoPConj (UttAdv (AdvSC (EmbedQS (UseQCl TPres ASimul PPos (QuestVP whoSg_IP (ComplV2 love_V2 (DetCN (DetPl (PlQuant IndefArt) NoNum NoOrd) (UseN man_N)))))))) NoVoc ; -- AMBIGUOUS:
-- PhrUtt NoPConj (UttQS (UseQCl TPres ASimul PPos (QuestVP whoSg_IP (ComplV2 love_V2 (DetCN (DetPl (PlQuant IndefArt) NoNum NoOrd) (UseN man_N)))))) NoVoc ;
Whom man_N love_V2 = PhrUtt NoPConj (UttQS (UseQCl TPres ASimul PPos (QuestSlash whoPl_IP (SlashV2 (DetCN (DetSg (SgQuant DefArt) NoOrd) (UseN man_N)) love_V2)))) NoVoc ; -- AMBIGUOUS:
-- PhrUtt NoPConj (UttQS (UseQCl TPres ASimul PPos (QuestSlash whoSg_IP (SlashV2 (DetCN (DetSg (SgQuant DefArt) NoOrd) (UseN man_N)) love_V2)))) NoVoc ;
Answer woman_N love_V2 man_N = PhrUtt NoPConj (UttS (UseCl TPres ASimul PPos (PredVP (DetCN (DetSg (SgQuant DefArt) NoOrd) (UseN woman_N)) (ComplV2 love_V2 (DetCN (DetPl (PlQuant IndefArt) NoNum NoOrd) (UseN man_N)))))) NoVoc ;
}

View File

@@ -0,0 +1,17 @@
--# -resource=../../lib/resource-1.0/english/LangEng.gf
-- to compile: gf -examples QuestionsI.gfe
-- or use directly gf <mkAnimals.gfs
incomplete concrete QuestionsI of Questions = open Lang in {
lincat
Phrase = Phr ;
Entity = N ;
Action = V2 ;
lin
Who love_V2 man_N = in Phr "who loves men" ;
Whom man_N love_V2 = in Phr "whom does the man love" ;
Answer woman_N love_V2 man_N = in Phr "the woman loves men" ;
}

View File

@@ -0,0 +1,2 @@
concrete QuestionsSwe of Questions = QuestionsI with
(Lang = LangSwe) ;

View File

@@ -0,0 +1,4 @@
i -ex AnimalsEng.gf ;; s
i AnimalsFre.gf ;; s
i AnimalsSwe.gf ;; s
pm | wf animals.gfcm