diff --git a/resource/abstract/Resource.gf b/resource/abstract/Resource.gf index 24aac721d..c675bc1ba 100644 --- a/resource/abstract/Resource.gf +++ b/resource/abstract/Resource.gf @@ -1 +1,3 @@ +--# -path=.:../../prelude + abstract Resource = Rules, Clause, Structural ** {} ; diff --git a/resource/doc/Makefile b/resource/doc/Makefile index 7caf2a716..1af678c52 100644 --- a/resource/doc/Makefile +++ b/resource/doc/Makefile @@ -6,17 +6,27 @@ htmls: gfdoc: gfdoc ../abstract/Categories.gf ; mv ../abstract/Categories.html . gfdoc ../abstract/Rules.gf ; mv ../abstract/Rules.html . + gfdoc ../abstract/Verbphrase.gf ; mv ../abstract/Verbphrase.html . gfdoc ../abstract/Clause.gf ; mv ../abstract/Clause.html . gfdoc ../abstract/Structural.gf ; mv ../abstract/Structural.html . gfdoc ../abstract/Basic.gf ; mv ../abstract/Basic.html . gfdoc ../abstract/Time.gf ; mv ../abstract/Time.html . gfdoc ../abstract/Lang.gf ; mv ../abstract/Lang.html . gfdoc ../swedish/ParadigmsSwe.gf ; mv ../swedish/ParadigmsSwe.html . + gfdoc ../swedish/VerbsSwe.gf ; mv ../swedish/VerbsSwe.html . gfdoc ../swedish/BasicSwe.gf ; mv ../swedish/BasicSwe.html . gfdoc ../english/ParadigmsEng.gf ; mv ../english/ParadigmsEng.html . gfdoc ../english/VerbsEng.gf ; mv ../english/VerbsEng.html . + gfdoc ../english/BasicEng.gf ; mv ../english/BasicEng.html . + gfdoc ../french/ParadigmsFre.gf ; mv ../french/ParadigmsFre.html . + gfdoc ../french/VerbsFre.gf ; mv ../french/VerbsFre.html . + gfdoc ../french/BasicFre.gf ; mv ../french/BasicFre.html . -gifs: lang scand low +gifs: api lang scand low + +api: +# echo "pm -printer=graph | wf Resource.dot" | gf ../abstract/Resource.gf + dot -Tgif ResourceVP.dot>Resource.gif lang: echo "pm -printer=graph | wf Lang.dot" | gf ../abstract/Lang.gf diff --git a/resource/doc/ResourceVP.dot b/resource/doc/ResourceVP.dot new file mode 100644 index 000000000..d31fcc288 --- /dev/null +++ b/resource/doc/ResourceVP.dot @@ -0,0 +1,28 @@ +digraph { + +Verbphrase [style = "solid", shape = "ellipse", URL = "Verbphrase.gf"]; +Verbphrase -> Categories [style = "solid"]; + +Resource [style = "solid", shape = "ellipse", URL = "Resource.gf"]; +Resource -> Rules [style = "solid"]; +Resource -> Clause [style = "solid"]; +Resource -> Structural [style = "solid"]; + +Rules [style = "solid", shape = "ellipse", URL = "Rules.gf"]; +Rules -> Categories [style = "solid"]; + +Clause [style = "solid", shape = "ellipse", URL = "Clause.gf"]; +Clause -> Categories [style = "solid"]; + +Structural [style = "solid", shape = "ellipse", URL = "Structural.gf"]; +Structural -> Categories [style = "solid"]; +Structural -> Numerals [style = "solid"]; + +Categories [style = "solid", shape = "ellipse", URL = "Categories.gf"]; +Categories -> PredefAbs [style = "solid"]; + +PredefAbs [style = "solid", shape = "ellipse", URL = "PredefAbs.gf"]; + +Numerals [style = "solid", shape = "ellipse", URL = "Numerals.gf"]; + +} diff --git a/resource/doc/example/Animals.gf b/resource/doc/example/Animals.gf new file mode 100644 index 000000000..a1cb3654a --- /dev/null +++ b/resource/doc/example/Animals.gf @@ -0,0 +1,12 @@ +abstract Animals = { + cat + Phrase ; Animal ; Action ; + fun + Who : Action -> Animal -> Phrase ; + Whom : Animal -> Action -> Phrase ; + Answer : Animal -> Action -> Animal -> Phrase ; + + Dog, Cat, Mouse, Lion, Zebra : Animal ; + Chase, Eat, Like : Action ; +} + diff --git a/resource/doc/example/AnimalsEng.gf b/resource/doc/example/AnimalsEng.gf new file mode 100644 index 000000000..861289fa0 --- /dev/null +++ b/resource/doc/example/AnimalsEng.gf @@ -0,0 +1,37 @@ +--# -path=.:resource/english:resource/abstract:resource/../prelude + +concrete AnimalsEng of Animals = open ResourceEng, ParadigmsEng, VerbsEng in { + lincat + Phrase = Phr ; + Animal = 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)))) ; + 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 = <>}) ; + 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/resource/doc/example/AnimalsFre.gf b/resource/doc/example/AnimalsFre.gf new file mode 100644 index 000000000..ace09a5c0 --- /dev/null +++ b/resource/doc/example/AnimalsFre.gf @@ -0,0 +1,23 @@ +--# -path=.:resource/french:resource/romance:resource/abstract:resource/../prelude + +concrete AnimalsFre of Animals = open ResourceFre, ParadigmsFre, VerbsFre in { + lincat + Phrase = Phr ; + Animal = 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)))) ; + 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") ; + Like = dirV2 (regV "aimer") ; +} diff --git a/resource/doc/example/AnimalsSwe.gf b/resource/doc/example/AnimalsSwe.gf new file mode 100644 index 000000000..126135b3a --- /dev/null +++ b/resource/doc/example/AnimalsSwe.gf @@ -0,0 +1,23 @@ +--# -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 ; + 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" ; + Lion = mk2N "lejon" "lejon" ; + Zebra = regN "zebra" utrum ; + Chase = dirV2 (regV "jaga") ; + Eat = dirV2 äta_V ; + Like = mkV2 (mk2V "tycka" "tycker") "om" ; +} diff --git a/resource/doc/gf-resource.html b/resource/doc/gf-resource.html index 5dd9e0f7a..15dfb93c3 100644 --- a/resource/doc/gf-resource.html +++ b/resource/doc/gf-resource.html @@ -9,7 +9,9 @@
-First Draft, Gothenburg, 7 February 2005
+Second Version, Gothenburg, 18 February 2005
+
+First Draft, Gothenburg, 7 February 2005
@@ -23,18 +25,124 @@ Aarne Ranta -
+Designed to be nice for ordinary programmers to use. + +
+ +Mission: to make natural-language applications available for +ordinary programmers, in tasks like +
+ +Which kind of programmer is easier to find? +
+ +In main-stream programming, sorting algorithms are not +written by hand but taken from libraries. + +
+ +In the same way, we want to create grammar libraries that encapsulate +basic linguistic facts. + +
+ +Cf. the Java success story: the language is just a half of the +success - libraries are another half. + + + + +
+ ++To use a library function for Swedish definite phrases: +
+ ++ + + +
+
+How do we organize and present the library?
+
+
+
+Where do we get the data from?
+
+
+ +Extra constraint: we want open-source free software. + + + + + + +
Basic lexicon of structural, common, and irregular words +
+ +Basic syntactic structures + +
+ +Currently no semantics, +no language-specific structures if not +necessary for expressivity. + + +
-Semantic coverage +Semantic coverage: you can express whatever you want.
-Usability as library for non-linguists +Usability as library for non-linguists. + +
+ +(Bonus for linguists:) nice generalizations w.r.t. language +families, using the module system of GF. + -
@@ -64,11 +178,61 @@ Semantic correctness the time is seventy past forty-two +
+ +(Warning for linguists:) theoretical innovation in +syntax + + + + +
+ +But we do not believe semantics can be given once and +for all for a natural language. + +
+ +Instead, we expect semantics to be given in +application grammars built on semantic models +of different domains. + +
+ +Example application: number theory +
+ fun Even : Nat -> Prop ; -- a mathematical predicate + + lin Even = predA (regA "even") ; -- English translation + lin Even = predA (regA "pair") ; -- French translation + lin Even = predA (regA "jämn") ; -- Swedish translation ++How could the resource predict that just these +translations are correct in this domain? + +
+ +Application grammars are built by experts of these domains +who - thanks to resource grammars - do no more need to be +experts in linguistics. + + + + + +
+The current GF Resource Project covers ten languages: +
+
+ V ; NP ; CN ; Det ; -- verb, noun phrase, common noun, determiner ++
+ DetNP : Det -> CN -> NP ; -- combine Det and CN into NP ++
+ and_Conj : Conj ; ++ + +
+ mkN : Str -> Str -> Str -> Str -> Gender -> N ; -- worst-case nouns + mkN : Str -> N ; -- regular nouns ++
+ angripa_V = irregV "angripa" "angrep" "angripit" ; ++
+ man_N = mkN "man" "mannen" "män" "männen" masculine ; ++
+ PassBli : V2 -> NP -> VP ; -- bli överkörd av ngn +-
-Language-dependent resources +Reservations:
+
-Clause +Alternative views on sentence formation: +Clause, +Verbphrase
Structural @@ -135,19 +357,27 @@ Language-dependent resources
-
+English paradigms
+
+example use of English oaradigms
+
English verbs
-Swedish
+French paradigms
+
+example use of French paradigms
+
+French verbs
-example of Swedish
+Swedish paradigms
+
+example use of Swedish paradigms
+
+Swedish verbs
diff --git a/resource/english/ParadigmsEng.gf b/resource/english/ParadigmsEng.gf
index 75baeec62..685d8fa33 100644
--- a/resource/english/ParadigmsEng.gf
+++ b/resource/english/ParadigmsEng.gf
@@ -1,6 +1,6 @@
--# -path=.:../abstract:../../prelude
---1 English Lexical Paradigms UNDER RECONSTRUCTION!
+--1 English Lexical Paradigms
--
-- Aarne Ranta 2003
--
diff --git a/resource/english/SyntaxEng.gf b/resource/english/SyntaxEng.gf
index a8c5020b9..c2d15077f 100644
--- a/resource/english/SyntaxEng.gf
+++ b/resource/english/SyntaxEng.gf
@@ -1076,7 +1076,7 @@ oper
intPronWho : Number -> IntPron = \num -> {
s = table {
NomP => "who" ;
- AccP => variants {"who" ; "whom"} ;
+ AccP => variants {"whom" ; "who"} ;
GenP => "whose" ;
GenSP => "whom"
} ;
diff --git a/resource/swedish/ParadigmsSwe.gf b/resource/swedish/ParadigmsSwe.gf
index 5c5b98878..f0b8fe306 100644
--- a/resource/swedish/ParadigmsSwe.gf
+++ b/resource/swedish/ParadigmsSwe.gf
@@ -1,6 +1,6 @@
--# -path=.:../scandinavian:../abstract:../../prelude
---1 Swedish Lexical Paradigms UNDER RECONSTRUCTION!
+--1 Swedish Lexical Paradigms
--
-- Aarne Ranta 2003
--