diff --git a/prelude/Predef.gf b/prelude/Predef.gf index 866ce5b6a..961e99eb3 100644 --- a/prelude/Predef.gf +++ b/prelude/Predef.gf @@ -22,6 +22,7 @@ resource Predef = { oper occur : Tok -> Tok -> PBool = variants {} ; -- test if occurs as substring oper show : (P : Type) -> P -> Tok = variants {} ; -- convert param to string oper read : (P : Type) -> Tok -> P = variants {} ; -- convert string to param + oper toStr : (P : Type) -> P -> Str = variants {} ; -- find the "first" string } ; diff --git a/resource/abstract/Lang.gf b/resource/abstract/Lang.gf index 06ec5c624..efebecea5 100644 --- a/resource/abstract/Lang.gf +++ b/resource/abstract/Lang.gf @@ -1,3 +1,5 @@ +--# -path=.:../../prelude + abstract Lang = Rules, Clause, diff --git a/resource/abstract/Resource.gf b/resource/abstract/Resource.gf index fd68f4393..60c4e7abd 100644 --- a/resource/abstract/Resource.gf +++ b/resource/abstract/Resource.gf @@ -1 +1 @@ -interface Resource = reuse AllResource ; \ No newline at end of file +abstract Resource = Rules, Clause, Structural ** {} ; diff --git a/resource/danish/MorphoDan.gf b/resource/danish/MorphoDan.gf index bc6c8884b..8338791bb 100644 --- a/resource/danish/MorphoDan.gf +++ b/resource/danish/MorphoDan.gf @@ -83,7 +83,10 @@ oper mkVoice : Voice -> Str -> Str = \v,s -> case v of { Act => s ; - Pass => s + "s" + Pass => s + case last s of { + "s" => "es" ; + _ => "s" + } } ; vHusk : Str -> Verbum = \husk -> diff --git a/resource/doc/Makefile b/resource/doc/Makefile index da5a7b33b..7caf2a716 100644 --- a/resource/doc/Makefile +++ b/resource/doc/Makefile @@ -1,4 +1,4 @@ -all: gfdoc htmls +all: gfdoc htmls gifs htmls: htmls gf-resource.html @@ -14,3 +14,18 @@ gfdoc: gfdoc ../swedish/ParadigmsSwe.gf ; mv ../swedish/ParadigmsSwe.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 . + +gifs: lang scand low + +lang: + echo "pm -printer=graph | wf Lang.dot" | gf ../abstract/Lang.gf + dot -Tgif Lang.dot>Lang.gif + +low: + echo "pm -printer=graph | wf Low.dot" | gf ../english/RulesEng.gf + dot -Tgif Low.dot >Low.gif + +scand: + echo "pm -printer=graph | wf Scand.dot" | gf ../swedish/RulesSwe.gf + dot -Tgif Scand.dot >Scand.gif diff --git a/resource/doc/gf-resource.html b/resource/doc/gf-resource.html index d27e8aa83..41faf0a9e 100644 --- a/resource/doc/gf-resource.html +++ b/resource/doc/gf-resource.html @@ -36,6 +36,35 @@ All morphological paradigms Basic lexicon of structural, common, and irregular words + +

Success criteria

+ +Grammatical correctness + +

+ +Semantic coverage + +

+ +Usability as library for non-linguists + + + +

These are not success criteria

+ +Language coverage + +

+ +Semantic correctness +

+  colourless green ideas sleep furiously
+
+  the time is seventy past forty-two
+
+ +

Languages

@@ -110,6 +139,10 @@ Language-dependent resources

+English verbs + +

+ Swedish

@@ -119,19 +152,97 @@ Language-dependent resources -

Using it

+

Use as top-level grammar

+ +Random generation, translation, morphological analysis... + +

+ +Language learning: translation and morpho quiz + +

+ +Generate elementary text books from abstract syntax? + + + + +

Use as library

+ +Import directly by open: +
+  concrete AppNor of App = open LangNor, ParadigmsNor in {...}
+
+No more dummy reuse modules and bulky .gfr files! + +

+ +If you need to convert resource category records to/from strings, use +

+  Predef.toStr   : L -> Str ; 
+  Predef.fromStr : Str -> L ; 
+
+L must be a linearization type. + + + +

Use as library through parser

