diff --git a/lib/resource-0.6/Makefile b/lib/resource-0.6/Makefile index f7b19fad6..ee635235a 100644 --- a/lib/resource-0.6/Makefile +++ b/lib/resource-0.6/Makefile @@ -5,7 +5,8 @@ test: paradigms: gf
- +

The GF Resource Grammar Library

@@ -13,7 +13,7 @@

-Version 0.6: source package. +Version 0.7: source package.

@@ -22,9 +22,13 @@ Current languages: English, Finnish, French, German, Italian, Russian, Swedish.

-News.
+News
-13/4/2004 Version 0.6 written using the module system of GF 2. Also an +24/6/2004 Version 0.7 released together with the release of GF 2.0. + +
+ +13/4/2004 Version 0.6 completed using the module system of GF 2. Also an extended coverage. The files are placed in separate subdirectories (one per language) and have different names than before, so that file names (without the extension .gf) are also legal module names. @@ -35,7 +39,7 @@ per language) and have different names than before, so that file names
-25/6/2003 Release of GF 1.2 making it much more efficient to work with +25/6/2003 Release of GF 1.2 making it more efficient to work with resource grammars. See highlights. Also source package version 0.3 @@ -55,7 +59,7 @@ browsers the encoding must be set manually. on application and resource grammarians' views and added documentation on the type system of each language X -in resource.X.gf. +in CombinationsX.gf.
@@ -78,7 +82,7 @@ English and German.

-Notice. You need GF Version 2.0beta or later +Notice. You need GF Version 2.0 or later to work with these resource grammars. It is available from the GF home page. @@ -131,7 +135,9 @@ but simply The author of the French resource grammar will have defined the functions predAdj and adjReg in such a way that -they can be used in all applications. +they can be used in all applications. The type checker of the GF grammar +compiler guarantees that only grammatically correct combinations +can be formed by the resource grammar functions. @@ -154,17 +160,18 @@ We leave it open if we can also explain the semantics of resource grammar on the general level. The philosophy of GF, inherited from logical frameworks, is that semantics is only given to -application grammars. (You can also compare them to Wittgenstein's +application grammars. (You can also compare application grammars to Wittgenstein's "language games"). This view gives us a lot of freedom in formulating resource grammars. -When describing them, we sometimes say that such-and-such construction +When describing them, we sometimes say that such-and-such a construction is likely to be ruled out by semantic reasons; what we mean is that this will actually happen in application grammars; we do not mean that GF has no semantic rules. -An example of this is the free formation of question adverbials, e.g. +An example is the question From which city is every number even or odd?. The resource grammar makes it possible to form this question, -but it can hardly be grammatical in any sensible application grammar. +but it can hardly be correct in any application grammar that has +a rigorous semantics. @@ -172,17 +179,17 @@ but it can hardly be grammatical in any sensible application grammar. The resource grammar library a hierarchical structure. Its main layers are

-The core resources should not be needed by application grammarians: it should -be enough to use the core resource API and the derived libraries. If +The resource infrastructure should not be needed by application grammarians: it should +be enough to use the core resource API, the paradigm modules, and the derived libraries. If this is not the case, the best solution is to extend the derived resource libraries or create new ones. @@ -216,15 +223,15 @@ grateful for bug reports, requests, and contributions!

-The most important exception to total data abstraction in practice is the -incompleteness of resource lexica. Since it is impossible to have +The most important exception to total data abstraction in practice +concerns resource lexica. Since it is impossible to have a full coverage of all the words in a language, users often have to introduce their own lexical entries, and thereby use literal strings in their GF code. The safest and most convenient way of using this is via functions defined in ParadigmsX.gf files. Using these functions guarantees that the lexical entries created are type-correct. But nothing guards against misspelling a word, picking a wrong inflectional pattern, or -a wrong inherent feature (such as gender). +a wrong inherent feature (such as the gender of a French noun). @@ -234,10 +241,8 @@ All documented GF grammars linked from this page have been written in GF and then translated to HTML using a light-weight documentation tool, gfdoc. The tool is available as a part of the GF -source code package, in the Haskell file -util/GFDoc.hs that can be run in the Hugs interpreter -by the script util/gfdoc. The program also has the -flag +latex, which produces output in Latex instead of +package. The program also has the +flag -latex, which produces output in Latex instead of HTML. @@ -249,7 +254,7 @@ its extension Structural.

-The file Combinations.gf +The module Combinations gives the core resource type signatures of phrasal categories and syntactic combination rules, together with some explanations and examples. The examples are so far only in English, but their @@ -258,8 +263,8 @@ API has been implemented.

-The file Structurals.gf -gives a list of structural words such as determiners, pronouns, +The module Structural +defines structural words such as determiners, pronouns, prepositions, and conjunctions.

