1
0
forked from GitHub/gf-core

updated resource example

This commit is contained in:
aarne
2005-05-22 11:55:53 +00:00
parent 52b81f08a8
commit 60427e170c
14 changed files with 101 additions and 90 deletions

View File

@@ -1,12 +1,10 @@
abstract Animals = {
cat
Phrase ; Animal ; Action ;
fun
Who : Action -> Animal -> Phrase ;
Whom : Animal -> Action -> Phrase ;
Answer : Animal -> Action -> Animal -> Phrase ;
-- The Question grammar specialized to animals.
Dog, Cat, Mouse, Lion, Zebra : Animal ;
abstract Animals = Questions ** {
fun
-- a lexicon of animals and actions among them
Dog, Cat, Mouse, Lion, Zebra : Entity ;
Chase, Eat, Like : Action ;
}

View File

@@ -1,37 +1,15 @@
--# -path=.:resource/english:resource/abstract:resource/../prelude
concrete AnimalsEng of Animals = open ResourceEng, ParadigmsEng, VerbsEng in {
lincat
Phrase = Phr ;
Animal = N ;
Action = V2 ;
concrete AnimalsEng of Animals = QuestionsEng **
open ResourceEng, ParadigmsEng, VerbsEng in {
lin
Who act obj = QuestPhrase (UseQCl (PosTP TPresent ASimul)
(QPredV2 who8one_IP act (IndefNumNP NoNum (UseN obj)))) ;
Whom subj act = QuestPhrase (UseQCl (PosTP TPresent ASimul)
(IntSlash who8one_IP (SlashV2 (DefOneNP (UseN subj)) act))) ;
Answer subj act obj = IndicPhrase (UseCl (PosTP TPresent ASimul)
(SPredV2 (DefOneNP (UseN subj)) act (IndefNumNP NoNum (UseN obj)))) ;
Dog = regN "dog" ;
Cat = regN "cat" ;
Mouse = mk2N "mouse" "mice" ;
Lion = regN "lion" ;
Zebra = regN "zebra" ;
Chase = dirV2 (regV "chase") ;
Eat = dirV2 (eat_V ** {lock_V = <>}) ;
Eat = dirV2 eat_V ;
Like = dirV2 (regV "like") ;
}
{-
> p -cat=Phr "who likes cars ?"
QuestPhrase (UseQCl (PosTP TPresent ASimul) (QPredV2 who8one_IP like_V2 (IndefNumNP NoNum (UseN car_N))))
QuestPhrase (UseQCl (PosTP TPresent ASimul) (IntSlash who8one_IP (SlashV2 (DefOneNP (UseN car_N)) like_V2)))
> p -cat=Phr "the house likes cars ."
IndicPhrase (UseCl (PosTP TPresent ASimul) (SPredV2 (DefOneNP (UseN house_N)) like_V2 (IndefNumNP NoNum (UseN car_N))))
-}

View File

@@ -1,21 +1,9 @@
--# -path=.:resource/french:resource/romance:resource/abstract:resource/../prelude
concrete AnimalsFre of Animals =
open
--- ResourceFre,
RulesFre, StructuralFre, VerbphraseFre,
ParadigmsFre, VerbsFre in {
lincat
Phrase = Phr ;
Animal = N ;
Action = V2 ;
concrete AnimalsFre of Animals = QuestionsFre **
open ResourceFre, ParadigmsFre, VerbsFre in {
lin
Who act obj = QuestPhrase (UseQCl (PosTP TPresent ASimul)
(IntVP who8one_IP (ComplV2 act (DefNumNP NoNum (UseN obj))))) ;
Whom subj act = QuestPhrase (UseQCl (PosTP TPresent ASimul)
(IntSlash who8one_IP (SlashV2 (DefOneNP (UseN subj)) act))) ;
Answer subj act obj = IndicPhrase (UseCl (PosTP TPresent ASimul)
(PredVP (DefOneNP (UseN subj)) (ComplV2 act (DefNumNP NoNum (UseN obj))))) ;
Dog = regN "chien" masculine ;
Cat = regN "chat" masculine ;
Mouse = regN "souris" feminine ;

View File

@@ -1,17 +1,9 @@
--# -path=.:resource/swedish:resource/scandinavian:resource/abstract:resource/../prelude
concrete AnimalsSwe of Animals = open ResourceSwe, ParadigmsSwe, VerbsSwe in {
lincat
Phrase = Phr ;
Animal = N ;
Action = V2 ;
concrete AnimalsSwe of Animals = QuestionsSwe **
open ResourceSwe, ParadigmsSwe, VerbsSwe in {
lin
Who act obj = QuestPhrase (UseQCl (PosTP TPresent ASimul)
(QPredV2 who8one_IP act (IndefNumNP NoNum (UseN obj)))) ;
Whom subj act = QuestPhrase (UseQCl (PosTP TPresent ASimul)
(IntSlash who8one_IP (SlashV2 (DefOneNP (UseN subj)) act))) ;
Answer subj act obj = IndicPhrase (UseCl (PosTP TPresent ASimul)
(SPredV2 (DefOneNP (UseN subj)) act (IndefNumNP NoNum (UseN obj)))) ;
Dog = regN "hund" utrum ;
Cat = mk2N "katt" "katter" ;
Mouse = mkN "mus" "musen" "möss" "mössen" ;

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
(Resource = ResourceEng) ;

View File

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

View File

@@ -0,0 +1,20 @@
--# -path=.:resource/abstract:resource/../prelude
-- Language-independent question grammar parametwized on Resource.
incomplete concrete QuestionsI of Questions = open Resource in {
lincat
Phrase = Phr ;
Entity = N ;
Action = V2 ;
lin
Who act obj =
QuestPhrase (UseQCl (PosTP TPresent ASimul)
(QPredV2 who8one_IP act (IndefNumNP NoNum (UseN obj)))) ;
Whom subj act =
QuestPhrase (UseQCl (PosTP TPresent ASimul)
(IntSlash who8one_IP (SlashV2 (DefOneNP (UseN subj)) act))) ;
Answer subj act obj =
IndicPhrase (UseCl (PosTP TPresent ASimul)
(SPredV2 (DefOneNP (UseN subj)) act (IndefNumNP NoNum (UseN obj)))) ;
}

View File

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