mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
resource = resource-1.0
This commit is contained in:
12
lib/resource-0.9/doc/example/Animals.gf
Normal file
12
lib/resource-0.9/doc/example/Animals.gf
Normal 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 ;
|
||||
}
|
||||
|
||||
15
lib/resource-0.9/doc/example/AnimalsEng.gf
Normal file
15
lib/resource-0.9/doc/example/AnimalsEng.gf
Normal file
@@ -0,0 +1,15 @@
|
||||
--# -path=.:resource/english:resource/abstract:resource/../prelude
|
||||
|
||||
concrete AnimalsEng of Animals = QuestionsEng **
|
||||
open ResourceEng, ParadigmsEng, VerbsEng 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 ;
|
||||
}
|
||||
15
lib/resource-0.9/doc/example/AnimalsFre.gf
Normal file
15
lib/resource-0.9/doc/example/AnimalsFre.gf
Normal file
@@ -0,0 +1,15 @@
|
||||
--# -path=.:resource/french:resource/romance:resource/abstract:resource/../prelude
|
||||
|
||||
concrete AnimalsFre of Animals = QuestionsFre **
|
||||
open ResourceFre, ParadigmsFre, VerbsFre 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 ;
|
||||
}
|
||||
15
lib/resource-0.9/doc/example/AnimalsSwe.gf
Normal file
15
lib/resource-0.9/doc/example/AnimalsSwe.gf
Normal file
@@ -0,0 +1,15 @@
|
||||
--# -path=.:resource/swedish:resource/scandinavian:resource/abstract:resource/../prelude
|
||||
|
||||
concrete AnimalsSwe of Animals = QuestionsSwe **
|
||||
open ResourceSwe, ParadigmsSwe, VerbsSwe 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 ;
|
||||
}
|
||||
20
lib/resource-0.9/doc/example/HandQuestionsI.gf
Normal file
20
lib/resource-0.9/doc/example/HandQuestionsI.gf
Normal file
@@ -0,0 +1,20 @@
|
||||
--# -path=.:resource/abstract:resource/../prelude
|
||||
|
||||
-- Language-independent question grammar parametrized 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)))) ;
|
||||
}
|
||||
10
lib/resource-0.9/doc/example/Questions.gf
Normal file
10
lib/resource-0.9/doc/example/Questions.gf
Normal 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
|
||||
}
|
||||
2
lib/resource-0.9/doc/example/QuestionsEng.gf
Normal file
2
lib/resource-0.9/doc/example/QuestionsEng.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete QuestionsEng of Questions = QuestionsI with
|
||||
(Resource = ResourceEng) ;
|
||||
2
lib/resource-0.9/doc/example/QuestionsFre.gf
Normal file
2
lib/resource-0.9/doc/example/QuestionsFre.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete QuestionsFre of Questions = QuestionsI with
|
||||
(Resource = ResourceFre) ;
|
||||
19
lib/resource-0.9/doc/example/QuestionsI.gf
Normal file
19
lib/resource-0.9/doc/example/QuestionsI.gf
Normal file
@@ -0,0 +1,19 @@
|
||||
-- File generated by GF from ./QuestionsI.gfe
|
||||
--# -resource=../../english/LangEng.gf
|
||||
|
||||
-- to compile: gf -examples QuestionsI.gfe
|
||||
|
||||
incomplete concrete QuestionsI of Questions = open Resource in {
|
||||
lincat
|
||||
Phrase = Phr ;
|
||||
Entity = N ;
|
||||
Action = V2 ;
|
||||
|
||||
lin
|
||||
Who love_V2 man_N = QuestPhrase (UseQCl (PosTP TPresent ASimul) (QPredV2 who8one_IP love_V2 (IndefNumNP NoNum (UseN man_N)))) ;
|
||||
Whom man_N love_V2 = QuestPhrase (UseQCl (PosTP TPresent ASimul) (IntSlash who8many_IP (SlashV2 (DefOneNP (UseN man_N)) love_V2))) ; -- AMBIGUOUS:
|
||||
-- QuestPhrase (UseQCl (PosTP TPresent ASimul) (IntSlash who8one_IP (SlashV2 (DefOneNP (UseN man_N)) love_V2))) ;
|
||||
|
||||
Answer woman_N love_V2 man_N = IndicPhrase (UseCl (PosTP TPresent ASimul) (SPredV2 (DefOneNP (UseN woman_N)) love_V2 (IndefNumNP NoNum (UseN man_N)))) ;
|
||||
|
||||
}
|
||||
16
lib/resource-0.9/doc/example/QuestionsI.gfe
Normal file
16
lib/resource-0.9/doc/example/QuestionsI.gfe
Normal file
@@ -0,0 +1,16 @@
|
||||
--# -resource=../../english/LangEng.gf
|
||||
|
||||
-- to compile: gf -examples QuestionsI.gfe
|
||||
|
||||
incomplete concrete QuestionsI of Questions = open Resource 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 ." ;
|
||||
|
||||
}
|
||||
2
lib/resource-0.9/doc/example/QuestionsSwe.gf
Normal file
2
lib/resource-0.9/doc/example/QuestionsSwe.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete QuestionsSwe of Questions = QuestionsI with
|
||||
(Resource = ResourceSwe) ;
|
||||
4
lib/resource-0.9/doc/example/mkAnimals.gfs
Normal file
4
lib/resource-0.9/doc/example/mkAnimals.gfs
Normal file
@@ -0,0 +1,4 @@
|
||||
i -ex AnimalsEng.gf ;; s
|
||||
i AnimalsFre.gf ;; s
|
||||
i AnimalsSwe.gf ;; s
|
||||
pm | wf animals.gfcm
|
||||
Reference in New Issue
Block a user