diff --git a/lib/resource/doc/example/Animals.gf b/lib/resource/doc/example/Animals.gf index a1cb3654a..e6d084243 100644 --- a/lib/resource/doc/example/Animals.gf +++ b/lib/resource/doc/example/Animals.gf @@ -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 ; } diff --git a/lib/resource/doc/example/AnimalsEng.gf b/lib/resource/doc/example/AnimalsEng.gf index 861289fa0..a25a95ae2 100644 --- a/lib/resource/doc/example/AnimalsEng.gf +++ b/lib/resource/doc/example/AnimalsEng.gf @@ -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)))) - --} \ No newline at end of file diff --git a/lib/resource/doc/example/AnimalsFre.gf b/lib/resource/doc/example/AnimalsFre.gf index 4a796db09..635f47208 100644 --- a/lib/resource/doc/example/AnimalsFre.gf +++ b/lib/resource/doc/example/AnimalsFre.gf @@ -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 ; diff --git a/lib/resource/doc/example/AnimalsSwe.gf b/lib/resource/doc/example/AnimalsSwe.gf index 126135b3a..f7aaa0cd6 100644 --- a/lib/resource/doc/example/AnimalsSwe.gf +++ b/lib/resource/doc/example/AnimalsSwe.gf @@ -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" ; diff --git a/lib/resource/doc/example/Questions.gf b/lib/resource/doc/example/Questions.gf new file mode 100644 index 000000000..bb25e785d --- /dev/null +++ b/lib/resource/doc/example/Questions.gf @@ -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 +} diff --git a/lib/resource/doc/example/QuestionsEng.gf b/lib/resource/doc/example/QuestionsEng.gf new file mode 100644 index 000000000..62234bfec --- /dev/null +++ b/lib/resource/doc/example/QuestionsEng.gf @@ -0,0 +1,2 @@ +concrete QuestionsEng of Questions = QuestionsI with + (Resource = ResourceEng) ; diff --git a/lib/resource/doc/example/QuestionsFre.gf b/lib/resource/doc/example/QuestionsFre.gf new file mode 100644 index 000000000..37b5f242d --- /dev/null +++ b/lib/resource/doc/example/QuestionsFre.gf @@ -0,0 +1,2 @@ +concrete QuestionsFre of Questions = QuestionsI with + (Resource = ResourceFre) ; diff --git a/lib/resource/doc/example/QuestionsI.gf b/lib/resource/doc/example/QuestionsI.gf new file mode 100644 index 000000000..7dda8ca8c --- /dev/null +++ b/lib/resource/doc/example/QuestionsI.gf @@ -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)))) ; +} diff --git a/lib/resource/doc/example/QuestionsSwe.gf b/lib/resource/doc/example/QuestionsSwe.gf new file mode 100644 index 000000000..e4eb5cf76 --- /dev/null +++ b/lib/resource/doc/example/QuestionsSwe.gf @@ -0,0 +1,2 @@ +concrete QuestionsSwe of Questions = QuestionsI with + (Resource = ResourceSwe) ; diff --git a/lib/resource/doc/gf-resource.html b/lib/resource/doc/gf-resource.html index 72269ddfb..902cc5432 100644 --- a/lib/resource/doc/gf-resource.html +++ b/lib/resource/doc/gf-resource.html @@ -505,20 +505,21 @@ Test with random generation, translation, morphological analysis...

Use as top-level grammar: language learning quizzes

-Morpho quiz with words: +Morpho quiz with words (e.g. French verbs):
-  i 
-
+  i french/VerbsFre.gf
+  mq -cat=V
 
-Morpho quiz with phrases: +Morpho quiz with phrases (e.g. Swedish clauses):
-
-
+  i swedish/LangSwe.gf
+  mq -cat=Cl
 
-Translation quiz with sentences: +Translation quiz with sentences (e.g. sentences from English to Swedish):
-
-
+  i swedish/LangEng.gf
+  i swedish/LangSwe.gf
+  tq -cat=S LangEng LangSwe
 
@@ -580,21 +581,35 @@ Source modules:

+Abstract syntax: +Questions, Animals

+Concrete syntax of questions parametrized on the resource API: +QuestionsI + +

+ +English concrete syntax: +QuestionsEng, AnimalsEng

+French concrete syntax: +QuestionsFre, AnimalsFre

+Swedish concrete syntax: +QuestionsSwe, AnimalsSwe +

Compiling the example application

@@ -667,18 +682,23 @@ In two language families:

Current status

- - + + - + - + - - - + + +
Language v0.6 API Paradigms Basic lex Verbs
Danish X
Language v0.6 v0.9 API Paradigms Basic lex Verbs
Danish - X - - -
English X X X X X
Finnish X
Finnish X - - - -
French X X X X X
German X *
German X - * - -
Italian X X X X X
Norwegian X X X X
Russian X * *
Spanish X X X
Norwegian - X X X X
Russian X * * - -
Spanish - X X X X
Swedish X X X X X
+X = implemented (few exceptions may occur) +
+* = linguistic material ready for implementation +
+- = not implemented @@ -720,15 +740,10 @@ Swedish

Obtaining it

-Now on CVS at Chalmers: -
-  cvs -d /users/cs/aarne/cvs checkout GF2.0/lib
-
+Get the grammar package atDownload from + +GF Download Page. The current libraries are in +lib/resource. Version 0.6 is in +lib/resource-0.6. -

- -To appear later at GF Homepage:

- - -http://www.cs.chalmers.se/~aarne/GF -

+ diff --git a/lib/resource/french/ResourceFre.gf b/lib/resource/french/ResourceFre.gf index 18966cb14..1a17c3821 100644 --- a/lib/resource/french/ResourceFre.gf +++ b/lib/resource/french/ResourceFre.gf @@ -1,4 +1,5 @@ --# -path=.:../romance:../abstract:../../prelude -concrete ResourceFre of ResourceVP = RulesFre, StructuralFre, VerbphraseFre ** {} ; +concrete ResourceFre of Resource = RulesFre, ClauseFre, StructuralFre ** {} ; + diff --git a/lib/resource/italian/ResourceIta.gf b/lib/resource/italian/ResourceIta.gf new file mode 100644 index 000000000..fd5be798e --- /dev/null +++ b/lib/resource/italian/ResourceIta.gf @@ -0,0 +1,4 @@ +--# -path=.:../romance:../abstract:../../prelude + +concrete ResourceIta of Resource = RulesIta, ClauseIta, StructuralIta ** {} ; + diff --git a/lib/resource/norwegian/ResourceNor.gf b/lib/resource/norwegian/ResourceNor.gf index eb0391bd3..c5c0d38d8 100644 --- a/lib/resource/norwegian/ResourceNor.gf +++ b/lib/resource/norwegian/ResourceNor.gf @@ -1,5 +1,4 @@ --# -path=.:../scandinavian:../abstract:../../prelude ----- concrete ResourceSwe of Resource = RulesSwe, VerbphraseSwe ** {} ; concrete ResourceNor of Resource = RulesNor, StructuralNor, ClauseNor ** {} ; diff --git a/lib/resource/spanish/ResourceSpa.gf b/lib/resource/spanish/ResourceSpa.gf index 01163edc7..58b208992 100644 --- a/lib/resource/spanish/ResourceSpa.gf +++ b/lib/resource/spanish/ResourceSpa.gf @@ -1,3 +1,3 @@ --# -path=.:../romance:../abstract:../../prelude -instance ResourceSpa of Resource = reuse AllResourceSpa ; +concrete ResourceSpa of Resource = RulesSpa, ClauseSpa, StructuralSpa ** {} ;