+ +Use the parser when developing a resource. +
+  > p -cat=S -v "jag ska åka till Chalmers"
+  unknown tokens [TS "åka",TS "Chalmers"]
+
+  > p -cat=S "jag ska gå till Danmark"
+  UseCl (PosTP TFuture ASimul)
+    (AdvCl (SPredV i_NP go_V)
+    (AdvPP (PrepNP to_Prep (UsePN (PNCountry Denmark)))))
+
+Extend vocabulary at need. +
+  åka_V = lexV "åker" ; 
+  Chalmers = regPN "Chalmers" neutrum ;
+
+ +

Implementatin details: the structure of low-level files

+
+ +
+

The use of parametric modules

+In two language families: + +
+ +
+

Current status

+ + + + + + + + + + + + +
Language v0.6 API Paradigms Basic lex Verbs
Danish X
English X X X X X
Finnish X
French X * * *
German X *
Italian X * * *
Norwegian X
Russian X * *
Spanish * *
Swedish X X X X *

Obtaining it

diff --git a/resource/english/BasicEng.gf b/resource/english/BasicEng.gf index 58571e161..a2885790b 100644 --- a/resource/english/BasicEng.gf +++ b/resource/english/BasicEng.gf @@ -218,7 +218,7 @@ lin add_V3 = dirV3 (regV "add") "to" ; number_N = regN "number" ; put_V2 = mkV2 (irregDuplV "put" "put" "put") [] ; - stop_V = regV "stop" ; + stop_V = regDuplV "stop" ; jump_V = regV "jump" ; here_Adv = mkAdv "here" ; here7to_Adv = mkAdv "here" ; diff --git a/resource/english/CountryEng.gf b/resource/english/CountryEng.gf index d427c701c..59a85a4e6 100644 --- a/resource/english/CountryEng.gf +++ b/resource/english/CountryEng.gf @@ -1,4 +1,4 @@ -concrete CountryEng of Country = open ResourceEng, ParadigmsEng in { +concrete CountryEng of Country = open CategoriesEng, ParadigmsEng in { lincat Country = PN ; diff --git a/resource/english/LangEng.gf b/resource/english/LangEng.gf index a8bf85d30..97dd73c73 100644 --- a/resource/english/LangEng.gf +++ b/resource/english/LangEng.gf @@ -8,7 +8,7 @@ concrete LangEng of Lang = TimeEng, CountryEng - ** open Prelude, ResourceEng, ParadigmsEng in { + ** open Prelude, ParadigmsEng in { lin AdvDate d = prefixSS "on" d ; diff --git a/resource/english/ParadigmsEng.gf b/resource/english/ParadigmsEng.gf index 5860c8c48..3b4c906ab 100644 --- a/resource/english/ParadigmsEng.gf +++ b/resource/english/ParadigmsEng.gf @@ -26,8 +26,8 @@ -- -- The following modules are presupposed: -resource ParadigmsEng = open (Predef=Predef), Prelude, SyntaxEng, ResourceEng in { - +resource ParadigmsEng = open (Predef=Predef), Prelude, SyntaxEng, ---- ResourceEng in { + CategoriesEng, RulesEng in { --2 Parameters -- -- To abstract over gender names, we define the following identifiers. diff --git a/resource/english/TimeEng.gf b/resource/english/TimeEng.gf index cb183efe0..b5759fda1 100644 --- a/resource/english/TimeEng.gf +++ b/resource/english/TimeEng.gf @@ -1,5 +1,5 @@ concrete TimeEng of Time = NumeralsEng ** - open Prelude, ResourceEng, ParadigmsEng in { + open Prelude, CategoriesEng, ParadigmsEng in { lincat Date = SS ; diff --git a/resource/norwegian/MorphoNor.gf b/resource/norwegian/MorphoNor.gf index 2d606b2c8..03f674860 100644 --- a/resource/norwegian/MorphoNor.gf +++ b/resource/norwegian/MorphoNor.gf @@ -91,7 +91,7 @@ oper mkVoice : Voice -> Str -> Str = \v,s -> case v of { Act => s ; Pass => s + case last s of { - "t" => "es" ; + "s" => "es" ; _ => "s" } } ; diff --git a/resource/swedish/ResourceSwe.gf b/resource/swedish/ResourceSwe.gf index 2c692c437..656e263e4 100644 --- a/resource/swedish/ResourceSwe.gf +++ b/resource/swedish/ResourceSwe.gf @@ -1,3 +1,4 @@ --# -path=.:../abstract:../../prelude -instance ResourceSwe of Resource = reuse AllResourceSwe ; +concrete ResourceSwe of Resource = RulesSwe, StructuralSwe, ClauseSwe ** {} ; +