@@ -310,9 +315,9 @@ Here are the documented versions of the paradigm modules:

  • English: ParadigmsEng.gf
  • Finnish: ParadigmsFin.gf
  • French: ParadigmsFra.gf -
  • German: ParadigmsDeu.gf +
  • German: ParadigmsDeu.gf
  • Italian: ParadigmsIta.gf -
  • Russian: ParadigmsRusU.gf +
  • Russian: ParadigmsRus.gf
  • Swedish: ParadigmsSwe.gf @@ -330,10 +335,10 @@ applications.

    -The API of the predication library is in the file -Predication.gf. -What is imported is one of the language-dependent files, -X/PredicationX.gf for each language X. +The API of the predication library is the module +Predication. +What is imported is one of the language-dependent modules, +X/PredicationX for each language X. @@ -341,24 +346,32 @@ What is imported is one of the language-dependent files, Sometimes it is useful for the application grammarian to know what the language-dependent linearizations types are for each category in the -core resource. These types are defined in the files CombinationsX.gf: +core resource. These types are defined in the files CombinationsX.gf. +They can be translated to documents by gfdoc if desired. + + +

    + For the sake of uniformity, we have tried to use the same names of parameter types when applicable. For instance, the gender parameter is called Gender in every grammar, even though its values differ. The definitions of the parameter -types are given in the files TypesX.gf. +types are given in the modules TypesX. The application grammarian following the complete abstraction principle -should not use the parameter constructors directly, but rather the -names defined in ParadigmsX.gf. +does not open these modules and cannot hence +use the parameter constructors directly, but rather the +names defined in ParadigmsX. @@ -412,103 +425,48 @@ an interactive system. -

    The structure of core resource grammars

    +

    The resource grammar infrastructure

    As explained above, the application grammarian's view on resource grammars is through API modules. They are collections of type signatures of functions. It is the task of linguists to define these functions. The definitions are in the end given -in the core resource grammars. +in the resource grammar infrastructure.

    We have divided the core resource grammar for each language X into the following parts:

      -
    • Type system: types.X.gf -
    • Morphology: morpho.X.gf -
    • Syntax: syntax.X.gf +
    • Type system: TypesX.gf +
    • Morphology: MorphoX.gf +
    • Syntax: SyntaxX.gf
    To get the most powerful resource grammar for each language, one can use -these files directly. - -

    - -However, the languages we have studied have so much in common -that we have gathered a considerable set of categories and rules -in a multilingual resource grammar. Its parts are -

      -
    • Abstract syntax: Resource.gf -
    • Language-dependent concrete syntax: ResourceX.gf for - each language. -
    -The advantage of using this API in application grammars is that -their concrete syntax looks the same for all languages -up to non-structural words. Thus it is possible to produce concrete syntaxes -for new languages without knowing almost anything about them. -The abstract syntax serves as a common API to the core resource grammar. - - -

    The code for the core resource grammars

    - -The following links go to the gfdoc-generated -HTML files while showing the names of the GF files. - +these files directly. To view these modules, documents can be generated +by gfdoc.

    Compiling and using the resource

    If you want to use the resource grammars, you should download and unpack the -source package. +GF grammar package and go to the +directory newresource. At Chalmers, however, we keep the resource grammars in the -GF CVS archive, in the directory Grammars/resource/, +GF CVS archive, in the directory grammars/newresource/, and you'd better take them that way. The package accessible through www is usually not quite up to date.

    -To compile the resource into reusable operations, for all languages, type +To compile the resource into precompiled modules, for all languages, type

       make
     
    in the resource/ directory. -This requires that you have a recent version of GF (>= 1.1). -What you get is a set of files with names res.X.gf. -The file res.Types.gf gives the type signatures -of the operations. You need never consult any of these files, +What you get is a set of gfr and gfc files. +You need never consult any of these files, but mostly look into resource.Abs.gf for the type signatures of syntactic structures. @@ -518,33 +476,20 @@ signatures of syntactic structures.

    A test suite

    -The grammars test.X.gf define a few expressions of each +The grammars TestX define a few expressions of each lexical category and make it possible to test linearization, parsing, random generation, and editing.

    A database query language

    -The grammars database/(database | restaurant).X.gf -make use of the resource. The restaurant.X.gf +The grammars database/(Database|Restaurant)X.gf +make use of the resource. The RestaurantX.gf grammars are just one possible application building on the generic -database.X.gf grammars. -Look at the -abstract database syntax -and, as an example, the -French concrete syntax. +DatabaseX.gf grammars. -

    A dialogue system for the video recorder

    - -The grammars video/video.X.gf are meant to be a prototype -for dialogu systems. Look at the -abstract video grammar -and, as an example, the -English concrete syntax. - -

    Functional morphology

    @@ -554,40 +499,16 @@ One reason is the absence of low-level programming, such as string matching. Another reason is efficiency. In connection with the resource grammar project, we have started another project, functional morphology, which uses Haskell to implement -morphology. Haskell morphologies can then be used for generating -GF morphologies, as exemplified by large parts of -morpho.Swe.gf. - -

    - -Work is in progress to document functional morphology, but here is -a beginning: -

      -
    • General library for defining morphologies: - General.hs. -
    • Swedish inflection engine: RulesSw.hs. -
    -(Notice that we have here used gfdoc on Haskell files.) - -

    - -To see that it is nevertheless possible to implement morphology in GF, look -at the French morphology in -morpho.Fra.gf. -Its verb part is complete in the sense that it -implements all the 88 inflection tables of the Bescherelle. +morphology. See the +Functional Morphology Homepage +for more information.

    Further reading

    -If you want to read an informal introduction to -resource grammars, see these -slides, written for a German computer science -audience. Or these -other slides, written for a Swedish -linguistic audience. - +The paper Modular Grammar Engineering in GF and +a set of slides on the same topic.