next-lib renamed to lib, lib to old-lib

This commit is contained in:
aarne
2009-06-22 15:39:08 +00:00
parent 3049b59b35
commit e89fdae2fa
850 changed files with 38082 additions and 457938 deletions

View File

@@ -3,8 +3,8 @@
all: build
dist/setup-config: GF.cabal
chmod u+x next-lib/src/mkPresent
chmod u+x next-lib/src/mkMinimal
chmod u+x lib/src/mkPresent
chmod u+x lib/src/mkMinimal
runghc Setup.hs configure
build: dist/setup-config

View File

@@ -149,7 +149,7 @@ testRGL args _ pkg lbi = do
else return False
rgl_dir = "next-lib" </> "src"
rgl_dir = "lib" </> "src"
-- the languages have long directory names and short ISO codes (3 letters)
-- we also give the decodings for postprocessing linearizations, as long as grammars

View File

@@ -1,4 +1,4 @@
--# -path=.:/Users/aarne/GF/next-lib/present
--# -path=.:present
concrete AttemptoFre of Attempto = SymbolsC ** AttemptoI with
(Syntax = SyntaxFre),

View File

@@ -1,4 +1,4 @@
--# -path=.:/Users/aarne/GF/next-lib/present
--# -path=.:present
concrete TestAttemptoEng of TestAttempto = AttemptoEng **
open SyntaxEng, ParadigmsEng, IrregEng, (C = ConstructX) in {

View File

@@ -1,4 +1,4 @@
--# -path=.:/Users/aarne/GF/next-lib/present
--# -path=.:present
concrete TestAttemptoFre of TestAttempto = AttemptoFre **
open SyntaxFre, ParadigmsFre, IrregFre, (C = ConstructX) in {

View File

@@ -1,4 +1,4 @@
--# -path=.:/Users/aarne/GF/next-lib/present
--# -path=.:present
concrete TestAttemptoSwe of TestAttempto = AttemptoSwe **
open SyntaxSwe, ParadigmsSwe, IrregSwe, (C = ConstructX) in {

View File

@@ -1,4 +1,4 @@
# notice: GF_LIB_PATH has to point to GF/next-lib
# notice: GF_LIB_PATH has to point to GF/lib
all: magnet

View File

@@ -1,107 +0,0 @@
digraph {
size = "12,12" ;
LangGer [style = "dashed", shape = "box", URL = "LangGer.gf"];
LangGer -> NounGer [style = "solid"];
LangGer -> VerbGer [style = "solid"];
LangGer -> ConjunctionGer [style = "solid"];
LangGer -> StructuralGer [style = "solid"];
LangGer -> LexiconGer [style = "solid"];
LangGer -> Lang [arrowhead = "empty", style = "dashed"];
Lang [style = "solid", shape = "ellipse", URL = "Lang.gf"];
Lang -> Noun [style = "solid"];
Lang -> Verb [style = "solid"];
Lang -> Conjunction [style = "solid"];
Lang -> Structural [style = "solid"];
Lang -> Lexicon [style = "solid"];
NounGer [style = "dashed", shape = "box", URL = "NounGer.gf"];
NounGer -> CatGer [style = "solid"];
NounGer -> ResGer [style = "dotted"];
NounGer -> Prelude [style = "dotted"];
NounGer -> Noun [arrowhead = "empty", style = "dashed"];
Noun [style = "solid", shape = "ellipse", URL = "Noun.gf"];
Noun -> Cat [style = "solid"];
VerbGer [style = "dashed", shape = "box", URL = "VerbGer.gf"];
VerbGer -> CatGer [style = "solid"];
VerbGer -> Prelude [style = "dotted"];
VerbGer -> ResGer [style = "dotted"];
VerbGer -> Verb [arrowhead = "empty", style = "dashed"];
Verb [style = "solid", shape = "ellipse", URL = "Verb.gf"];
Verb -> Cat [style = "solid"];
ConjunctionGer [style = "dashed", shape = "box", URL = "ConjunctionGer.gf"];
ConjunctionGer -> CatGer [style = "solid"];
ConjunctionGer -> ResGer [style = "dotted"];
ConjunctionGer -> Coordination [style = "dotted"];
ConjunctionGer -> Prelude [style = "dotted"];
ConjunctionGer -> Conjunction [arrowhead = "empty", style = "dashed"];
Conjunction [style = "solid", shape = "ellipse", URL = "Conjunction.gf"];
Conjunction -> Cat [style = "solid"];
Coordination [style = "dashed", shape = "ellipse", URL = "Coordination.gf"];
Coordination -> Prelude [style = "dotted"];
StructuralGer [style = "dashed", shape = "box", URL = "StructuralGer.gf"];
StructuralGer -> CatGer [style = "solid"];
StructuralGer -> MorphoGer [style = "dotted"];
StructuralGer -> Prelude [style = "dotted"];
StructuralGer -> Structural [arrowhead = "empty", style = "dashed"];
Structural [style = "solid", shape = "ellipse", URL = "Structural.gf"];
Structural -> Cat [style = "solid"];
LexiconGer [style = "dashed", shape = "box", URL = "LexiconGer.gf"];
LexiconGer -> CatGer [style = "solid"];
LexiconGer -> Prelude [style = "dotted"];
LexiconGer -> ParadigmsGer [style = "dotted"];
LexiconGer -> Lexicon [arrowhead = "empty", style = "dashed"];
Lexicon [style = "solid", shape = "ellipse", URL = "Lexicon.gf"];
Lexicon -> Cat [style = "solid"];
ParadigmsGer [style = "dashed", shape = "ellipse", URL = "ParadigmsGer.gf"];
ParadigmsGer -> Predef [style = "dotted"];
ParadigmsGer -> Prelude [style = "dotted"];
ParadigmsGer -> MorphoGer [style = "dotted"];
ParadigmsGer -> CatGer [style = "dotted"];
CatGer [style = "dashed", shape = "box", URL = "CatGer.gf"];
CatGer -> CommonX [style = "solid"];
CatGer -> ResGer [style = "dotted"];
CatGer -> Prelude [style = "dotted"];
CatGer -> Cat [arrowhead = "empty", style = "dashed"];
Cat [style = "solid", shape = "ellipse", URL = "Cat.gf"];
Cat -> Common [style = "solid"];
CommonX [style = "dashed", shape = "box", URL = "CommonX.gf"];
CommonX -> ParamX [style = "dotted"];
CommonX -> Common [arrowhead = "empty", style = "dashed"];
Common [style = "solid", shape = "ellipse", URL = "Common.gf"];
MorphoGer [style = "dashed", shape = "ellipse", URL = "MorphoGer.gf"];
MorphoGer -> ResGer [style = "solid"];
MorphoGer -> Prelude [style = "dotted"];
MorphoGer -> Predef [style = "dotted"];
ResGer [style = "dashed", shape = "ellipse", URL = "ResGer.gf"];
ResGer -> ParamX [style = "solid"];
ResGer -> Prelude [style = "dotted"];
ParamX [style = "dashed", shape = "ellipse", URL = "ParamX.gf"];
ParamX -> Prelude [style = "dotted"];
Prelude [style = "dashed", shape = "ellipse", URL = "Prelude.gf"];
Prelude -> Predef [style = "dotted"];
Predef [style = "dashed", shape = "ellipse", URL = "Predef.gf"];
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -1,75 +0,0 @@
digraph {
size = "12,8" ;
Lang [style = "solid", shape = "ellipse", URL = "Lang.gf"];
Lang -> Grammar [style = "solid"];
Lang -> Lexicon [style = "solid"];
Grammar [style = "solid", shape = "ellipse", URL = "Lang.gf"];
Grammar -> Noun [style = "solid"];
Grammar -> Verb [style = "solid"];
Grammar -> Adjective [style = "solid"];
Grammar -> Adverb [style = "solid"];
Grammar -> Numeral [style = "solid"];
Grammar -> Sentence [style = "solid"];
Grammar -> Question [style = "solid"];
Grammar -> Relative [style = "solid"];
Grammar -> Conjunction [style = "solid"];
Grammar -> Phrase [style = "solid"];
Grammar -> Text [style = "solid"];
Grammar -> Idiom [style = "solid"];
Grammar -> Structural [style = "solid"];
Noun [style = "solid", shape = "ellipse", URL = "Noun.gf"];
Noun -> Cat [style = "solid"];
Verb [style = "solid", shape = "ellipse", URL = "Verb.gf"];
Verb -> Cat [style = "solid"];
Adjective [style = "solid", shape = "ellipse", URL = "Adjective.gf"];
Adjective -> Cat [style = "solid"];
Adverb [style = "solid", shape = "ellipse", URL = "Adverb.gf"];
Adverb -> Cat [style = "solid"];
Numeral [style = "solid", shape = "ellipse", URL = "Numeral.gf"];
Numeral -> Cat [style = "solid"];
Sentence [style = "solid", shape = "ellipse", URL = "Sentence.gf"];
Sentence -> Cat [style = "solid"];
Question [style = "solid", shape = "ellipse", URL = "Question.gf"];
Question -> Cat [style = "solid"];
Relative [style = "solid", shape = "ellipse", URL = "Relative.gf"];
Relative -> Cat [style = "solid"];
Conjunction [style = "solid", shape = "ellipse", URL = "Conjunction.gf"];
Conjunction -> Cat [style = "solid"];
Phrase [style = "solid", shape = "ellipse", URL = "Phrase.gf"];
Phrase -> Cat [style = "solid"];
Text [style = "solid", shape = "ellipse", URL = "Phrase.gf"];
Text -> Cat [style = "solid"];
Idiom [style = "solid", shape = "ellipse", URL = "Phrase.gf"];
Idiom -> Cat [style = "solid"];
Structural [style = "solid", shape = "ellipse", URL = "Structural.gf"];
Structural -> Cat [style = "solid"];
Lexicon [style = "solid", shape = "ellipse", URL = "Lexicon.gf"];
Lexicon -> Cat [style = "solid"];
Cat [style = "solid", shape = "ellipse", URL = "Cat.gf"];
Cat -> Common [style = "solid"];
Common [style = "solid", shape = "ellipse", URL = "Tense.gf"];
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

View File

@@ -1,68 +0,0 @@
digraph {
size = "12,8" ;
Lang [style = "solid", shape = "ellipse", URL = "Lang.gf"];
Lang -> Noun [style = "solid"];
Lang -> Verb [style = "solid"];
Lang -> Adjective [style = "solid"];
Lang -> Adverb [style = "solid"];
Lang -> Numeral [style = "solid"];
Lang -> Sentence [style = "solid"];
Lang -> Question [style = "solid"];
Lang -> Relative [style = "solid"];
Lang -> Conjunction [style = "solid"];
Lang -> Phrase [style = "solid"];
Lang -> Text [style = "solid"];
Lang -> Idiom [style = "solid"];
Lang -> Structural [style = "solid"];
Lang -> Lexicon [style = "solid"];
Noun [style = "solid", shape = "ellipse", URL = "Noun.gf"];
Noun -> Cat [style = "solid"];
Verb [style = "solid", shape = "ellipse", URL = "Verb.gf"];
Verb -> Cat [style = "solid"];
Adjective [style = "solid", shape = "ellipse", URL = "Adjective.gf"];
Adjective -> Cat [style = "solid"];
Adverb [style = "solid", shape = "ellipse", URL = "Adverb.gf"];
Adverb -> Cat [style = "solid"];
Numeral [style = "solid", shape = "ellipse", URL = "Numeral.gf"];
Numeral -> Cat [style = "solid"];
Sentence [style = "solid", shape = "ellipse", URL = "Sentence.gf"];
Sentence -> Cat [style = "solid"];
Question [style = "solid", shape = "ellipse", URL = "Question.gf"];
Question -> Cat [style = "solid"];
Relative [style = "solid", shape = "ellipse", URL = "Relative.gf"];
Relative -> Cat [style = "solid"];
Conjunction [style = "solid", shape = "ellipse", URL = "Conjunction.gf"];
Conjunction -> Cat [style = "solid"];
Phrase [style = "solid", shape = "ellipse", URL = "Phrase.gf"];
Phrase -> Cat [style = "solid"];
Text [style = "solid", shape = "ellipse", URL = "Phrase.gf"];
Text -> Cat [style = "solid"];
Idiom [style = "solid", shape = "ellipse", URL = "Phrase.gf"];
Idiom -> Cat [style = "solid"];
Structural [style = "solid", shape = "ellipse", URL = "Structural.gf"];
Structural -> Cat [style = "solid"];
Lexicon [style = "solid", shape = "ellipse", URL = "Lexicon.gf"];
Lexicon -> Cat [style = "solid"];
Cat [style = "solid", shape = "ellipse", URL = "Cat.gf"];
Cat -> Common [style = "solid"];
Common [style = "solid", shape = "ellipse", URL = "Tense.gf"];
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

View File

@@ -1,16 +0,0 @@
.PHONY: abstract synopsis
all: synopsis abstract
index:
txt2tags -thtml index.txt
synopsis:
runghc MkSynopsis.hs
categories-imagemap.html: categories.dot
dot -Tcmapx $^ > $@
abstract:
gfdoc -txthtml ../src/abstract/*.gf
mv ../src/abstract/*.html abstract

View File

@@ -1,787 +0,0 @@
Resource grammar writing HOWTO
Author: Aarne Ranta <aarne (at) cs.chalmers.se>
Last update: %%date(%c)
% NOTE: this is a txt2tags file.
% Create an html file from this file using:
% txt2tags --toc -thtml Resource-HOWTO.txt
%!target:html
**History**
October 2007: updated for API 1.2.
January 2006: first version.
The purpose of this document is to tell how to implement the GF
resource grammar API for a new language. We will //not// cover how
to use the resource grammar, nor how to change the API. But we
will give some hints how to extend the API.
A manual for using the resource grammar is found in
[``http://www.cs.chalmers.se/~aarne/GF/lib/resource-1.0/doc/synopsis.html`` http://www.cs.chalmers.se/~aarne/GF/lib/resource-1.0/doc/synopsis.html].
A tutorial on GF, also introducing the idea of resource grammars, is found in
[``http://www.cs.chalmers.se/~aarne/GF/doc/tutorial/gf-tutorial2.html`` ../../../doc/tutorial/gf-tutorial2.html].
This document concerns the API v. 1.0. You can find the current code in
[``http://www.cs.chalmers.se/~aarne/GF/lib/resource-1.0/`` ..]
==The resource grammar structure==
The library is divided into a bunch of modules, whose dependencies
are given in the following figure.
[Syntax.png]
- solid contours: module used by end users
- dashed contours: internal module
- ellipse: abstract/concrete pair of modules
- rectangle: resource or instance
- diamond: interface
The solid ellipses show the API as visible to the user of the library. The
dashed ellipses form the main of the implementation, on which the resource
grammar programmer has to work with. With the exception of the ``Paradigms``
module, the visible API modules can be produced mechanically.
[Grammar.png]
Thus the API consists of a grammar and a lexicon, which is
provided for test purposes.
The module structure is rather flat: most modules are direct
parents of ``Grammar``. The idea
is that you can concentrate on one linguistic aspect at a time, or
also distribute the work among several authors. The module ``Cat``
defines the "glue" that ties the aspects together - a type system
to which all the other modules conform, so that e.g. ``NP`` means
the same thing in those modules that use ``NP``s and those that
constructs them.
===Phrase category modules===
The direct parents of the top will be called **phrase category modules**,
since each of them concentrates on a particular phrase category (nouns, verbs,
adjectives, sentences,...). A phrase category module tells
//how to construct phrases in that category//. You will find out that
all functions in any of these modules have the same value type (or maybe
one of a small number of different types). Thus we have
- ``Noun``: construction of nouns and noun phrases
- ``Adjective``: construction of adjectival phrases
- ``Verb``: construction of verb phrases
- ``Adverb``: construction of adverbial phrases
- ``Numeral``: construction of cardinal and ordinal numerals
- ``Sentence``: construction of sentences and imperatives
- ``Question``: construction of questions
- ``Relative``: construction of relative clauses
- ``Conjunction``: coordination of phrases
- ``Phrase``: construction of the major units of text and speech
- ``Text``: construction of texts as sequences of phrases
- ``Idiom``: idiomatic phrases such as existentials
===Infrastructure modules===
Expressions of each phrase category are constructed in the corresponding
phrase category module. But their //use// takes mostly place in other modules.
For instance, noun phrases, which are constructed in ``Noun``, are
used as arguments of functions of almost all other phrase category modules.
How can we build all these modules independently of each other?
As usual in typeful programming, the //only// thing you need to know
about an object you use is its type. When writing a linearization rule
for a GF abstract syntax function, the only thing you need to know is
the linearization types of its value and argument categories. To achieve
the division of the resource grammar to several parallel phrase category modules,
what we need is an underlying definition of the linearization types. This
definition is given as the implementation of
- ``Cat``: syntactic categories of the resource grammar
Any resource grammar implementation has first to agree on how to implement
``Cat``. Luckily enough, even this can be done incrementally: you
can skip the ``lincat`` definition of a category and use the default
``{s : Str}`` until you need to change it to something else. In
English, for instance, many categories do have this linearization type.
===Lexical modules===
What is lexical and what is syntactic is not as clearcut in GF as in
some other grammar formalisms. Logically, lexical means atom, i.e. a
``fun`` with no arguments. Linguistically, one may add to this
that the ``lin`` consists of only one token (or of a table whose values
are single tokens). Even in the restricted lexicon included in the resource
API, the latter rule is sometimes violated in some languages. For instance,
``Structural.both7and_DConj`` is an atom, but its linearization is
two words e.g. //both - and//.
Another characterization of lexical is that lexical units can be added
almost //ad libitum//, and they cannot be defined in terms of already
given rules. The lexical modules of the resource API are thus more like
samples than complete lists. There are two such modules:
- ``Structural``: structural words (determiners, conjunctions,...)
- ``Lexicon``: basic everyday content words (nouns, verbs,...)
The module ``Structural`` aims for completeness, and is likely to
be extended in future releases of the resource. The module ``Lexicon``
gives a "random" list of words, which enable interesting testing of syntax,
and also a check list for morphology, since those words are likely to include
most morphological patterns of the language.
In the case of ``Lexicon`` it may come out clearer than anywhere else
in the API that it is impossible to give exact translation equivalents in
different languages on the level of a resource grammar. In other words,
application grammars are likely to use the resource in different ways for
different languages.
==Language-dependent syntax modules==
In addition to the common API, there is room for language-dependent extensions
of the resource. The top level of each languages looks as follows (with English as example):
```
abstract English = Grammar, ExtraEngAbs, DictEngAbs
```
where ``ExtraEngAbs`` is a collection of syntactic structures specific to English,
and ``DictEngAbs`` is an English dictionary
(at the moment, it consists of ``IrregEngAbs``,
the irregular verbs of English). Each of these language-specific grammars has
the potential to grow into a full-scale grammar of the language. These grammar
can also be used as libraries, but the possibility of using functors is lost.
To give a better overview of language-specific structures,
modules like ``ExtraEngAbs``
are built from a language-independent module ``ExtraAbs``
by restricted inheritance:
```
abstract ExtraEngAbs = Extra [f,g,...]
```
Thus any category and function in ``Extra`` may be shared by a subset of all
languages. One can see this set-up as a matrix, which tells
what ``Extra`` structures
are implemented in what languages. For the common API in ``Grammar``, the matrix
is filled with 1's (everything is implemented in every language).
In a minimal resource grammar implementation, the language-dependent
extensions are just empty modules, but it is good to provide them for
the sake of uniformity.
==The core of the syntax==
Among all categories and functions, a handful are
most important and distinct ones, of which the others are can be
seen as variations. The categories are
```
Cl ; VP ; V2 ; NP ; CN ; Det ; AP ;
```
The functions are
```
PredVP : NP -> VP -> Cl ; -- predication
ComplV2 : V2 -> NP -> VP ; -- complementization
DetCN : Det -> CN -> NP ; -- determination
ModCN : AP -> CN -> CN ; -- modification
```
This [toy Latin grammar latin.gf] shows in a nutshell how these
rules relate the categories to each other. It is intended to be a
first approximation when designing the parameter system of a new
language.
===Another reduced API===
If you want to experiment with a small subset of the resource API first,
try out the module
[Syntax http://www.cs.chalmers.se/~aarne/GF/doc/tutorial/resource/Syntax.gf]
explained in the
[GF Tutorial http://www.cs.chalmers.se/~aarne/GF/doc/tutorial/gf-tutorial2.html].
===The present-tense fragment===
Some lines in the resource library are suffixed with the comment
```--# notpresent
which is used by a preprocessor to exclude those lines from
a reduced version of the full resource. This present-tense-only
version is useful for applications in most technical text, since
they reduce the grammar size and compilation time. It can also
be useful to exclude those lines in a first version of resource
implementation. To compile a grammar with present-tense-only, use
```
i -preproc=GF/lib/resource-1.0/mkPresent LangGer.gf
```
==Phases of the work==
===Putting up a directory===
Unless you are writing an instance of a parametrized implementation
(Romance or Scandinavian), which will be covered later, the
simplest way is to follow roughly the following procedure. Assume you
are building a grammar for the German language. Here are the first steps,
which we actually followed ourselves when building the German implementation
of resource v. 1.0.
+ Create a sister directory for ``GF/lib/resource/english``, named
``german``.
```
cd GF/lib/resource/
mkdir german
cd german
```
+ Check out the [ISO 639 3-letter language code
http://www.w3.org/WAI/ER/IG/ert/iso639.htm]
for German: both ``Ger`` and ``Deu`` are given, and we pick ``Ger``.
+ Copy the ``*Eng.gf`` files from ``english`` ``german``,
and rename them:
```
cp ../english/*Eng.gf .
rename 's/Eng/Ger/' *Eng.gf
```
+ Change the ``Eng`` module references to ``Ger`` references
in all files:
```
sed -i 's/English/German/g' *Ger.gf
sed -i 's/Eng/Ger/g' *Ger.gf
```
The first line prevents changing the word ``English``, which appears
here and there in comments, to ``Gerlish``.
+ This may of course change unwanted occurrences of the
string ``Eng`` - verify this by
```
grep Ger *.gf
```
But you will have to make lots of manual changes in all files anyway!
+ Comment out the contents of these files:
```
sed -i 's/^/--/' *Ger.gf
```
This will give you a set of templates out of which the grammar
will grow as you uncomment and modify the files rule by rule.
+ In all ``.gf`` files, uncomment the module headers and brackets,
leaving the module bodies commented. Unfortunately, there is no
simple way to do this automatically (or to avoid commenting these
lines in the previous step) - but uncommenting the first
and the last lines will actually do the job for many of the files.
+ Uncomment the contents of the main grammar file:
```
sed -i 's/^--//' LangGer.gf
```
+ Now you can open the grammar ``LangGer`` in GF:
```
gf LangGer.gf
```
You will get lots of warnings on missing rules, but the grammar will compile.
+ At all following steps you will now have a valid, but incomplete
GF grammar. The GF command
```
pg -printer=missing
```
tells you what exactly is missing.
Here is the module structure of ``LangGer``. It has been simplified by leaving out
the majority of the phrase category modules. Each of them has the same dependencies
as e.g. ``VerbGer``.
[German.png]
===Direction of work===
The real work starts now. There are many ways to proceed, the main ones being
- Top-down: start from the module ``Phrase`` and go down to ``Sentence``, then
``Verb``, ``Noun``, and in the end ``Lexicon``. In this way, you are all the time
building complete phrases, and add them with more content as you proceed.
**This approach is not recommended**. It is impossible to test the rules if
you have no words to apply the constructions to.
- Bottom-up: set as your first goal to implement ``Lexicon``. To this end, you
need to write ``ParadigmsGer``, which in turn needs parts of
``MorphoGer`` and ``ResGer``.
**This approach is not recommended**. You can get stuck to details of
morphology such as irregular words, and you don't have enough grasp about
the type system to decide what forms to cover in morphology.
The practical working direction is thus a saw-like motion between the morphological
and top-level modules. Here is a possible course of the work that gives enough
test data and enough general view at any point:
+ Define ``Cat.N`` and the required parameter types in ``ResGer``. As we define
```
lincat N = {s : Number => Case => Str ; g : Gender} ;
```
we need the parameter types ``Number``, ``Case``, and ``Gender``. The definition
of ``Number`` in [``common/ParamX`` ../common/ParamX.gf] works for German, so we
use it and just define ``Case`` and ``Gender`` in ``ResGer``.
+ Define ``regN`` in ``ParadigmsGer``. In this way you can
already implement a huge amount of nouns correctly in ``LexiconGer``. Actually
just adding ``mkN`` should suffice for every noun - but,
since it is tedious to use, you
might proceed to the next step before returning to morphology and defining the
real work horse ``reg2N``.
+ While doing this, you may want to test the resource independently. Do this by
```
i -retain ParadigmsGer
cc regN "Kirche"
```
+ Proceed to determiners and pronouns in
``NounGer`` (``DetCN UsePron DetSg SgQuant NoNum NoOrd DefArt IndefArt UseN``)and
``StructuralGer`` (``i_Pron every_Det``). You also need some categories and
parameter types. At this point, it is maybe not possible to find out the final
linearization types of ``CN``, ``NP``, and ``Det``, but at least you should
be able to correctly inflect noun phrases such as //every airplane//:
```
i LangGer.gf
l -table DetCN every_Det (UseN airplane_N)
Nom: jeder Flugzeug
Acc: jeden Flugzeug
Dat: jedem Flugzeug
Gen: jedes Flugzeugs
```
+ Proceed to verbs: define ``CatGer.V``, ``ResGer.VForm``, and
``ParadigmsGer.regV``. You may choose to exclude ``notpresent``
cases at this point. But anyway, you will be able to inflect a good
number of verbs in ``Lexicon``, such as
``live_V`` (``regV "leven"``).
+ Now you can soon form your first sentences: define ``VP`` and
``Cl`` in ``CatGer``, ``VerbGer.UseV``, and ``SentenceGer.PredVP``.
Even if you have excluded the tenses, you will be able to produce
```
i -preproc=mkPresent LangGer.gf
> l -table PredVP (UsePron i_Pron) (UseV live_V)
Pres Simul Pos Main: ich lebe
Pres Simul Pos Inv: lebe ich
Pres Simul Pos Sub: ich lebe
Pres Simul Neg Main: ich lebe nicht
Pres Simul Neg Inv: lebe ich nicht
Pres Simul Neg Sub: ich nicht lebe
```
+ Transitive verbs (``CatGer.V2 ParadigmsGer.dirV2 VerbGer.ComplV2``)
are a natural next step, so that you can
produce ``ich liebe dich``.
+ Adjectives (``CatGer.A ParadigmsGer.regA NounGer.AdjCN AdjectiveGer.PositA``)
will force you to think about strong and weak declensions, so that you can
correctly inflect //my new car, this new car//.
+ Once you have implemented the set
(``Noun.DetCN Noun.AdjCN Verb.UseV Verb.ComplV2 Sentence.PredVP),
you have overcome most of difficulties. You know roughly what parameters
and dependences there are in your language, and you can now produce very
much in the order you please.
===The develop-test cycle===
The following develop-test cycle will
be applied most of the time, both in the first steps described above
and in later steps where you are more on your own.
+ Select a phrase category module, e.g. ``NounGer``, and uncomment some
linearization rules (for instance, ``DefSg``, which is
not too complicated).
+ Write down some German examples of this rule, for instance translations
of "the dog", "the house", "the big house", etc. Write these in all their
different forms (two numbers and four cases).
+ Think about the categories involved (``CN, NP, N``) and the
variations they have. Encode this in the lincats of ``CatGer``.
You may have to define some new parameter types in ``ResGer``.
+ To be able to test the construction,
define some words you need to instantiate it
in ``LexiconGer``. You will also need some regular inflection patterns
in``ParadigmsGer``.
+ Test by parsing, linearization,
and random generation. In particular, linearization to a table should
be used so that you see all forms produced:
```
gr -cat=NP -number=20 -tr | l -table
```
+ Spare some tree-linearization pairs for later regression testing. Use the
``tree_bank`` command,
```
gr -cat=NP -number=20 | tb -xml | wf NP.tb
```
You can later compared your modified grammar to this treebank by
```
rf NP.tb | tb -c
```
You are likely to run this cycle a few times for each linearization rule
you implement, and some hundreds of times altogether. There are 66 ``cat``s and
458 ``funs`` in ``Lang`` at the moment; 149 of the ``funs`` are outside the two
lexicon modules).
Here is a [live log ../german/log.txt] of the actual process of
building the German implementation of resource API v. 1.0.
It is the basis of the more detailed explanations, which will
follow soon. (You will found out that these explanations involve
a rational reconstruction of the live process! Among other things, the
API was changed during the actual process to make it more intuitive.)
===Resource modules used===
These modules will be written by you.
- ``ResGer``: parameter types and auxiliary operations
(a resource for the resource grammar!)
- ``ParadigmsGer``: complete inflection engine and most important regular paradigms
- ``MorphoGer``: auxiliaries for ``ParadigmsGer`` and ``StructuralGer``. This need
not be separate from ``ResGer``.
These modules are language-independent and provided by the existing resource
package.
- ``ParamX``: parameter types used in many languages
- ``CommonX``: implementation of language-uniform categories
such as $Text$ and $Phr$, as well as of
the logical tense, anteriority, and polarity parameters
- ``Coordination``: operations to deal with lists and coordination
- ``Prelude``: general-purpose operations on strings, records,
truth values, etc.
- ``Predefined``: general-purpose operations with hard-coded definitions
An important decision is what rules to implement in terms of operations in
``ResGer``. A golden rule of functional programming says that, whenever
you find yourself programming by copy and paste, you should write a function
instead. This indicates that an operation should be created if it is to be
used at least twice. At the same time, a sound principle of vicinity says that
it should not require too much browsing to understand what a rule does.
From these two principles, we have derived the following practice:
- If an operation is needed //in two different modules//,
it should be created in ``ResGer``. An example is ``mkClause``,
used in ``Sentence``, ``Question``, and ``Relative``-
- If an operation is needed //twice in the same module//, but never
outside, it should be created in the same module. Many examples are
found in ``Numerals``.
- If an operation is only needed once, it should not be created (but rather
inlined). Most functions in phrase category modules are implemented in this
way.
This discipline is very different from the one followed in earlier
versions of the library (up to 0.9). We then valued the principle of
abstraction more than vicinity, creating layers of abstraction for
almost everything. This led in practice to the duplication of almost
all code on the ``lin`` and ``oper`` levels, and made the code
hard to understand and maintain.
===Morphology and lexicon===
The paradigms needed to implement
``LexiconGer`` are defined in
``ParadigmsGer``.
This module provides high-level ways to define the linearization of
lexical items, of categories ``N, A, V`` and their complement-taking
variants.
For ease of use, the ``Paradigms`` modules follow a certain
naming convention. Thus they for each lexical category, such as ``N``,
the functions
- ``mkN``, for worst-case construction of ``N``. Its type signature
has the form
```
mkN : Str -> ... -> Str -> P -> ... -> Q -> N
```
with as many string and parameter arguments as can ever be needed to
construct an ``N``.
- ``regN``, for the most common cases, with just one string argument:
```
regN : Str -> N
```
- A language-dependent (small) set of functions to handle mild irregularities
and common exceptions.
For the complement-taking variants, such as ``V2``, we provide
- ``mkV2``, which takes a ``V`` and all necessary arguments, such
as case and preposition:
```
mkV2 : V -> Case -> Str -> V2 ;
```
- A language-dependent (small) set of functions to handle common special cases,
such as direct transitive verbs:
```
dirV2 : V -> V2 ;
-- dirV2 v = mkV2 v accusative []
```
The golden rule for the design of paradigms is that
- The user will only need function applications with constants and strings,
never any records or tables.
The discipline of data abstraction moreover requires that the user of the resource
is not given access to parameter constructors, but only to constants that denote
them. This gives the resource grammarian the freedom to change the underlying
data representation if needed. It means that the ``ParadigmsGer`` module has
to define constants for those parameter types and constructors that
the application grammarian may need to use, e.g.
```
oper
Case : Type ;
nominative, accusative, genitive, dative : Case ;
```
These constants are defined in terms of parameter types and constructors
in ``ResGer`` and ``MorphoGer``, which modules are not
visible to the application grammarian.
===Lock fields===
An important difference between ``MorphoGer`` and
``ParadigmsGer`` is that the former uses "raw" record types
for word classes, whereas the latter used category symbols defined in
``CatGer``. When these category symbols are used to denote
record types in a resource modules, such as ``ParadigmsGer``,
a **lock field** is added to the record, so that categories
with the same implementation are not confused with each other.
(This is inspired by the ``newtype`` discipline in Haskell.)
For instance, the lincats of adverbs and conjunctions are the same
in ``CommonX`` (and therefore in ``CatGer``, which inherits it):
```
lincat Adv = {s : Str} ;
lincat Conj = {s : Str} ;
```
But when these category symbols are used to denote their linearization
types in resource module, these definitions are translated to
```
oper Adv : Type = {s : Str ; lock_Adv : {}} ;
oper Conj : Type = {s : Str} ; lock_Conj : {}} ;
```
In this way, the user of a resource grammar cannot confuse adverbs with
conjunctions. In other words, the lock fields force the type checker
to function as grammaticality checker.
When the resource grammar is ``open``ed in an application grammar, the
lock fields are never seen (except possibly in type error messages),
and the application grammarian should never write them herself. If she
has to do this, it is a sign that the resource grammar is incomplete, and
the proper way to proceed is to fix the resource grammar.
The resource grammarian has to provide the dummy lock field values
in her hidden definitions of constants in ``Paradigms``. For instance,
```
mkAdv : Str -> Adv ;
-- mkAdv s = {s = s ; lock_Adv = <>} ;
```
===Lexicon construction===
The lexicon belonging to ``LangGer`` consists of two modules:
- ``StructuralGer``, structural words, built by directly using
``MorphoGer``.
- ``BasicGer``, content words, built by using ``ParadigmsGer``.
The reason why ``MorphoGer`` has to be used in ``StructuralGer``
is that ``ParadigmsGer`` does not contain constructors for closed
word classes such as pronouns and determiners. The reason why we
recommend ``ParadigmsGer`` for building ``LexiconGer`` is that
the coverage of the paradigms gets thereby tested and that the
use of the paradigms in ``LexiconGer`` gives a good set of examples for
those who want to build new lexica.
==Inside grammar modules==
Detailed implementation tricks
are found in the comments of each module.
===The category system===
- [Common gfdoc/Common.html], [CommonX ../common/CommonX.gf]
- [Cat gfdoc/Cat.html], [CatGer gfdoc/CatGer.gf]
===Phrase category modules===
- [Noun gfdoc/Noun.html], [NounGer ../german/NounGer.gf]
- [Adjective gfdoc/Adjective.html], [AdjectiveGer ../german/AdjectiveGer.gf]
- [Verb gfdoc/Verb.html], [VerbGer ../german/VerbGer.gf]
- [Adverb gfdoc/Adverb.html], [AdverbGer ../german/AdverbGer.gf]
- [Numeral gfdoc/Numeral.html], [NumeralGer ../german/NumeralGer.gf]
- [Sentence gfdoc/Sentence.html], [SentenceGer ../german/SentenceGer.gf]
- [Question gfdoc/Question.html], [QuestionGer ../german/QuestionGer.gf]
- [Relative gfdoc/Relative.html], [RelativeGer ../german/RelativeGer.gf]
- [Conjunction gfdoc/Conjunction.html], [ConjunctionGer ../german/ConjunctionGer.gf]
- [Phrase gfdoc/Phrase.html], [PhraseGer ../german/PhraseGer.gf]
- [Text gfdoc/Text.html], [TextX ../common/TextX.gf]
- [Idiom gfdoc/Idiom.html], [IdiomGer ../german/IdiomGer.gf]
- [Lang gfdoc/Lang.html], [LangGer ../german/LangGer.gf]
===Resource modules===
- [ResGer ../german/ResGer.gf]
- [MorphoGer ../german/MorphoGer.gf]
- [ParadigmsGer gfdoc/ParadigmsGer.html], [ParadigmsGer.gf ../german/ParadigmsGer.gf]
===Lexicon===
- [Structural gfdoc/Structural.html], [StructuralGer ../german/StructuralGer.gf]
- [Lexicon gfdoc/Lexicon.html], [LexiconGer ../german/LexiconGer.gf]
==Lexicon extension==
===The irregularity lexicon===
It may be handy to provide a separate module of irregular
verbs and other words which are difficult for a lexicographer
to handle. There are usually a limited number of such words - a
few hundred perhaps. Building such a lexicon separately also
makes it less important to cover //everything// by the
worst-case paradigms (``mkV`` etc).
===Lexicon extraction from a word list===
You can often find resources such as lists of
irregular verbs on the internet. For instance, the
[Irregular German Verbs http://www.iee.et.tu-dresden.de/~wernerr/grammar/verben_dt.html]
page gives a list of verbs in the
traditional tabular format, which begins as follows:
```
backen (du bäckst, er bäckt) backte [buk] gebacken
befehlen (du befiehlst, er befiehlt; befiehl!) befahl (beföhle; befähle) befohlen
beginnen begann (begönne; begänne) begonnen
beißen biß gebissen
```
All you have to do is to write a suitable verb paradigm
```
irregV : (x1,_,_,_,_,x6 : Str) -> V ;
```
and a Perl or Python or Haskell script that transforms
the table to
```
backen_V = irregV "backen" "bäckt" "back" "backte" "backte" "gebacken" ;
befehlen_V = irregV "befehlen" "befiehlt" "befiehl" "befahl" "beföhle" "befohlen" ;
```
When using ready-made word lists, you should think about
coyright issues. Ideally, all resource grammar material should
be provided under GNU General Public License.
===Lexicon extraction from raw text data===
This is a cheap technique to build a lexicon of thousands
of words, if text data is available in digital format.
See the [Functional Morphology http://www.cs.chalmers.se/~markus/FM/]
homepage for details.
===Extending the resource grammar API===
Sooner or later it will happen that the resource grammar API
does not suffice for all applications. A common reason is
that it does not include idiomatic expressions in a given language.
The solution then is in the first place to build language-specific
extension modules. This chapter will deal with this issue (to be completed).
==Writing an instance of parametrized resource grammar implementation==
Above we have looked at how a resource implementation is built by
the copy and paste method (from English to German), that is, formally
speaking, from scratch. A more elegant solution available for
families of languages such as Romance and Scandinavian is to
use parametrized modules. The advantages are
- theoretical: linguistic generalizations and insights
- practical: maintainability improves with fewer components
In this chapter, we will look at an example: adding Italian to
the Romance family (to be completed). Here is a set of
[slides http://www.cs.chalmers.se/~aarne/geocal2006.pdf]
on the topic.
==Parametrizing a resource grammar implementation==
This is the most demanding form of resource grammar writing.
We do //not// recommend the method of parametrizing from the
beginning: it is easier to have one language first implemented
in the conventional way and then add another language of the
same family by aprametrization. This means that the copy and
paste method is still used, but at this time the differences
are put into an ``interface`` module.
This chapter will work out an example of how an Estonian grammar
is constructed from the Finnish grammar through parametrization.

View File

@@ -1,111 +0,0 @@
digraph {
size = "12,8" ;
German [style = "solid", shape = "ellipse"];
ExtraGer [style = "solid", shape = "ellipse"];
IrregGer [style = "solid", shape = "ellipse"];
German -> IrregGer [style = "solid"];
German -> ExtraGer [style = "solid"];
German -> LangGer [style = "solid"];
IrregGer -> ParadigmsGer [style = "solid"];
ExtraGer -> Grammar [style = "solid"];
TryGer [style = "solid", shape = "rectangle"];
LangGer [style = "solid", shape = "ellipse"];
TryGer -> SyntaxGer [style = "solid"];
TryGer -> ParadigmsGer [style = "solid"];
TryGer -> Lexicon [style = "solid"];
LangGer -> Grammar [style = "solid"];
LangGer -> Lexicon [style = "solid"];
Lexicon [style = "dashed", shape = "ellipse", URL = "Lang.gf"];
SyntaxGer [style = "solid", shape = "rectangle"];
SyntaxGer -> Syntax [style = "solid"];
ParadigmsGer [style = "solid", shape = "rectangle"];
Syntax [style = "solid", shape = "diamond"];
Syntax -> Grammar [style = "solid"];
Syntax -> Constructors [style = "solid"];
ParadigmsGer -> Grammar [style = "solid"];
Constructors [style = "dashed", shape = "ellipse", URL = "Lang.gf"];
Constructors -> Grammar [style = "solid"];
Grammar [style = "dashed", shape = "ellipse", URL = "Lang.gf"];
Grammar -> Noun [style = "solid"];
Grammar -> Verb [style = "solid"];
Grammar -> Adjective [style = "solid"];
Grammar -> Adverb [style = "solid"];
Grammar -> Numeral [style = "solid"];
Grammar -> Sentence [style = "solid"];
Grammar -> Question [style = "solid"];
Grammar -> Relative [style = "solid"];
Grammar -> Conjunction [style = "solid"];
Grammar -> Phrase [style = "solid"];
Grammar -> Text [style = "solid"];
Grammar -> Idiom [style = "solid"];
Grammar -> Structural [style = "solid"];
Noun [style = "dashed", shape = "ellipse", URL = "Noun.gf"];
Noun -> Cat [style = "solid"];
Verb [style = "dashed", shape = "ellipse", URL = "Verb.gf"];
Verb -> Cat [style = "solid"];
Adjective [style = "dashed", shape = "ellipse", URL = "Adjective.gf"];
Adjective -> Cat [style = "solid"];
Adverb [style = "dashed", shape = "ellipse", URL = "Adverb.gf"];
Adverb -> Cat [style = "solid"];
Numeral [style = "dashed", shape = "ellipse", URL = "Numeral.gf"];
Numeral -> Cat [style = "solid"];
Sentence [style = "dashed", shape = "ellipse", URL = "Sentence.gf"];
Sentence -> Cat [style = "solid"];
Question [style = "dashed", shape = "ellipse", URL = "Question.gf"];
Question -> Cat [style = "solid"];
Relative [style = "dashed", shape = "ellipse", URL = "Relative.gf"];
Relative -> Cat [style = "solid"];
Conjunction [style = "dashed", shape = "ellipse", URL = "Conjunction.gf"];
Conjunction -> Cat [style = "solid"];
Phrase [style = "dashed", shape = "ellipse", URL = "Phrase.gf"];
Phrase -> Cat [style = "solid"];
Text [style = "dashed", shape = "ellipse", URL = "Phrase.gf"];
Text -> Cat [style = "solid"];
Idiom [style = "dashed", shape = "ellipse", URL = "Phrase.gf"];
Idiom -> Cat [style = "solid"];
Structural [style = "dashed", shape = "ellipse", URL = "Structural.gf"];
Structural -> Cat [style = "solid"];
#Lexicon [style = "dashed", shape = "ellipse", URL = "Lexicon.gf"];
#Lexicon -> Cat [style = "solid"];
Cat [style = "dashed", shape = "ellipse", URL = "Cat.gf"];
Cat -> Common [style = "solid"];
Common [style = "dashed", shape = "ellipse", URL = "Tense.gf"];
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -1,267 +0,0 @@
GF Resource Grammar Library v. 1.2
Author: Aarne Ranta <aarne (at) cs.chalmers.se>
Last update: %%date(%c)
% NOTE: this is a txt2tags file.
% Create an html file from this file using:
% txt2tags --toc -thtml index.txt
%!target:html
%!postproc(html): #BCEN <center>
%!postproc(html): #ECEN </center>
#BCEN
[10lang-large.png]
#ECEN
The GF Resource Grammar Library defines the basic grammar of
ten languages:
Danish, English, Finnish, French, German,
Italian, Norwegian, Russian, Spanish, Swedish.
Still incomplete implementations for Arabic and Catalan are also
included.
**New** in December 2007: Browsing the library by syntax editor
[directly on the web ../../../demos/resource-api/editor.html].
==Authors==
Inger Andersson and Therese Soderberg (Spanish morphology),
Nicolas Barth and Sylvain Pogodalla (French verb list),
Ali El Dada (Arabic modules),
Magda Gerritsen and Ulrich Real (Russian paradigms and lexicon),
Janna Khegai (Russian modules),
Bjorn Bringert (many Swadesh lexica),
Carlos Gonzalía (Spanish cardinals),
Harald Hammarström (German morphology),
Patrik Jansson (Swedish cardinals),
Andreas Priesnitz (German lexicon),
Aarne Ranta,
Jordi Saludes (Catalan modules),
Henning Thielemann (German lexicon).
We are grateful for contributions and
comments to several other people who have used this and
the previous versions of the resource library, including
Ludmilla Bogavac,
Ana Bove,
David Burke,
Lauri Carlson,
Gloria Casanellas,
Karin Cavallin,
Robin Cooper,
Hans-Joachim Daniels,
Elisabet Engdahl,
Markus Forsberg,
Kristofer Johannisson,
Anni Laine,
Hans Leiß,
Peter Ljunglöf,
Saara Myllyntausta,
Wanjiku Ng'ang'a,
Nadine Perera,
Jordi Saludes.
==License==
The GF Resource Grammar Library is open-source software licensed under
GNU Lesser General Public License (LGPL). See the file [LICENSE ../LICENSE] for more
details.
==Scope==
Coverage, for each language:
- complete morphology
- lexicon of the ca. 100 most important structural words
- test lexicon of ca. 300 content words (rough equivalents in each language)
- list of irregular verbs (separately for each language)
- representative fragment of syntax (cf. CLE (Core Language Engine))
- rather flat semantics (cf. Quasi-Logical Form of CLE)
Organization:
- top-level (API) modules
- Ground API + special-purpose APIs
- "school grammar" concepts rather than advanced linguistic theory
Presentation:
- tool ``gfdoc`` for generating HTML from grammars
- example collections
==Location==
Assuming you have installed the libraries, you will find the precompiled
``gfc`` and ``gfr`` files directly under ``$GF_LIB_PATH``, whose default
value is ``/usr/local/share/GF/``. The precompiled subdirectories are
```
alltenses
mathematical
multimodal
present
```
Do for instance
```
cd $GF_LIB_PATH
gf alltenses/langs.gfcm
> p -cat=S -lang=LangEng "this grammar is too big" | tb
```
For more details, see the [Synopsis synopsis.html].
==Compilation==
If you want to compile the library from scratch, use ``make`` in the root of
the source directory:
```
cd GF/lib/resource-1.0
make
```
The ``make`` procedure does not by default make Arabic and Catalan, but you
can uncomment the relevant lines in ``Makefile`` to compile them.
==Encoding==
Finnish, German, Romance, and Scandinavian languages are in isolatin-1.
Arabic and Russian are in UTF-8.
English is in pure ASCII.
The different encodings imply, unfortunately, that it is hard to get
a nice view of all languages simultaneously. The easiest way to achieve this is
to use ``gfeditor``, which automatically converts grammars to UTF-8.
==Using the resource as library==
This API is accessible by both ``present`` and ``alltenses``. The modules you most often need are
- ``Syntax``, the interface to syntactic structures
- ``Syntax``//L//, the implementations of ``Syntax`` for each language //L//
- ``Paradigms``//L//, the morphological paradigms for each language //L//
The [Synopsis synopsis.html] gives examples on the typical usage of these
modules.
==Using the resource as top level grammar==
The following modules can be used for parsing and linearization. They are accessible from both
``present`` and ``alltenses``.
- ``Lang``//L// for each language //L//, implementing a common abstract syntax ``Lang``
- ``Danish``, ``English``, etc, implementing ``Lang`` with language-specific extensions
In addition, there is in both ``present`` and ``alltenses`` the file
- ``langs.gfcm``, a package with precompiled ``Lang``//L// grammars
A way to test and view the resource grammar is to load ``langs.gfcm`` either into ``gfeditor``
or into the ``gf`` shell and perform actions such as syntax editing and treebank generation.
For instance, the command
```
> p -lang=LangEng -cat=S "this grammar is too big" | tb
```
creates a treebank entry with translations of this sentence.
For parsing, currently only English and the Scandinavian languages are within the limits ofr
reasonable resources. For other languages //L//, parsing with ``Lang``//L// will probably eat
up the computer resources before finishing the parser generation.
==Accessing the lower level ground API==
The ``Syntax`` API is implemented in terms a bunch of ``abstract`` modules, which
as of version 1.2 are mainly interesting for implementors of the resource.
See the [documentation for version 1.1 index-1.1.html] for more details.
==Known bugs and missing components==
Danish
- the lexicon and chosen inflections are only partially verified
English
Finnish
- wrong cases in some passive constructions
French
- multiple clitics (with V3) not always right
- third person pronominal questions with inverted word order
have wrong forms if "t" is required e.g.
(e.g. "comment fera-t-il" becomes "comment fera il")
German
Italian
- multiple clitics (with V3) not always right
Norwegian
- the lexicon and chosen inflections are only partially verified
Russian
- some functions missing
- some regular paradigms are missing
Spanish
- multiple clitics (with V3) not always right
- missing contractions with imperatives and clitics
Swedish
==More reading==
[Synopsis synopsis.html]. The concise guide to API v. 1.2.
[Grammars as Software Libraries gslt-sem-2006.html]. Slides
with background and motivation for the resource grammar library.
[GF Resource Grammar Library Version 1.0 clt2006.html]. Slides
giving an overview of the library and practical hints on its use.
[How to write resource grammars Resource-HOWTO.html]. Helps you
start if you want to add another language to the library.
[Parametrized modules for Romance languages http://www.cs.chalmers.se/~aarne/geocal2006.pdf].
Slides explaining some ideas in the implementation of
French, Italian, and Spanish.
[Grammar writing by examples http://www.cs.chalmers.se/~aarne/slides/webalt-2005.pdf].
Slides showing how linearization rules are written as strings parsable by the resource grammar.
[Multimodal Resource Grammars http://www.cs.chalmers.se/~aarne/slides/talk-edin2005.pdf].
Slides showing how to use the multimodal resource library. N.B. the library
examples are from ``multimodal/old``, which is a reduced-size API.
[GF Resource Grammar Library ../../../doc/resource.pdf] (pdf).
Printable user manual with API documentation, for version 1.0.

View File

@@ -1,581 +0,0 @@
The Official EU languages
The 20 official languages of the EU and their abbreviations are as follows:
Español ES Spanish
Dansk DA Danish
Deutsch DE German
Elinika EL Greek
English EN
Français FR French
Italiano IT Italian
Nederlands NL Dutch
Português PT Portuguese
Suomi FI Finnish
Svenska SV Swedish
?e?tina CS Czech
Eesti ET Estonian
Latviesu valoda LV Latvian
Lietuviu kalba LT Lithuanian
Magyar HU Hungarian
Malti MT Maltese
Polski PL Polish
Sloven?ina SK Slovak
Sloven??ina SL Slovene
http://europa.eu.int/comm/education/policies/lang/languages/index_en.html
-----
http://www.w3.org/WAI/ER/IG/ert/iso639.htm
ar arabic
no norwegian
ru russian
--
ISO 639: 3-letter codes
abk ab Abkhazian
ace Achinese
ach Acoli
ada Adangme
aar aa Afar
afh Afrihili
afr af Afrikaans
afa Afro-Asiatic (Other)
aka Akan
akk Akkadian
alb/sqi sq Albanian
ale Aleut
alg Algonquian languages
tut Altaic (Other)
amh am Amharic
apa Apache languages
ara ar Arabic
arc Aramaic
arp Arapaho
arn Araucanian
arw Arawak
arm/hye hy Armenian
art Artificial (Other)
asm as Assamese
ath Athapascan languages
map Austronesian (Other)
ava Avaric
ave Avestan
awa Awadhi
aym ay Aymara
aze az Azerbaijani
nah Aztec
ban Balinese
bat Baltic (Other)
bal Baluchi
bam Bambara
bai Bamileke languages
bad Banda
bnt Bantu (Other)
bas Basa
bak ba Bashkir
baq/eus eu Basque
bej Beja
bem Bemba
ben bn Bengali
ber Berber (Other)
bho Bhojpuri
bih bh Bihari
bik Bikol
bin Bini
bis bi Bislama
bra Braj
bre be Breton
bug Buginese
bul bg Bulgarian
bua Buriat
bur/mya my Burmese
bel be Byelorussian
cad Caddo
car Carib
cat ca Catalan
cau Caucasian (Other)
ceb Cebuano
cel Celtic (Other)
cai Central American Indian (Other)
chg Chagatai
cha Chamorro
che Chechen
chr Cherokee
chy Cheyenne
chb Chibcha
chi/zho zh Chinese
chn Chinook jargon
cho Choctaw
chu Church Slavic
chv Chuvash
cop Coptic
cor Cornish
cos co Corsican
cre Cree
mus Creek
crp Creoles and Pidgins (Other)
cpe Creoles and Pidgins, English-based (Other)
cpf Creoles and Pidgins, French-based (Other)
cpp Creoles and Pidgins, Portuguese-based (Other)
cus Cushitic (Other)
hr Croatian
ces/cze cs Czech
dak Dakota
dan da Danish
del Delaware
din Dinka
div Divehi
doi Dogri
dra Dravidian (Other)
dua Duala
dut/nla nl Dutch
dum Dutch, Middle (ca. 1050-1350)
dyu Dyula
dzo dz Dzongkha
efi Efik
egy Egyptian (Ancient)
eka Ekajuk
elx Elamite
eng en English
enm English, Middle (ca. 1100-1500)
ang English, Old (ca. 450-1100)
esk Eskimo (Other)
epo eo Esperanto
est et Estonian
ewe Ewe
ewo Ewondo
fan Fang
fat Fanti
fao fo Faroese
fij fj Fijian
fin fi Finnish
fiu Finno-Ugrian (Other)
fon Fon
fra/fre fr French
frm French, Middle (ca. 1400-1600)
fro French, Old (842- ca. 1400)
fry fy Frisian
ful Fulah
gaa Ga
gae/gdh Gaelic (Scots)
glg gl Gallegan
lug Ganda
gay Gayo
gez Geez
geo/kat ka Georgian
deu/ger de German
gmh German, Middle High (ca. 1050-1500)
goh German, Old High (ca. 750-1050)
gem Germanic (Other)
gil Gilbertese
gon Gondi
got Gothic
grb Grebo
grc Greek, Ancient (to 1453)
ell/gre el Greek, Modern (1453-)
kal kl Greenlandic
grn gn Guarani
guj gu Gujarati
hai Haida
hau ha Hausa
haw Hawaiian
heb he Hebrew
her Herero
hil Hiligaynon
him Himachali
hin hi Hindi
hmo Hiri Motu
hun hu Hungarian
hup Hupa
iba Iban
ice/isl is Icelandic
ibo Igbo
ijo Ijo
ilo Iloko
inc Indic (Other)
ine Indo-European (Other)
ind id Indonesian
ina ia Interlingua (International Auxiliary language Association)
ine - Interlingue
iku iu Inuktitut
ipk ik Inupiak
ira Iranian (Other)
gai/iri ga Irish
sga Irish, Old (to 900)
mga Irish, Middle (900 - 1200)
iro Iroquoian languages
ita it Italian
jpn ja Japanese
jav/jaw jv/jw Javanese
jrb Judeo-Arabic
jpr Judeo-Persian
kab Kabyle
kac Kachin
kam Kamba
kan kn Kannada
kau Kanuri
kaa Kara-Kalpak
kar Karen
kas ks Kashmiri
kaw Kawi
kaz kk Kazakh
kha Khasi
khm km Khmer
khi Khoisan (Other)
kho Khotanese
kik Kikuyu
kin rw Kinyarwanda
kir ky Kirghiz
kom Komi
kon Kongo
kok Konkani
kor ko Korean
kpe Kpelle
kro Kru
kua Kuanyama
kum Kumyk
kur ku Kurdish
kru Kurukh
kus Kusaie
kut Kutenai
lad Ladino
lah Lahnda
lam Lamba
oci oc Langue d'Oc (post 1500)
lao lo Lao
lat la Latin
lav lv Latvian
ltz Letzeburgesch
lez Lezghian
lin ln Lingala
lit lt Lithuanian
loz Lozi
lub Luba-Katanga
lui Luiseno
lun Lunda
luo Luo (Kenya and Tanzania)
mac/mak mk Macedonian
mad Madurese
mag Magahi
mai Maithili
mak Makasar
mlg mg Malagasy
may/msa ms Malay
mal Malayalam
mlt ml Maltese
man Mandingo
mni Manipuri
mno Manobo languages
max Manx
mao/mri mi Maori
mar mr Marathi
chm Mari
mah Marshall
mwr Marwari
mas Masai
myn Mayan languages
men Mende
mic Micmac
min Minangkabau
mis Miscellaneous (Other)
moh Mohawk
mol mo Moldavian
mkh Mon-Kmer (Other)
lol Mongo
mon mn Mongolian
mos Mossi
mul Multiple languages
mun Munda languages
nau na Nauru
nav Navajo
nde Ndebele, North
nbl Ndebele, South
ndo Ndongo
nep ne Nepali
new Newari
nic Niger-Kordofanian (Other)
ssa Nilo-Saharan (Other)
niu Niuean
non Norse, Old
nai North American Indian (Other)
nor no Norwegian
nno Norwegian (Nynorsk)
nub Nubian languages
nym Nyamwezi
nya Nyanja
nyn Nyankole
nyo Nyoro
nzi Nzima
oji Ojibwa
ori or Oriya
orm om Oromo
osa Osage
oss Ossetic
oto Otomian languages
pal Pahlavi
pau Palauan
pli Pali
pam Pampanga
pag Pangasinan
pan pa Panjabi
pap Papiamento
paa Papuan-Australian (Other)
fas/per fa Persian
peo Persian, Old (ca 600 - 400 B.C.)
phn Phoenician
pol pl Polish
pon Ponape
por pt Portuguese
pra Prakrit languages
pro Provencal, Old (to 1500)
pus ps Pushto
que qu Quechua
roh rm Rhaeto-Romance
raj Rajasthani
rar Rarotongan
roa Romance (Other)
ron/rum ro Romanian
rom Romany
run rn Rundi
rus ru Russian
sal Salishan languages
sam Samaritan Aramaic
smi Sami languages
smo sm Samoan
sad Sandawe
sag sg Sango
san sa Sanskrit
srd Sardinian
sco Scots
sel Selkup
sem Semitic (Other)
sr Serbian
scr sh Serbo-Croatian
srr Serer
shn Shan
sna sn Shona
sid Sidamo
bla Siksika
snd sd Sindhi
sin si Singhalese
sit - Sino-Tibetan (Other)
sio Siouan languages
sla Slavic (Other)
ssw ss Siswant
slk/slo sk Slovak
slv sl Slovenian
sog Sogdian
som so Somali
son Songhai
wen Sorbian languages
nso Sotho, Northern
sot st Sotho, Southern
sai South American Indian (Other)
esl/spa es Spanish
suk Sukuma
sux Sumerian
sun su Sudanese
sus Susu
swa sw Swahili
ssw Swazi
sve/swe sv Swedish
syr Syriac
tgl tl Tagalog
tah Tahitian
tgk tg Tajik
tmh Tamashek
tam ta Tamil
tat tt Tatar
tel te Telugu
ter Tereno
tha th Thai
bod/tib bo Tibetan
tig Tigre
tir ti Tigrinya
tem Timne
tiv Tivi
tli Tlingit
tog to Tonga (Nyasa)
ton Tonga (Tonga Islands)
tru Truk
tsi Tsimshian
tso ts Tsonga
tsn tn Tswana
tum Tumbuka
tur tr Turkish
ota Turkish, Ottoman (1500 - 1928)
tuk tk Turkmen
tyv Tuvinian
twi tw Twi
uga Ugaritic
uig ug Uighur
ukr uk Ukrainian
umb Umbundu
und Undetermined
urd ur Urdu
uzb uz Uzbek
vai Vai
ven Venda
vie vi Vietnamese
vol vo Volapük
vot Votic
wak Wakashan languages
wal Walamo
war Waray
was Washo
cym/wel cy Welsh
wol wo Wolof
xho xh Xhosa
sah Yakut
yao Yao
yap Yap
yid yi Yiddish
yor yo Yoruba
zap Zapotec
zen Zenaga
zha za Zhuang
zul zu Zulu
zun Zuni
ISO 639: 2-letter codes
AA "Afar"
AB "Abkhazian"
AF "Afrikaans"
AM "Amharic"
AR "Arabic"
AS "Assamese"
AY "Aymara"
AZ "Azerbaijani"
BA "Bashkir"
BE "Byelorussian"
BG "Bulgarian"
BH "Bihari"
BI "Bislama"
BN "Bengali" "Bangla"
BO "Tibetan"
BR "Breton"
CA "Catalan"
CO "Corsican"
CS "Czech"
CY "Welsh"
DA "Danish"
DE "German"
DZ "Bhutani"
EL "Greek"
EN "English" "American"
EO "Esperanto"
ES "Spanish"
ET "Estonian"
EU "Basque"
FA "Persian"
FI "Finnish"
FJ "Fiji"
FO "Faeroese"
FR "French"
FY "Frisian"
GA "Irish"
GD "Gaelic" "Scots Gaelic"
GL "Galician"
GN "Guarani"
GU "Gujarati"
HA "Hausa"
HI "Hindi"
HR "Croatian"
HU "Hungarian"
HY "Armenian"
IA "Interlingua"
IE "Interlingue"
IK "Inupiak"
IN "Indonesian"
IS "Icelandic"
IT "Italian"
IW "Hebrew"
JA "Japanese"
JI "Yiddish"
JW "Javanese"
KA "Georgian"
KK "Kazakh"
KL "Greenlandic"
KM "Cambodian"
KN "Kannada"
KO "Korean"
KS "Kashmiri"
KU "Kurdish"
KY "Kirghiz"
LA "Latin"
LN "Lingala"
LO "Laothian"
LT "Lithuanian"
LV "Latvian" "Lettish"
MG "Malagasy"
MI "Maori"
MK "Macedonian"
ML "Malayalam"
MN "Mongolian"
MO "Moldavian"
MR "Marathi"
MS "Malay"
MT "Maltese"
MY "Burmese"
NA "Nauru"
NE "Nepali"
NL "Dutch"
NO "Norwegian"
OC "Occitan"
OM "Oromo" "Afan"
OR "Oriya"
PA "Punjabi"
PL "Polish"
PS "Pashto" "Pushto"
PT "Portuguese"
QU "Quechua"
RM "Rhaeto-Romance"
RN "Kirundi"
RO "Romanian"
RU "Russian"
RW "Kinyarwanda"
SA "Sanskrit"
SD "Sindhi"
SG "Sangro"
SH "Serbo-Croatian"
SI "Singhalese"
SK "Slovak"
SL "Slovenian"
SM "Samoan"
SN "Shona"
SO "Somali"
SQ "Albanian"
SR "Serbian"
SS "Siswati"
ST "Sesotho"
SU "Sudanese"
SV "Swedish"
SW "Swahili"
TA "Tamil"
TE "Tegulu"
TG "Tajik"
TH "Thai"
TI "Tigrinya"
TK "Turkmen"
TL "Tagalog"
TN "Setswana"
TO "Tonga"
TR "Turkish"
TS "Tsonga"
TT "Tatar"
TW "Twi"
UK "Ukrainian"
UR "Urdu"
UZ "Uzbek"
VI "Vietnamese"
VO "Volapuk"
WO "Wolof"
XH "Xhosa"
YO "Yoruba"
ZH "Chinese"
ZU "Zulu"

View File

@@ -1,48 +0,0 @@
Morphological Paradigms in the GF Resource Grammar Library
Aarne Ranta
This is a synopsis of the main morphological paradigms for
nouns (``N``), adjectives (``A``), and verbs (``V``).
=English=
```
mkN : (flash : Str) -> N ; -- car, bus, ax, hero, fly, boy
mkN : (man,men : Str) -> N ; -- index, indices
mkN : (man,men,man's,men's : Str) -> N ;
mkN : Str -> N -> N ; -- baby boom
mkA : (happy : Str) -> A ; -- small, happy, free
mkA : (fat,fatter : Str) -> A ;
mkA : (good,better,best,well : Str) -> A
compoundA : A -> A ; -- -/more/most ridiculous
mkV : (cry : Str) -> V ; -- call, kiss, echo, cry, pray
mkV : (stop,stopped : Str) -> V ;
mkV : (drink,drank,drunk : Str) -> V ;
mkV : (run,ran,run,running : Str) -> V ;
mkV : (go,goes,went,gone,going : Str) -> V
```
=French=
```
mkN : (cheval : Str) -> N ; -- pas, prix, nez, bijou, cheval
mkN : (foie : Str) -> Gender -> N ;
mkN : (oeil,yeux : Str) -> Gender -> N ;
mkN : N -> Str -> N
mkA : (cher : Str) -> A ; -- banal, heureux, italien, jeune, amer, carré, joli
mkA : (sec,seche : Str) -> A ;
mkA : (banal,banale,banaux,banalement : Str) -> A ;
mkA : (bon : A) -> (meilleur : A) -> A
prefixA : A -> A ;
mkV : (finir : Str) -> V ; -- aimer, céder, placer, manger, payer, finir
mkV : (jeter,jette,jettera : Str) -> V ;
mkV : V2 -> V
etreV : V -> V ;
reflV : V -> V ;
```

View File

@@ -1,60 +0,0 @@
RUNGHC=runghc
RUNMAKE=$(RUNGHC) Make.hs
GF_LIB_PATH=..
.PHONY: all present alltenses lang api math prelude test demo parse synopsis link compiled constructX clean
all: link prelude constructX present alltenses compat
present:
$(RUNMAKE) present lang
$(RUNMAKE) present api
alltenses:
$(RUNMAKE) lang
$(RUNMAKE) api
lang:
$(RUNMAKE) lang
api:
$(RUNMAKE) api
compat:
$(RUNMAKE) present compat
prelude:
gf -batch prelude/*.gf
cp -p prelude/*.gfo ../prelude
constructX:
gf -batch common/ConstructX.gf
cp -p common/ConstructX.gfo ../prelude
MakeStructural:
gf -batch */MakeStructural*.gf
cp -p */MakeStructural*.gfo ../present
cp -p */MakeStructural*.gfo ../alltenses
test:
$(RUNMAKE) test
demo:
$(RUNMAKE) demo
parse:
$(RUNMAKE) parse
synopsis:
cd doc ; $(RUNGHC) MkSynopsis ; cd ..
link:
chmod a+x mkPresent mkMinimal
compiled:
(cd .. && tar -zcf resource-compiled.tar.gz prelude alltenses present)
clean:
$(RUNMAKE) clean

View File

@@ -1,187 +0,0 @@
--1 Combinators: a High-Level Syntax API
-- This module defines some "grammatical functions" that give shortcuts to
-- typical constructions. [``Constructors`` Constructors.html] and the
-- language-specific ``Paradigms`` modules are usually needed
-- to construct arguments of these functions.
incomplete resource Combinators = open Cat, Structural, Constructors in {
oper
--2 Predication
pred : overload {
pred : V -> NP -> Cl ; -- x converges
pred : V2 -> NP -> NP -> Cl ; -- x intersects y
pred : V3 -> NP -> NP -> NP -> Cl ; -- x intersects y at z
pred : V -> NP -> NP -> Cl ; -- x and y intersect
pred : A -> NP -> Cl ; -- x is even
pred : A2 -> NP -> NP -> Cl ; -- x is divisible by y
pred : A -> NP -> NP -> Cl ; -- x and y are equal
pred : N -> NP -> Cl ; -- x is a maximum
pred : CN -> NP -> Cl ; -- x is a local maximum
pred : NP -> NP -> Cl ; -- x is the neutral element
pred : N -> NP -> NP -> Cl ; -- x and y are inverses
pred : Adv -> NP -> Cl ; -- x is in scope
pred : Prep -> NP -> NP -> Cl -- x is outside y
} ;
--2 Function application
app : overload {
app : N -> NP ;
app : N2 -> NP -> NP ;
app : N3 -> NP -> NP -> NP ;
app : N2 -> NP -> NP -> NP ;
app : N2 -> N -> CN ;
app : N2 -> NP -> CN ; -- divisor of x
app : N3 -> NP -> NP -> CN ; -- path from x to y
app : N2 -> NP -> NP -> CN ; -- path between x and y
} ;
--2 Coordination
coord : overload {
coord : Conj -> Adv -> Adv -> Adv ;
coord : Conj -> AP -> AP -> AP ;
coord : Conj -> NP -> NP -> NP ;
coord : Conj -> S -> S -> S ;
coord : Conj -> ListAdv -> Adv ;
coord : Conj -> ListAP -> AP ;
coord : Conj -> ListNP -> NP ;
coord : Conj -> ListS -> S ;
} ;
--2 Modification
mod : overload {
mod : A -> N -> CN ;
mod : AP -> CN -> CN ;
mod : AdA -> A -> AP ;
mod : Det -> N -> NP ;
mod : Det -> CN -> NP ;
mod : Quant -> N -> NP ;
mod : Quant -> CN -> NP ;
mod : Predet -> N -> NP ;
mod : Numeral -> N -> NP
} ;
--2 Negation
neg : overload {
neg : Imp -> Utt ;
neg : Cl -> S ;
neg : QCl -> QS ;
neg : RCl -> RS
};
--.
pred = overload {
pred : V -> NP -> Cl
= \v,np -> mkCl np v ;
pred : V2 -> NP -> NP -> Cl
= \v,np,ob -> mkCl np v ob ;
pred : V3 -> NP -> NP -> NP -> Cl
= \v,np,ob,ob2 -> mkCl np v ob ob2 ;
pred : V -> NP -> NP -> Cl --# notminimal
= \v,x,y -> mkCl (mkNP and_Conj x y) v ; --# notminimal
pred : A -> NP -> Cl
= \a,np -> mkCl np a ;
pred : A2 -> NP -> NP -> Cl --# notminimal
= \a,x,y -> mkCl x a y ; --# notminimal
pred : A -> NP -> NP -> Cl --# notminimal
= \a,x,y -> mkCl (mkNP and_Conj x y) a ; --# notminimal
pred : N -> NP -> Cl
= \n,x -> mkCl x (mkNP a_Art n) ;
pred : CN -> NP -> Cl
= \n,x -> mkCl x (mkNP a_Art n) ;
pred : NP -> NP -> Cl
= \n,x -> mkCl x n ;
pred : N2 -> NP -> NP -> Cl --# notminimal
= \n,x,y -> mkCl x (mkNP a_Art (mkCN n y)) ; --# notminimal
pred : N -> NP -> NP -> Cl --# notminimal
= \n,x,y -> mkCl (mkNP and_Conj x y) (mkNP a_Art plNum n) ; --# notminimal
pred : Adv -> NP -> Cl
= \a,x -> mkCl x a ;
pred : Prep -> NP -> NP -> Cl
= \p,x,y -> mkCl x (mkAdv p y) ;
} ;
app = overload {
app : N -> NP
= \n -> mkNP the_Art n ;
app : N2 -> NP -> NP --# notminimal
= \n,x -> mkNP the_Art (mkCN n x) ; --# notminimal
app : N3 -> NP -> NP -> NP --# notminimal
= \n,x,y -> mkNP the_Art (mkCN n x y) ; --# notminimal
app : N2 -> NP -> NP -> NP --# notminimal
= \n,x,y -> mkNP the_Art (mkCN n (mkNP and_Conj x y)) ; --# notminimal
app : N2 -> N -> CN --# notminimal
= \f,n -> mkCN f (mkNP a_Art plNum n) ; --# notminimal
app : N2 -> NP -> CN --# notminimal
= mkCN ; --# notminimal
app : N3 -> NP -> NP -> CN --# notminimal
= mkCN ; --# notminimal
app : N2 -> NP -> NP -> CN --# notminimal
= \n,x,y -> mkCN n (mkNP and_Conj x y) ; --# notminimal
} ;
coord = overload { --# notminimal
coord : Conj -> Adv -> Adv -> Adv --# notminimal
= mkAdv ; --# notminimal
coord : Conj -> AP -> AP -> AP --# notminimal
= mkAP ; --# notminimal
coord : Conj -> NP -> NP -> NP --# notminimal
= mkNP ; --# notminimal
coord : Conj -> S -> S -> S --# notminimal
= mkS ; --# notminimal
coord : Conj -> ListAdv -> Adv --# notminimal
= mkAdv ; --# notminimal
coord : Conj -> ListAP -> AP --# notminimal
= mkAP ; --# notminimal
coord : Conj -> ListNP -> NP --# notminimal
= mkNP ; --# notminimal
coord : Conj -> ListS -> S --# notminimal
= mkS ; --# notminimal
} ; --# notminimal
mod = overload {
mod : A -> N -> CN
= mkCN ;
mod : AP -> CN -> CN
= mkCN ;
mod : AdA -> A -> AP
= mkAP ;
mod : Det -> N -> NP
= mkNP ;
mod : Det -> CN -> NP
= mkNP ;
mod : Quant -> N -> NP
= mkNP ;
mod : Quant -> CN -> NP
= mkNP ;
mod : Predet -> N -> NP
= \p,n -> mkNP p (mkNP a_Art n) ;
mod : Numeral -> N -> NP
= mkNP ;
} ;
neg = overload {
neg : Imp -> Utt
= mkUtt negativePol ;
neg : Cl -> S
= mkS negativePol ;
neg : QCl -> QS
= mkQS negativePol ;
neg : RCl -> RS --# notminimal
= mkRS negativePol ; --# notminimal
};
}

View File

@@ -1,6 +0,0 @@
--# -path=.:alltenses:prelude
resource CombinatorsAra = Combinators with
(Cat = CatAra),
(Structural = StructuralAra),
(Constructors = ConstructorsAra) ;

View File

@@ -1,6 +0,0 @@
--# -path=.:alltenses:prelude
resource CombinatorsBul = Combinators with
(Cat = CatBul),
(Structural = StructuralBul),
(Constructors = ConstructorsBul) ;

View File

@@ -1,6 +0,0 @@
--# -path=.:alltenses
resource CombinatorsCat = Combinators with
(Cat = CatCat),
(Structural = StructuralCat),
(Constructors = ConstructorsCat) ;

View File

@@ -1,6 +0,0 @@
--# -path=.:alltenses:prelude
resource CombinatorsDan = Combinators with
(Cat = CatDan),
(Structural = StructuralDan),
(Constructors = ConstructorsDan) ;

View File

@@ -1,6 +0,0 @@
--# -path=.:alltenses:prelude
resource CombinatorsEng = Combinators with
(Cat = CatEng),
(Structural = StructuralEng),
(Constructors = ConstructorsEng) ;

View File

@@ -1,6 +0,0 @@
--# -path=.:alltenses:prelude
resource CombinatorsFin = Combinators with
(Cat = CatFin),
(Structural = StructuralFin),
(Constructors = ConstructorsFin) ;

View File

@@ -1,6 +0,0 @@
--# -path=.:alltenses:prelude
resource CombinatorsFre = Combinators with
(Cat = CatFre),
(Structural = StructuralFre),
(Constructors = ConstructorsFre) ;

View File

@@ -1,6 +0,0 @@
--# -path=.:alltenses:prelude
resource CombinatorsGer = Combinators with
(Cat = CatGer),
(Structural = StructuralGer),
(Constructors = ConstructorsGer) ;

View File

@@ -1,6 +0,0 @@
--# -path=.:alltenses:prelude
resource CombinatorsHin = Combinators with
(Cat = CatHin),
(Structural = StructuralHin),
(Constructors = ConstructorsHin) ;

View File

@@ -1,6 +0,0 @@
--# -path=.:alltenses:prelude
resource CombinatorsIna = Combinators with
(Cat = CatIna),
(Structural = StructuralIna),
(Constructors = ConstructorsIna) ;

View File

@@ -1,6 +0,0 @@
--# -path=.:alltenses:prelude
resource CombinatorsIta = Combinators with
(Cat = CatIta),
(Structural = StructuralIta),
(Constructors = ConstructorsIta) ;

View File

@@ -1,6 +0,0 @@
--# -path=.:alltenses:prelude
resource CombinatorsNor = Combinators with
(Cat = CatNor),
(Structural = StructuralNor),
(Constructors = ConstructorsNor) ;

View File

@@ -1,6 +0,0 @@
--# -path=.:alltenses:prelude
resource CombinatorsRus = Combinators with
(Cat = CatRus),
(Structural = StructuralRus),
(Constructors = ConstructorsRus) ;

View File

@@ -1,6 +0,0 @@
--# -path=.:alltenses
resource CombinatorsSpa = Combinators with
(Cat = CatSpa),
(Structural = StructuralSpa),
(Constructors = ConstructorsSpa) ;

View File

@@ -1,6 +0,0 @@
--# -path=.:alltenses:prelude
resource CombinatorsSwe = Combinators with
(Cat = CatSwe),
(Structural = StructuralSwe),
(Constructors = ConstructorsSwe) ;

View File

@@ -1,6 +0,0 @@
--# -path=.:alltenses:prelude
resource CombinatorsTha = Combinators with
(Cat = CatTha),
(Structural = StructuralTha),
(Constructors = ConstructorsTha) ;

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +0,0 @@
--# -path=.:alltenses:prelude
resource ConstructorsAra = Constructors with (Grammar = GrammarAra) ;

View File

@@ -1,86 +0,0 @@
--1 Symbolic: Noun Phrases with mathematical symbols
incomplete resource Symbolic = open Symbol, Grammar, PredefCnc in {
oper
symb : overload {
symb : Str -> NP ; -- x
symb : Int -> NP ; -- 23
symb : Float -> NP ; -- 0.99
symb : N -> Digits -> NP ; -- level 4
symb : N -> Card -> NP ; -- level at least four
symb : CN -> Card -> NP ; -- advanced level at least four
symb : Det -> N -> Card -> NP ; -- the number at least four
symb : Det -> CN -> Card -> NP ; -- the even number at least four
symb : N -> Numeral -> NP ; -- level four
symb : CN -> Numeral -> NP ; -- advanced level four
symb : Det -> N -> Numeral -> NP ; -- the largest number four
symb : Det -> CN -> Numeral -> NP ; -- the largest even number four
symb : Det -> N -> Str -> Str -> NP ; -- the largest levels i and j
symb : Det -> CN -> [Symb] -> NP ; -- the largest basic levels i, j, and k
symb : Quant -> N -> Numeral -> NP ; -- the number four
symb : Quant -> CN -> Numeral -> NP ; -- the even number four
symb : Quant -> N -> Str -> Str -> NP ; -- the levels i and j
symb : Quant -> CN -> [Symb] -> NP ; -- the basic levels i, j, and k
symb : Symb -> S ; -- A
symb : Symb -> Card ; -- n
symb : Symb -> Ord -- n'th
} ;
mkSymb : Str -> Symb ;
mkInteger : Predef.Int -> Integer ;
mkFloating : Predef.Float -> Floating ;
--.
symb = overload {
symb : Str -> NP
= \s -> UsePN (SymbPN (mkSymb s)) ;
symb : Int -> NP
= \i -> UsePN (IntPN i) ;
symb : Float -> NP
= \i -> UsePN (FloatPN i) ;
symb : N -> Digits -> NP
= \c,i -> CNNumNP (UseN c) (NumDigits i) ;
symb : N -> Card -> NP
= \c,n -> CNNumNP (UseN c) n ;
symb : CN -> Card -> NP
= \c,n -> CNNumNP c n ;
symb : Det -> N -> Card -> NP
= \d,n,x -> DetCN d (ApposCN (UseN n) (UsePN (NumPN x))) ;
symb : Det -> CN -> Card -> NP
= \d,n,x -> DetCN d (ApposCN n (UsePN (NumPN x))) ;
symb : N -> Numeral -> NP
= \c,n -> CNNumNP (UseN c) (NumNumeral n) ;
symb : CN -> Numeral -> NP
= \c,n -> CNNumNP c (NumNumeral n) ;
symb : Det -> N -> Numeral -> NP
= \d,n,x -> DetCN d (ApposCN (UseN n) (UsePN (NumPN (NumNumeral x)))) ;
symb : Det -> CN -> Numeral -> NP
= \d,n,x -> DetCN d (ApposCN n (UsePN (NumPN (NumNumeral x)))) ;
symb : Det -> N -> Str -> Str -> NP
= \c,n,x,y -> CNSymbNP c (UseN n) (BaseSymb (mkSymb x) (mkSymb y)) ;
symb : Det -> CN -> [Symb] -> NP
= CNSymbNP ;
symb : Quant -> N -> Numeral -> NP
= \d,n,x -> DetCN (DetQuant d NumSg) (ApposCN (UseN n) (UsePN (NumPN (NumNumeral x)))) ;
symb : Quant -> CN -> Numeral -> NP
= \d,n,x -> DetCN (DetQuant d NumSg) (ApposCN n (UsePN (NumPN (NumNumeral x)))) ;
symb : Quant -> N -> Str -> Str -> NP
= \d,n,x,y -> CNSymbNP (DetQuant d NumSg) (UseN n) (BaseSymb (mkSymb x) (mkSymb y)) ;
symb : Quant -> CN -> [Symb] -> NP
= \d -> CNSymbNP (DetQuant d NumSg);
symb : Symb -> S = SymbS ;
symb : Symb -> Card = SymbNum ;
symb : Symb -> Ord = SymbOrd
} ;
mkSymb : Str -> Symb = \s -> {s = s ; lock_Symb = <>} ;
mkInteger i = {s = Predef.show Predef.Int i ; lock_Int = <>} ;
mkFloating f = {s = Predef.show Predef.Float f ; lock_Float = <>} ;
Integer : Type = {s : Str ; lock_Int : {}} ;
Floating : Type = {s : Str ; lock_Float : {}} ;
}

View File

@@ -1,5 +0,0 @@
--# -path=.:present:mathematical:prelude
resource SymbolicBul = Symbolic with
(Symbol = SymbolBul),
(Grammar = GrammarBul) ;

View File

@@ -1,4 +0,0 @@
--# -path=.:alltenses:prelude
instance SyntaxAra of Syntax = ConstructorsAra, CatAra, StructuralAra, CombinatorsAra ;

View File

@@ -1,5 +0,0 @@
--# -path=.:alltenses
instance SyntaxCat of Syntax =
ConstructorsCat, CatCat, StructuralCat, CombinatorsCat ;

View File

@@ -1,22 +0,0 @@
--# -path=.:alltenses:prelude
resource TryEng = SyntaxEng-[mkAdN], LexiconEng, ParadigmsEng - [mkAdv,mkAdN,mkOrd] **
open (P = ParadigmsEng) in {
oper
mkAdv = overload SyntaxEng {
mkAdv : Str -> Adv = P.mkAdv ;
} ;
mkAdN = overload {
mkAdN : CAdv -> AdN = SyntaxEng.mkAdN ;
mkAdN : Str -> AdN = P.mkAdN ;
} ;
mkOrd = overload SyntaxEng {
mkOrd : Str -> Ord = P.mkOrd ;
} ;
}

View File

@@ -1,76 +0,0 @@
ASimul
AdAP
AdjCN
AdvVP
CompAP
CompAdv
CompNP
ComparA
ComplSlash
DefArt
DetCN
DetQuant
Grammar
IdetCN
IdetQuant
ImpVP
IndefArt
MassNP
NoPConj
NoVoc
NumCard
NumNumeral
NumPl
NumSg
PNeg
PPos
PhrUtt
PositA
PositAdvAdj
PredVP
PredetNP
PrepNP
QuestCl
QuestIAdv
QuestVP
Slash3V3
SlashV2A
SlashV2a
TEmpty
TExclMark
TFullStop
TPres
TQuestMark
TTAnt
UseCl
UseComp
UseN
UsePN
UsePron
UseQCl
UseV
UttAdv
UttIAdv
UttIP
UttImpSg
UttNP
UttQS
UttS
n2
n3
n4
n5
n6
n7
n8
n9
plNum
pot0
pot01
pot0as1
pot1
pot110
pot1as2
pot2
pot2as3
pot3

View File

@@ -1,106 +0,0 @@
concrete QuestionAra of Question = CatAra ** open ResAra, ParamX, Prelude in {
flags optimize=all_subs ;
lin
QuestCl cl = {
s = \\t,p =>
table {
QIndir => "إِذا" ++ cl.s ! t ! p ! Verbal ;
QDir => cl.s ! t ! p ! Verbal
}
};
-- AR copied from PredVP
QuestVP qp vp =
{ s =\\t,p,_ =>
let {
---- o = Verbal ; ---- AR
np = {s = table Case {_ => qp.s} ; a ={pgn = Per3 Masc qp.n ; isPron = False}} ;
pgn = np.a.pgn ;
gn = pgn2gn pgn;
kataba = vp.s ! pgn ! VPPerf ;
yaktubu = vp.s ! pgn ! VPImpf Ind ;
yaktuba = vp.s ! pgn ! VPImpf Cnj ;
yaktub = vp.s ! pgn ! VPImpf Jus ;
vStr : ResAra.Tense -> Polarity -> Str =
\tn,pl -> case<vp.isPred,tn,pl> of {
<False, ResAra.Pres, Pos> => yaktubu ;
<False, ResAra.Pres, Neg> => "لَا" ++ yaktubu ;
<True, ResAra.Pres, Pos> => "" ; --no verb "to be" in present
<True, ResAra.Pres, Neg> => "لَيسَ" ;--same here, just add negation particle
<_, ResAra.Past, Pos> => kataba ;
<_, ResAra.Past, Neg> => "لَمْ" ++ yaktub ;
<_, ResAra.Fut, Pos> => "سَ" ++ yaktubu ;
<_, ResAra.Fut, Neg> => "لَنْ" ++ yaktuba
};
pred : ResAra.Tense -> Polarity -> Str =
\tn,pl -> case <vp.isPred,tn,pl> of {
<True, ResAra.Pres, Pos> => vp.pred.s ! gn ! Nom; --xabar marfooc
_ => vp.pred.s ! gn ! Acc --xabar kaana wa laysa manSoob
} ;
} in
--- case o of {
---- _ =>
case <False, np.a.isPron> of {
---- AR workaround 18/12/2008 case <vp.obj.a.isPron, np.a.isPron> of {
-- ya2kuluhu
<False,True> => (vStr t p) ++ vp.obj.s ++ vp.s2 ++ (pred t p);
-- ya2kuluhu al-waladu, yakuluhu al-2awlaadu
<False,False> => (vStr t p) ++ np.s ! Nom ++ vp.obj.s ++ vp.s2 ++ (pred t p);
<True,False> => (vStr t p) ++ vp.obj.s ++ np.s ! Nom ++ vp.s2 ++ (pred t p);
<True,True> => (vStr t p) ++ vp.obj.s ++ vp.s2 ++ (pred t p)
};
---- Nominal =>
---- np.s ! Nom ++ (vStr t p) ++ vp.obj.s ++ vp.s2 ++ (pred t p)
}
; ---- };
-- QuestSlash ip slash = {
-- s = \\t,a,p =>
-- let
-- cls = slash.s ! t ! a ! p ;
-- who = slash.c2 ++ ip.s ! Acc --- stranding in ExtAra
-- in table {
-- QDir => who ++ cls ! OQuest ;
-- QIndir => who ++ cls ! ODir
-- }
-- } ;
--
---- AR guessed
QuestIAdv iadv cl = {s = \\t,p,_ => iadv.s ++ cl.s ! t ! p ! Verbal} ;
-- s = \\t,a,p =>
-- let
-- cls = cl.s ! t ! a ! p ;
-- why = iadv.s
-- in table {
-- QDir => why ++ cls ! OQuest ;
-- QIndir => why ++ cls ! ODir
-- }
-- } ;
--
-- PrepIP p ip = {s = p.s ++ ip.s ! Nom} ;
--
-- AdvIP ip adv = {
-- s = \\c => ip.s ! c ++ adv.s ;
-- n = ip.n
-- } ;
--
---- AR guesses
IdetCN idet cn = {
s = idet.s ! Nom ++ cn.s ! idet.n ! Indef ! Nom ;
n = idet.n
} ;
IdetQuant idet num = {
s = \\c => idet.s ++ num.s ! Masc ! Indef ! c;
n = ResAra.Sg ---- size of Num
} ;
--
}

View File

@@ -1,47 +0,0 @@
--# -path=.:abstract:common
concrete SymbolAra of Symbol = CatAra ** open Prelude, ResAra in {
{-
lin
SymbPN i = {s = \\c => i.s ; g = Neutr} ; --- c
IntPN i = {s = \\c => i.s ; g = Neutr} ; --- c
FloatPN i = {s = \\c => i.s ; g = Neutr} ; --- c
NumPN i = {s = i.s ! Neutr ; g = Neutr} ; --- c
CNIntNP cn i = {
s = \\c => cn.s ! Weak ! Sg ! Nom ++ i.s ;
a = agrP3 Sg ;
isPron = False
} ;
CNSymbNP det cn xs = let g = cn.g in {
s = \\c => det.s ! g ! c ++ cn.s ! adjfCase det.a c ! det.n ! c ++ xs.s ;
a = agrP3 det.n ;
isPron = False
} ;
CNNumNP cn i = {
s = \\c => artDef ! (GSg cn.g) ! c ++ cn.s ! Weak ! Sg ! Nom ++ i.s ! Neutr ! c ;
a = agrP3 Sg ;
isPron = False
} ;
SymbS sy = {s = \\_ => sy.s} ;
SymbNum n = {s = \\_,_ => n.s ; n = Pl ; isNum = True} ;
SymbOrd n = {s = \\_ => n.s ++ "."} ;
lincat
Symb, [Symb] = SS ;
lin
MkSymb s = s ;
BaseSymb = infixSS "und" ;
ConsSymb = infixSS "," ;
-}
}

View File

@@ -1,25 +0,0 @@
--# -path=.:../abstract:../common
concrete CompatibilityBul of Compatibility = CatBul ** open Prelude, ResBul in {
-- from Noun 19/4/2008
flags
coding = cp1251 ;
lin
NumInt n = {s = \\_ => n.s; n = Pl; nonEmpty = True} ;
OrdInt n = {s = \\aform => n.s ++ "-" ++
case aform of {
ASg Masc Indef => "òè" ;
ASg Fem Indef => "òà" ;
ASg Neut Indef => "òî" ;
ASg Masc Def => "òèÿ" ;
ASg Fem Def => "òàòà" ;
ASg Neut Def => "òîòî" ;
ASgMascDefNom => "òèÿò" ;
APl Indef => "òè" ;
APl Def => "òèòå"
}
} ;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,21 +0,0 @@
instance DiffBul of DiffSlavic = open CommonSlavic, Prelude in {
param
Case = Acc | Dat ;
Species = Indef | Def ;
NForm =
NF Number Species
| NFSgDefNom
| NFPlCount
| NFVocative
;
oper
Agr = {gn : GenNum ; p : Person} ;
agrP3 : GenNum -> Agr = \gn ->
{gn = gn; p = P3} ;
}

View File

@@ -1,54 +0,0 @@
--# -path=.:abstract:common
concrete SymbolBul of Symbol = CatBul ** open Prelude, ResBul in {
flags
coding = cp1251 ;
lin
SymbPN i = {s = i.s ; g = Neut} ;
IntPN i = {s = i.s ; g = Neut} ;
FloatPN i = {s = i.s ; g = Neut} ;
NumPN i = {s = i.s ! DNeutIndef ; g = Neut} ;
CNIntNP cn i = {
s = \\c => cn.s ! NF Sg Indef ++ i.s ;
a = agrP3 (gennum cn.g Sg)
} ;
CNSymbNP det cn xs = {
s = \\c => det.s ! False ! cn.g ! RSubj ++ cn.s ! NF det.n Indef ++ xs.s ;
a = agrP3 (gennum cn.g det.n)
} ;
CNNumNP cn i = {
s = \\c => (cn.s ! NF Sg Indef ++ i.s ! DNeutIndef) ;
a = agrP3 (gennum cn.g Sg)
} ;
SymbS sy = sy ;
SymbNum sy = {s = \\_ => sy.s; n = Pl; nonEmpty = True} ;
SymbOrd sy = {s = \\aform => sy.s ++ "-" ++
case aform of {
ASg Masc Indef => "òè" ;
ASg Fem Indef => "òà" ;
ASg Neut Indef => "òî" ;
ASg Masc Def => "òèÿ" ;
ASg Fem Def => "òàòà" ;
ASg Neut Def => "òîòî" ;
ASgMascDefNom => "òèÿò" ;
APl Indef => "òè" ;
APl Def => "òèòå"
}
} ;
lincat
Symb, [Symb] = SS ;
lin
MkSymb s = s ;
BaseSymb = infixSS "è" ;
ConsSymb = infixSS "," ;
}

View File

@@ -1,6 +0,0 @@
--# -path=.:../romance:../abstract:../common:prelude
concrete CatCat of Cat =
CommonX - [Temp,TTAnt,Tense,TPres,TPast,TFut,TCond] **
CatRomance with -- JS restore TPast for notpresent
(ResRomance = ResCat) ;

View File

@@ -1,137 +0,0 @@
--# -path=.:../romance:../common:../../prelude
----1 A Simple Catalan Resource Morphology
----
---- Aarne Ranta 2002 -- 2005
----
---- This resource morphology contains definitions needed in the resource
---- syntax. To build a lexicon, it is better to use $ParadigmsCat$, which
---- gives a higher-level access to this module.
--
resource MorphoCat = CommonRomance, ResCat **
open PhonoCat, Prelude, Predef in {
--
-- flags optimize=all ;
--
--
----2 Nouns
----
---- The following macro is useful for creating the forms of number-dependent
---- tables, such as common nouns.
--
oper
numForms : (_,_ : Str) -> Number => Str = \vi, vins ->
table {Sg => vi ; Pl => vins} ;
-- For example:
nomHome : Str -> Number => Str = \home ->
numForms home (home + "s") ;
nomDona : Str -> Number => Str = \dona ->
numForms dona (init dona + "es") ;
nomDisc : Str -> Number => Str = \disc ->
numForms disc (variants {disc + "s"; disc + "os"}) ;
-- nomPilar : Str -> Number => Str = \pilar ->
-- numForms pilar (pilar + "es") ;
--
-- nomTram : Str -> Number => Str = \tram ->
-- numForms tram tram ;
--
-- Common nouns are inflected in number and have an inherent gender.
mkNoun : (Number => Str) -> Gender -> Noun = \noinois,gen ->
{s = noinois ; g = gen} ;
mkNounIrreg : Str -> Str -> Gender -> Noun = \vi,vins ->
mkNoun (numForms vi vins) ;
mkNomReg : Str -> Noun = \noi ->
case last noi of {
"o" | "e" => mkNoun (nomHome noi) Masc ;
"a" => mkNoun (nomDona noi) Fem ;
"c" => mkNoun (nomDisc noi) Masc ;
--- "u" => mkNounIrreg mec (init mec + "ces") Fem ;
_ => mkNoun (nomHome noi) Masc
} ;
----2 Adjectives
----
-- Adjectives are conveniently seen as gender-dependent nouns.
-- Here are some patterns. First one that describes the worst case.
mkAdj : (_,_,_,_,_ : Str) -> Adj = \petit,petita,petits,petites,petitament ->
{s = table {
AF Masc n => numForms petit petits ! n ;
AF Fem n => numForms petita petites ! n ;
AA => petitament
}
} ;
---- Then the regular and invariant patterns.
--
-- adjfort : Str -> Adj = \solo ->
-- let
-- sol = Predef.tk 1 solo
-- in
-- mkAdj solo (sol + "a") (sol + "os") (sol + "as") (sol + "amente") ;
--
adjFort : Str -> Adj = \fort ->
mkAdj fort (fort + "a") (fort + "s") (fort + "es") (fort + "ament") ;
--
-- adjBlu : Str -> Adj = \blu ->
-- mkAdj blu blu blu blu blu ; ---
--
mkAdjReg : Str -> Adj = \fort -> adjFort fort ;
{-
case last solo of {
"o" => adjSolo solo ;
--- "e" => adjUtil solo (solo + "s") ;
"a" =>
_ => adjUtil solo (solo + "es")
} ;
-}
--
----2 Personal pronouns
----
---- All the eight personal pronouns can be built by the following macro.
---- The use of "ne" as atonic genitive is debatable.
---- We follow the rule that the atonic nominative is empty.
--
mkPronoun : (_,_,_,_,_,_,_,_ : Str) ->
Gender -> Number -> Person -> Pronoun =
\il,le,lui,Lui,son,sa,ses,see,g,n,p ->
let
alui : Case -> Str = \x -> prepCase x ++ Lui ;
in {
s = table {
Nom => {c1 = [] ; c2 = [] ; comp = il ; ton = Lui} ;
Acc => {c1 = le ; c2 = [] ; comp = [] ; ton = Lui} ;
CPrep P_a => {c1 = [] ; c2 = lui ; comp = [] ; ton = alui (CPrep P_a)} ;
c => {c1 = [] ; c2 = [] ; comp, ton = alui c}
} ;
poss = \\n,g => case <n,g> of {
<Sg,Masc> => son ;
<Sg,Fem> => sa ;
<Pl,Masc> => ses ;
<Pl,Fem> => see
} ;
a = {g = g ; n = n ; p = p} ;
hasClit = True
} ;
--
--
----2 Determiners
----
---- Determiners, traditionally called indefinite pronouns, are inflected
---- in gender and number, like adjectives.
--
pronForms : Adj -> Gender -> Number -> Str = \tale,g,n -> tale.s ! AF g n ;
--
}

View File

@@ -1,101 +0,0 @@
incomplete resource Overload = open Grammar in {
oper
pred = overload {
pred : NP -> V -> Cl
= \v,np -> PredVP np (UseV v) ;
pred : NP -> V2 -> NP -> Cl
= \v,np,ob -> PredVP np (ComplV2 v ob) ;
pred : NP -> V3 -> NP -> NP -> Cl
= \v,np,ob,ob2 ->
PredVP np (ComplV3 v ob ob2) ;
pred : NP -> A -> Cl
= \a,np ->
PredVP np (UseComp (CompAP (PositA a)))
} ;
mod = overload {
mod : A -> N -> CN
= \a,n -> AdjCN (PositA a) (UseN n) ;
mod : AP -> N -> CN
= \a,n -> AdjCN a (UseN n) ;
mod : AP -> CN -> CN
= \a,n -> AdjCN a n ;
mod : AdA -> A -> AP
= \m,a -> AdAP m (PositA a) ;
mod : Quant -> N -> NP
= \q,n -> DetCN (DetSg (SgQuant q)
NoOrd) (UseN n) ;
mod : Quant -> CN -> NP
= \q,n -> DetCN (DetSg
(SgQuant q) NoOrd) n ;
mod : Predet -> N -> NP
= \q,n -> PredetNP q (DetCN (DetPl
(PlQuant IndefArt) NoNum NoOrd) (UseN n)) ;
mod : Num -> N -> NP
= \nu,n -> DetCN (DetPl (PlQuant
IndefArt) nu NoOrd) (UseN n)
} ;
coord = overload {
coord : Conj -> Adv -> Adv -> Adv
= \c,x,y -> ConjAdv c (BaseAdv x y) ;
coord : Conj -> AP -> AP -> AP
= \c,x,y -> ConjAP c (BaseAP x y) ;
coord : Conj -> NP -> NP -> NP
= \c,x,y -> ConjNP c (BaseNP x y) ;
coord : Conj -> S -> S -> S
= \c,x,y -> ConjS c (BaseS x y) ;
coord : DConj -> Adv -> Adv -> Adv
= \c,x,y -> DConjAdv c (BaseAdv x y) ;
coord : DConj -> AP -> AP -> AP
= \c,x,y -> DConjAP c (BaseAP x y) ;
coord : DConj -> NP -> NP -> NP
= \c,x,y -> DConjNP c (BaseNP x y) ;
coord : DConj -> S -> S -> S
= \c,x,y -> DConjS c (BaseS x y) ;
coord : Conj -> ListAdv -> Adv
= \c,xy -> ConjAdv c xy ;
coord : Conj -> ListAP -> AP
= \c,xy -> ConjAP c xy ;
coord : Conj -> ListNP -> NP
= \c,xy -> ConjNP c xy ;
coord : Conj -> ListS -> S
= \c,xy -> ConjS c xy ;
coord : DConj -> ListAdv -> Adv
= \c,xy -> DConjAdv c xy ;
coord : DConj -> ListAP -> AP
= \c,xy -> DConjAP c xy ;
coord : DConj -> ListNP -> NP
= \c,xy -> DConjNP c xy ;
coord : DConj -> ListS -> S
= \c,xy -> DConjS c xy
} ;
mkCN = overload {
mkCN : N -> CN
= UseN ;
mkCN : A -> N -> CN
= \a,n -> AdjCN (PositA a) (UseN n) ;
mkCN : AP -> N -> CN
= \a,n -> AdjCN a (UseN n) ;
mkCN : AP -> CN -> CN
= \a,n -> AdjCN a n ;
} ;
mkNP = overload {
mkNP : NP
= this_NP ;
mkNP : Pron -> NP
= UsePron ;
mkNP : PN -> NP
= UsePN ;
mkNP : Quant -> N -> NP
= \q,n -> DetCN (DetSg (SgQuant q) NoOrd) (UseN n) ;
mkNP : Predet -> N -> NP
= \q,n -> PredetNP q (DetCN (DetPl (PlQuant IndefArt) NoNum NoOrd) (UseN n))
} ;
}

View File

@@ -1,12 +0,0 @@
PredVS : NP -> VS -> S -> Cl ;
PredVVV2A : NP -> VV -> V2A -> NP -> AP -> Cl ;
RelCNAdvPrep : CN -> NP -> V -> Adv -> Prep -> CN ;
PredVS np vs s = PredVP np (ComplVS vs s) ;
PredVVV2A np vv v2 np2 ap = PredVP np (ComplVV vv (ComplSlash (SlashV2A v2 ap) np2)) ;
RelCNAdvPrep cn np v adv prep = RelCN cn (UseRCl TPast ASimul PPos
(RelSlash IdRP (SlashPrep (PredVP np (AdvVP (UseV v) adv)) prep))) ;

View File

@@ -1,2 +0,0 @@
concrete ClauseAra of Clause = CatAra ** ClauseI
with (Grammar = GrammarAra) ;

View File

@@ -1,24 +0,0 @@
--# -path=.:alltenses
concrete DemoAra of Demo =
NounAra - [AdvCN,PredetNP,PPartNP,RelNP,RelCN,SentCN,
ApposCN,MassNP,DetNP,ComplN3,Use2N3,Use3N3,AdvNP],
-- VerbAra,
ClauseAra, --
AdjectiveAra - [SentAP,ComplA2,UseA2,DemoA2],
AdverbAra,
NumeralAra,
---- SentenceAra,
QuestionAra - [QuestVP,QuestSlash],
---- RelativeAra,
---- ConjunctionAra,
---- PhraseAra,
---- TextX,
---- IdiomAra,
StructuralAra - [everybody_NP,everything_NP,something_NP],
LexiconAra
** {
flags startcat = Phr ; unlexer = text ; lexer = text ;
} ;

View File

@@ -1,24 +0,0 @@
--# -path=.:alltenses
concrete DemoHin of Demo =
NounHin - [AdvCN,PredetNP,PPartNP,RelNP,RelCN,SentCN,
ApposCN,MassNP,DetNP,ComplN3,Use2N3,Use3N3,AdvNP],
-- VerbHin,
ClauseHin, --
AdjectiveHin - [SentAP,ComplA2,UseA2,DemoA2],
AdverbHin,
NumeralHin,
---- SentenceHin,
QuestionHin - [QuestVP,QuestSlash],
---- RelativeHin,
---- ConjunctionHin,
---- PhraseHin,
---- TextX,
---- IdiomHin,
StructuralHin - [everybody_NP,everything_NP,something_NP],
LexiconHin
** {
flags startcat = Phr ; unlexer = text ; lexer = text ;
} ;

View File

@@ -1,24 +0,0 @@
--# -path=.:alltenses
concrete DemoIna of Demo =
NounIna - [AdvCN,PredetNP,PPartNP,RelNP,RelCN,SentCN,
ApposCN,MassNP,DetNP,ComplN3,Use2N3,Use3N3,AdvNP],
-- VerbIna,
ClauseIna, --
AdjectiveIna - [SentAP,ComplA2,UseA2,DemoA2],
AdverbIna,
NumeralIna,
---- SentenceIna,
QuestionIna - [QuestVP,QuestSlash],
---- RelativeIna,
---- ConjunctionIna,
---- PhraseIna,
---- TextX,
---- IdiomIna,
StructuralIna - [everybody_NP,everything_NP,something_NP],
LexiconIna
** {
flags startcat = Phr ; unlexer = text ; lexer = text ;
} ;

View File

@@ -1,24 +0,0 @@
--# -path=.:alltenses
incomplete concrete DemoJ of Demo =
Noun - [AdvCN,PredetNP,PPartNP,RelNP,RelCN,SentCN,
ApposCN,MassNP,DetNP,ComplN3,Use2N3,Use3N3,AdvNP],
-- Verb,
Clause, --
Adjective - [SentAP,ComplA2,UseA2,DemoA2],
Adverb,
Numeral,
---- Sentence,
Question - [QuestVP,QuestSlash],
---- Relative,
---- Conjunction,
---- Phrase,
---- TextX,
---- Idiom,
Structural - [everybody_NP,everything_NP,something_NP],
Lexicon
** {
flags startcat = Phr ; unlexer = text ; lexer = text ;
} ;

View File

@@ -1,22 +0,0 @@
--# -path=.:alltenses
concrete DemoJEng of Demo = DemoJ with
(Noun = NounEng),
(Clause = ClauseEng), --
(Adjective = AdjectiveEng),
(Adverb = AdverbEng),
(Numeral = NumeralEng),
---- Sentence,
(Question )- [QuestVP,QuestSlash],
---- Relative,
---- Conjunction,
---- Phrase,
---- TextX,
---- Idiom,
Structural - [everybody_NP,everything_NP,something_NP],
Lexicon
** {
flags startcat = Phr ; unlexer = text ; lexer = text ;
} ;

View File

@@ -1,24 +0,0 @@
--# -path=.:alltenses
concrete DemoTha of Demo =
NounTha - [AdvCN,PredetNP,PPartNP,RelNP,RelCN,SentCN,
ApposCN,MassNP,DetNP,ComplN3,Use2N3,Use3N3,AdvNP],
-- VerbTha,
ClauseTha, --
AdjectiveTha - [SentAP,ComplA2,UseA2,DemoA2],
AdverbTha,
NumeralTha,
---- SentenceTha,
QuestionTha - [QuestVP,QuestSlash],
---- RelativeTha,
---- ConjunctionTha,
---- PhraseTha,
---- TextX,
---- IdiomTha,
StructuralTha - [everybody_NP,everything_NP,something_NP],
LexiconTha
** {
flags startcat = Phr ; unlexer = text ; lexer = text ;
} ;

View File

@@ -1,53 +0,0 @@
concrete AdjectiveEng of Adjective = CatEng ** open ResEng, Prelude in {
lin
PositA a = {
s = \\_ => a.s ! AAdj Posit Nom ;
isPre = True
} ;
ComparA a np = {
s = \\_ => a.s ! AAdj Compar Nom ++ "than" ++ np.s ! Nom ;
isPre = False
} ;
UseComparA a = {
s = \\_ => a.s ! AAdj Compar Nom ;
isPre = True
} ;
AdjOrd ord = {
s = \\_ => ord.s ! Nom ;
isPre = True
} ;
CAdvAP ad ap np = {
s = \\a => ad.s ++ ap.s ! a ++ ad.p ++ np.s ! Nom ;
isPre = False
} ;
ComplA2 a np = {
s = \\_ => a.s ! AAdj Posit Nom ++ a.c2 ++ np.s ! Acc ;
isPre = False
} ;
ReflA2 a = {
s = \\ag => a.s ! AAdj Posit Nom ++ a.c2 ++ reflPron ! ag ;
isPre = False
} ;
SentAP ap sc = {
s = \\a => ap.s ! a ++ sc.s ;
isPre = False
} ;
AdAP ada ap = {
s = \\a => ada.s ++ ap.s ! a ;
isPre = ap.isPre
} ;
UseA2 a = {
s = \\_ => a.s ! AAdj Posit Nom ;
isPre = True
} ;
}

View File

@@ -1,11 +0,0 @@
--# -path=.:../romance:../abstract:../common
concrete CompatibilityCat of Compatibility = CatCat ** open Prelude, CommonRomance in {
-- from Noun 19/4/2008
lin
NumInt n = {s = \\_ => n.s ; isNum = True ; n = Pl} ;
OrdInt n = {s = \\_ => n.s ++ "."} ; ---
}

View File

@@ -1,17 +0,0 @@
--# -path=.:../abstract:../common
concrete CompatibilityEng of Compatibility = CatEng ** open Prelude, ResEng in {
-- from Noun 19/4/2008
lin
NumInt n = {s = addGenitiveS n.s ; n = Pl ; hasCard = True} ;
OrdInt n = {s = \\c => n.s ++ (regGenitiveS "th")!c } ;
oper
-- Note: this results in a space before 's, but there's
-- not mauch we can do about that.
addGenitiveS : Str -> Case => Str = \s ->
table { Gen => s ++ "'s"; _ => s } ;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,19 +0,0 @@
abstract ExtraEngAbs = Extra ** {
-- uncontracted negations; contracted are the default
fun
UncNegCl : Temp -> Pol -> Cl -> S ;
UncNegQCl : Temp -> Pol -> QCl -> QS ;
UncNegRCl : Temp -> Pol -> RCl -> RS ;
UncNegImpSg : Pol -> Imp -> Utt; -- do not help yourself
UncNegImpPl : Pol -> Imp -> Utt; -- do not help yourselves
-- freely compounded nouns
CompoundCN : CN -> CN -> CN ; -- rock album
that_RP : RP ; -- "that" as a relational pronoun (IdRP is "which" / "who")
each_Det : Det ;
}

View File

@@ -1,13 +0,0 @@
--# -path=.:../common:../abstract
resource MakeStructuralEng = open CatEng, ParadigmsEng, ResEng, MorphoEng, Prelude in {
oper
mkSubj : Str -> Subj = \x ->
lin Subj {s = x} ;
mkNP : Str -> Number -> NP = \s,n ->
lin NP (regNP s n) ;
mkIDet : Str -> Number -> IDet = \s,n ->
lin IDet {s = s ; n = n} ;
}

View File

@@ -1,40 +0,0 @@
--# -path=.:../../prelude
--1 A Simple English Resource Morphology
--
-- Aarne Ranta 2002 -- 2005
--
-- This resource morphology contains definitions needed in the resource
-- syntax. To build a lexicon, it is better to use $ParadigmsEng$, which
-- gives a higher-level access to this module.
resource MorphoEng = open Prelude, (Predef=Predef), ResEng in {
flags optimize=all ;
--2 Determiners
oper
mkDeterminer : Number -> Str -> {s : Str ; sp : Case => Str; n : Number} = \n,s ->
{s = s;
sp = regGenitiveS s ;
n = n} ;
--2 Pronouns
mkPron : (i,me,my,mine : Str) -> Number -> Person -> Gender ->
{s : Case => Str ; sp : Case => Str ; a : Agr} =
\i,me,my,mine,n,p,g -> {
s = table {
Nom => i ;
Acc => me ;
Gen => my
} ;
a = toAgr n p g ;
sp = regGenitiveS mine
} ;
} ;

View File

@@ -1 +0,0 @@
resource OverloadEng = Overload with (Grammar = GrammarEng) ;

View File

@@ -1,141 +0,0 @@
concrete StructuralEng of Structural = CatEng **
open MorphoEng, ResEng, ParadigmsEng, MakeStructuralEng,
(C = ConstructX), Prelude in {
flags optimize=all ;
lin
above_Prep = mkPrep "above" ;
after_Prep = mkPrep "after" ;
all_Predet = ss "all" ;
almost_AdA = mkAdA "almost" ;
almost_AdN = mkAdN "almost" ;
although_Subj = ss "although" ;
always_AdV = mkAdV "always" ;
and_Conj = mkConj "and" ;
because_Subj = ss "because" ;
before_Prep = mkPrep "before" ;
behind_Prep = mkPrep "behind" ;
between_Prep = mkPrep "between" ;
both7and_DConj = mkConj "both" "and";
but_PConj = ss "but" ;
by8agent_Prep = mkPrep "by" ;
by8means_Prep = mkPrep "by" ;
can8know_VV, can_VV = {
s = table {
VVF VInf => ["be able to"] ;
VVF VPres => "can" ;
VVF VPPart => ["been able to"] ;
VVF VPresPart => ["being able to"] ;
VVF VPast => "could" ; --# notpresent
VVPastNeg => "couldn't" ; --# notpresent
VVPresNeg => "can't"
} ;
isAux = True
} ;
during_Prep = mkPrep "during" ;
either7or_DConj = mkConj "either" "or" singular ;
everybody_NP = regNP "everybody" singular ;
every_Det = mkDeterminer singular "every" ;
everything_NP = regNP "everything" singular ;
everywhere_Adv = mkAdv "everywhere" ;
few_Det = mkDeterminer plural "few" ;
--- first_Ord = ss "first" ; DEPRECATED
for_Prep = mkPrep "for" ;
from_Prep = mkPrep "from" ;
he_Pron = mkPron "he" "him" "his" "his" singular P3 masculine ;
here_Adv = mkAdv "here" ;
here7to_Adv = mkAdv ["to here"] ;
here7from_Adv = mkAdv ["from here"] ;
how_IAdv = ss "how" ;
how8many_IDet = mkDeterminer plural ["how many"] ;
if_Subj = ss "if" ;
in8front_Prep = mkPrep ["in front of"] ;
i_Pron = mkPron "I" "me" "my" "mine" singular P1 human ;
in_Prep = mkPrep "in" ;
it_Pron = mkPron "it" "it" "its" "its" singular P3 nonhuman ;
less_CAdv = C.mkCAdv "less" "than" ;
many_Det = mkDeterminer plural "many" ;
more_CAdv = C.mkCAdv "more" "than" ;
most_Predet = ss "most" ;
much_Det = mkDeterminer singular "much" ;
must_VV = {
s = table {
VVF VInf => ["have to"] ;
VVF VPres => "must" ;
VVF VPPart => ["had to"] ;
VVF VPresPart => ["having to"] ;
VVF VPast => ["had to"] ; --# notpresent
VVPastNeg => ["hadn't to"] ; --# notpresent
VVPresNeg => "mustn't"
} ;
isAux = True
} ;
---b no_Phr = ss "no" ;
no_Utt = ss "no" ;
on_Prep = mkPrep "on" ;
---- one_Quant = mkDeterminer singular "one" ; -- DEPRECATED
only_Predet = ss "only" ;
or_Conj = mkConj "or" singular ;
otherwise_PConj = ss "otherwise" ;
part_Prep = mkPrep "of" ;
please_Voc = ss "please" ;
possess_Prep = mkPrep "of" ;
quite_Adv = mkAdv "quite" ;
she_Pron = mkPron "she" "her" "her" "hers" singular P3 feminine ;
so_AdA = mkAdA "so" ;
somebody_NP = regNP "somebody" singular ;
someSg_Det = mkDeterminer singular "some" ;
somePl_Det = mkDeterminer plural "some" ;
something_NP = regNP "something" singular ;
somewhere_Adv = mkAdv "somewhere" ;
that_Quant = mkQuant "that" "those" ;
there_Adv = mkAdv "there" ;
there7to_Adv = mkAdv "there" ;
there7from_Adv = mkAdv ["from there"] ;
therefore_PConj = ss "therefore" ;
they_Pron = mkPron "they" "them" "their" "theirs" plural P3 human ;
this_Quant = mkQuant "this" "these" ;
through_Prep = mkPrep "through" ;
too_AdA = mkAdA "too" ;
to_Prep = mkPrep "to" ;
under_Prep = mkPrep "under" ;
very_AdA = mkAdA "very" ;
want_VV = mkVV (regV "want") ;
we_Pron = mkPron "we" "us" "our" "ours" plural P1 human ;
whatPl_IP = mkIP "what" "what" "what's" plural ;
whatSg_IP = mkIP "what" "what" "what's" singular ;
when_IAdv = ss "when" ;
when_Subj = ss "when" ;
where_IAdv = ss "where" ;
which_IQuant = {s = \\_ => "which"} ;
---b whichPl_IDet = mkDeterminer plural ["which"] ;
---b whichSg_IDet = mkDeterminer singular ["which"] ;
whoPl_IP = mkIP "who" "whom" "whose" plural ;
whoSg_IP = mkIP "who" "whom" "whose" singular ;
why_IAdv = ss "why" ;
without_Prep = mkPrep "without" ;
with_Prep = mkPrep "with" ;
---b yes_Phr = ss "yes" ;
yes_Utt = ss "yes" ;
youSg_Pron = mkPron "you" "you" "your" "yours" singular P2 human ;
youPl_Pron = mkPron "you" "you" "your" "yours" plural P2 human ;
youPol_Pron = mkPron "you" "you" "your" "yours" singular P2 human ;
not_Predet = {s = "not" ; lock_Predet = <>} ;
no_Quant = mkQuant "no" "no" "none" "none" ;
if_then_Conj = mkConj "if" "then" singular ;
nobody_NP = regNP "nobody" singular ;
nothing_NP = regNP "nothing" singular ;
at_least_AdN = mkAdN "at least" ;
at_most_AdN = mkAdN "at most" ;
except_Prep = mkPrep "except" ;
as_CAdv = C.mkCAdv "as" "as" ;
have_V2 = dirV2 (mk5V "have" "has" "had" "had" "having") ;
}

View File

@@ -1,44 +0,0 @@
--# -path=.:abstract:common
concrete SymbolEng of Symbol = CatEng ** open Prelude, ResEng in {
lin
SymbPN i = {s = addGenitiveS i.s ; g = Neutr} ;
IntPN i = {s = addGenitiveS i.s ; g = Neutr} ;
FloatPN i = {s = addGenitiveS i.s ; g = Neutr} ;
NumPN i = {s = i.s ; g = Neutr} ;
CNIntNP cn i = {
s = \\c => cn.s ! Sg ! Nom ++ (addGenitiveS i.s) ! c ;
a = agrgP3 Sg cn.g
} ;
CNSymbNP det cn xs = {
s = \\c => det.s ++ cn.s ! det.n ! Nom ++ (addGenitiveS xs.s) ! c ;
a = agrgP3 det.n cn.g
} ;
CNNumNP cn i = {
s = \\c => cn.s ! Sg ! Nom ++ i.s ! c ;
a = agrgP3 Sg cn.g
} ;
SymbS sy = sy ;
SymbNum sy = { s = addGenitiveS sy.s ; n = Pl ; hasCard = True } ;
SymbOrd sy = { s = \\c => sy.s ++ (regGenitiveS "th")!c} ;
lincat
Symb, [Symb] = SS ;
lin
MkSymb s = s ;
BaseSymb = infixSS "and" ;
ConsSymb = infixSS "," ;
oper
-- Note: this results in a space before 's, but there's
-- not mauch we can do about that.
addGenitiveS : Str -> Case => Str = \s ->
table { Gen => s ++ "'s"; _ => s } ;
}

View File

@@ -1,13 +0,0 @@
--# -path=.:../common:../abstract
resource MakeStructuralFin = open CatFin, ParadigmsFin, MorphoFin, Prelude in {
oper
mkConj : Str -> Str -> Number -> Conj = \x,y,n ->
{s1 = x ; s2 = y ; n = n ; lock_Conj = <>} ;
mkSubj : Str -> Subj = \x ->
{s = x ; lock_Subj = <>} ;
mkIQuant : Str -> IQuant = \s ->
{s = \\n,c => s ; lock_IQuant = <>} ; ----
}

View File

@@ -1,5 +0,0 @@
--# -path=.:../romance:../common:../abstract:../common:prelude
concrete CatFre of Cat = CommonX - [Temp,TTAnt,Tense,TPres,TPast,TFut,TCond]
** CatRomance with
(ResRomance = ResFre) ;

View File

@@ -1,16 +0,0 @@
--# -path=.:../romance:../common:../abstract
resource MakeStructuralFre = open CatFre, ParadigmsFre, MorphoFre, Prelude in {
oper
mkConj : Str -> Str -> Number -> Conj = \x,y,n ->
{s1 = x ; s2 = y ; n = n ; lock_Conj = <>} ;
mkSubj : Str -> Subj = \x ->
{s = x ; m = Indic ; lock_Subj = <>} ;
mkSubjSubj : Str -> Subj = \x ->
{s = x ; m = Conjunct ; lock_Subj = <>} ;
mkIQuant : Str -> IQuant = \s ->
{s = \\_,_,c => prepCase c ++ s ; lock_IQuant = <>} ;
}

View File

@@ -1,13 +0,0 @@
--# -path=.:../common:../abstract
resource MakeStructuralGer = open CatGer, ParadigmsGer, MorphoGer, Prelude in {
oper
mkConj : Str -> Str -> Number -> Conj = \x,y,n ->
{s1 = x ; s2 = y ; n = n ; lock_Conj = <>} ;
mkSubj : Str -> Subj = \x ->
{s = x ; lock_Subj = <>} ;
mkIQuant : Str -> IQuant = \s ->
{s = \\_,_,_ => s ; lock_IQuant = <>} ;
}

View File

@@ -1,41 +0,0 @@
--# -path=.:abstract:common
concrete SymbolHin of Symbol = CatHin ** open Prelude, ResHin in {
{- TODO!
lin
SymbPN i = {s = addGenitiveS i.s ; g = Neutr} ;
IntPN i = {s = addGenitiveS i.s ; g = Neutr} ;
FloatPN i = {s = addGenitiveS i.s ; g = Neutr} ;
NumPN i = {s = i.s ; g = Neutr} ;
CNIntNP cn i = {
s = \\c => cn.s ! Sg ! Nom ++ (addGenitiveS i.s) ! c ;
a = agrgP3 Sg cn.g
} ;
CNSymbNP det cn xs = {
s = \\c => det.s ++ cn.s ! det.n ! Nom ++ (addGenitiveS xs.s) ! c ;
a = agrgP3 det.n cn.g
} ;
CNNumNP cn i = {
s = \\c => cn.s ! Sg ! Nom ++ i.s ! c ;
a = agrgP3 Sg cn.g
} ;
SymbS sy = sy ;
SymbNum sy = { s = addGenitiveS sy.s ; n = Pl ; hasCard = True } ;
SymbOrd sy = { s = \\c => sy.s ++ (regGenitiveS "th")!c} ;
-}
lincat
Symb, [Symb] = SS ;
lin
MkSymb s = s ;
-- BaseSymb = infixSS "and" ;
ConsSymb = infixSS "," ;
}

View File

@@ -1 +0,0 @@
resource OverloadIna = Overload with (Grammar = GrammarIna) ;

View File

@@ -1,41 +0,0 @@
--# -path=.:abstract:common
concrete SymbolIna of Symbol = CatIna ** open Prelude, ResIna in {
{- TODO!
lin
SymbPN i = {s = addGenitiveS i.s ; g = Neutr} ;
IntPN i = {s = addGenitiveS i.s ; g = Neutr} ;
FloatPN i = {s = addGenitiveS i.s ; g = Neutr} ;
NumPN i = {s = i.s ; g = Neutr} ;
CNIntNP cn i = {
s = \\c => cn.s ! Sg ! Nom ++ (addGenitiveS i.s) ! c ;
a = agrgP3 Sg cn.g
} ;
CNSymbNP det cn xs = {
s = \\c => det.s ++ cn.s ! det.n ! Nom ++ (addGenitiveS xs.s) ! c ;
a = agrgP3 det.n cn.g
} ;
CNNumNP cn i = {
s = \\c => cn.s ! Sg ! Nom ++ i.s ! c ;
a = agrgP3 Sg cn.g
} ;
SymbS sy = sy ;
SymbNum sy = { s = addGenitiveS sy.s ; n = Pl ; hasCard = True } ;
SymbOrd sy = { s = \\c => sy.s ++ (regGenitiveS "th")!c} ;
-}
lincat
Symb, [Symb] = SS ;
lin
MkSymb s = s ;
-- BaseSymb = infixSS "and" ;
ConsSymb = infixSS "," ;
}

View File

@@ -1,4 +0,0 @@
--# -path=.:../romance:../abstract:../common:prelude
concrete CatIta of Cat = CommonX - [Temp,TTAnt,Tense,TPres,TPast,TFut,TCond] ** CatRomance with
(ResRomance = ResIta) ;

View File

@@ -1,16 +0,0 @@
--# -path=.:../romance:../common:../abstract
resource MakeStructuralIta = open CatIta, ParadigmsIta, MorphoIta, Prelude in {
oper
mkConj : Str -> Str -> Number -> Conj = \x,y,n ->
{s1 = x ; s2 = y ; n = n ; lock_Conj = <>} ;
mkSubj : Str -> Subj = \x ->
{s = x ; m = Indic ; lock_Subj = <>} ;
mkSubjSubj : Str -> Subj = \x ->
{s = x ; m = Conjunct ; lock_Subj = <>} ;
mkIQuant : Str -> IQuant = \s ->
{s = \\_,_,c => prepCase c ++ s ; lock_IQuant = <>} ;
}

View File

@@ -1,21 +0,0 @@
concrete AdverbLat of Adverb = CatLat ** open ResLat, Prelude in {
lin
-- PositAdvAdj a = {s = a.s ! AAdv} ;
-- ComparAdvAdj cadv a np = {
-- s = cadv.s ++ a.s ! AAdv ++ "than" ++ np.s ! Nom
-- } ;
-- ComparAdvAdjS cadv a s = {
-- s = cadv.s ++ a.s ! AAdv ++ "than" ++ s.s
-- } ;
PrepNP prep np = {s = appPrep prep np.s} ;
-- AdAdv = cc2 ;
--
-- SubjS = cc2 ;
-----b AdvSC s = s ; --- this rule give stack overflow in ordinary parsing
--
-- AdnCAdv cadv = {s = cadv.s ++ "than"} ;
--
}

View File

@@ -1,9 +0,0 @@
--# -path=.:../abstract:../common:prelude
abstract AllEngAbs =
Lang,
IrregEngAbs-[
blow_V,burn_V,come_V,dig_V,fall_V,fly_V,freeze_V,go_V,lie_V,run_V,
sew_V,sing_V,sit_V,sleep_V,spit_V,stand_V,swell_V,swim_V,think_V],
ExtraEngAbs
** {} ;

View File

@@ -1,6 +0,0 @@
--# -path=.:../abstract:../common:prelude
concrete AllLat of AllLatAbs =
LangLat
-- ExtraLat
** {} ;

View File

@@ -1 +0,0 @@
abstract AllLatAbs = Lang ;

View File

@@ -1,76 +0,0 @@
--concrete BackwardLat of Backward = CatLat ** open ResLat in {
--
-- flags optimize=all_subs ;
--
-- lin
--
---- A repository of obsolete constructs, needed for backward compatibility.
---- They create spurious ambiguities if used in combination with Lang.
--
---- from Verb 19/4/2008
--
-- ComplV2 v np = insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v) ;
-- ComplV3 v np np2 =
-- insertObj (\\_ => v.c2 ++ np.s ! Acc ++ v.c3 ++ np2.s ! Acc) (predV v) ;
-- ComplV2V v np vp =
-- insertObj (\\a => infVP v.isAux vp a)
-- (insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v)) ;
-- ComplV2S v np s =
-- insertObj (\\_ => conjThat ++ s.s)
-- (insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v)) ;
-- ComplV2Q v np q =
-- insertObj (\\_ => q.s ! QIndir)
-- (insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v)) ;
-- ComplV2A v np ap =
-- insertObj (\\_ => v.c2 ++ np.s ! Acc ++ ap.s ! np.a) (predV v) ;
--
-- ReflV2 v = insertObj (\\a => v.c2 ++ reflPron ! a) (predV v) ;
--
---- from Sentence 19/4/2008
--
-- SlashV2 np v2 =
-- mkClause (np.s ! Nom) np.a (predV v2) ** {c2 = v2.c2} ;
--
-- SlashVVV2 np vv v2 =
-- mkClause (np.s ! Nom) np.a
-- (insertObj (\\a => infVP vv.isAux (predV v2) a) (predVV vv)) **
-- {c2 = v2.c2} ;
--
---- from Noun 19/4/2008
--
-- NumInt n = {s = n.s ; n = Pl} ;
-- OrdInt n = {s = n.s ++ "th"} ; --- DEPRECATED
--
-- DetSg quant ord = {
-- s = quant.s ! Sg ++ ord.s ;
-- n = Sg
-- } ;
--
-- DetPl quant num ord = {
-- s = quant.s ! num.n ++ num.s ++ ord.s ;
-- n = num.n
-- } ;
--
-- NoNum = {s = []; n = Pl } ;
--
-- DefArt = {s = \\_ => artDef} ;
--
-- IndefArt = {
-- s = table {
-- Sg => artIndef ;
-- Pl => []
-- }
-- } ;
--
-- MassDet = {s = \\_ => []} ;
--
--
--
---- from Structural 19/4/2008
--
-- that_NP = regNP "that" Sg ;
-- these_NP = regNP "these" Pl ;
-- this_NP = regNP "this" Sg ;
-- those_NP = regNP "those" Pl ;
--
--}

View File

@@ -1,88 +0,0 @@
concrete CatLat of Cat = CommonX ** open ResLat, Prelude in {
flags optimize=all_subs ;
lincat
---- Tensed/Untensed
--
-- S = {s : Str} ;
-- QS = {s : QForm => Str} ;
-- RS = {s : Agr => Str ; c : Case} ; -- c for it clefts
-- SSlash = {s : Str ; c2 : Str} ;
--
---- Sentence
--
Cl = {s : VAnter => VTense => Polarity => Str} ;
-- ClSlash = {
-- s : ResLat.Tense => Anteriority => CPolarity => Order => Str ;
-- c2 : Str
-- } ;
-- Imp = {s : CPolarity => ImpForm => Str} ;
--
---- Question
--
-- QCl = {s : ResLat.Tense => Anteriority => CPolarity => QForm => Str} ;
-- IP = {s : Case => Str ; n : Number} ;
-- IComp = {s : Str} ;
-- IDet = {s : Str ; n : Number} ;
-- IQuant = {s : Number => Str} ;
--
---- Relative
--
-- RCl = {
-- s : ResLat.Tense => Anteriority => CPolarity => Agr => Str ;
-- c : Case
-- } ;
-- RP = {s : RCase => Str ; a : RAgr} ;
--
---- Verb
--
VP = ResLat.VP ;
VPSlash = ResLat.VP ** {c2 : Preposition} ;
Comp = {s : Gender => Number => Case => Str} ;
--
---- Adjective
--
AP = Adjective ** {isPre : Bool} ; ---- {s : Agr => Str ; isPre : Bool} ;
--
---- Noun
--
CN = {s : Number => Case => Str ; g : Gender} ;
NP, Pron = {s : Case => Str ; g : Gender ; n : Number ; p : Person} ;
Det = Determiner ;
-- Predet, Ord = {s : Str} ;
Num = {s : Gender => Case => Str ; n : Number} ;
-- Card = {s : Str ; n : Number} ;
Quant = Quantifier ;
--
---- Numeral
--
-- Numeral = {s : CardOrd => Str ; n : Number} ;
-- Digits = {s : CardOrd => Str ; n : Number ; tail : DTail} ;
--
---- Structural
--
Conj = {s1,s2 : Str ; n : Number} ;
-- Subj = {s : Str} ;
Prep = {s : Str ; c : Case} ;
--
---- Open lexical classes, e.g. Lexicon
V = Verb ;
V2 = Verb ** {c : Preposition} ;
-- V, VS, VQ, VA = Verb ; -- = {s : VForm => Str} ;
-- V2, V2A, V2Q, V2S = Verb ** {c2 : Str} ;
-- V3 = Verb ** {c2, c3 : Str} ;
-- VV = {s : VVForm => Str ; isAux : Bool} ;
-- V2V = Verb ** {c2 : Str ; isAux : Bool} ;
--
A = Adjective ** {isPre : Bool} ;
-- A2 = {s : AForm => Str ; c2 : Str} ;
--
N = Noun ;
-- N2 = {s : Number => Case => Str ; g : Gender} ** {c2 : Str} ;
-- N3 = {s : Number => Case => Str ; g : Gender} ** {c2,c3 : Str} ;
PN = {s : Case => Str ; g : Gender} ;
--
}

View File

@@ -1,60 +0,0 @@
--concrete ConjunctionLat of Conjunction =
-- CatLat ** open ResLat, Coordination, Prelude in {
--
-- flags optimize=all_subs ;
--
-- lin
--
-- ConjS = conjunctDistrSS ;
--
-- ConjAdv = conjunctDistrSS ;
--
-- ConjNP conj ss = conjunctDistrTable Case conj ss ** {
-- a = conjAgr (agrP3 conj.n) ss.a
-- } ;
--
-- ConjAP conj ss = conjunctDistrTable Agr conj ss ** {
-- isPre = ss.isPre
-- } ;
--
--{---b
--
-- ConjS = conjunctSS ;
-- DConjS = conjunctDistrSS ;
--
-- ConjAdv = conjunctSS ;
-- DConjAdv = conjunctDistrSS ;
--
-- ConjNP conj ss = conjunctTable Case conj ss ** {
-- a = conjAgr (agrP3 conj.n) ss.a
-- } ;
-- DConjNP conj ss = conjunctDistrTable Case conj ss ** {
-- a = conjAgr (agrP3 conj.n) ss.a
-- } ;
--
-- ConjAP conj ss = conjunctTable Agr conj ss ** {
-- isPre = ss.isPre
-- } ;
-- DConjAP conj ss = conjunctDistrTable Agr conj ss ** {
-- isPre = ss.isPre
-- } ;
---}
--
---- These fun's are generated from the list cat's.
--
-- BaseS = twoSS ;
-- ConsS = consrSS comma ;
-- BaseAdv = twoSS ;
-- ConsAdv = consrSS comma ;
-- BaseNP x y = twoTable Case x y ** {a = conjAgr x.a y.a} ;
-- ConsNP xs x = consrTable Case comma xs x ** {a = conjAgr xs.a x.a} ;
-- BaseAP x y = twoTable Agr x y ** {isPre = andB x.isPre y.isPre} ;
-- ConsAP xs x = consrTable Agr comma xs x ** {isPre = andB xs.isPre x.isPre} ;
--
-- lincat
-- [S] = {s1,s2 : Str} ;
-- [Adv] = {s1,s2 : Str} ;
-- [NP] = {s1,s2 : Case => Str ; a : Agr} ;
-- [AP] = {s1,s2 : Agr => Str ; isPre : Bool} ;
--
--}

View File

@@ -1,3 +0,0 @@
concrete ExtraLat of ExtraLatAbs = CatLat **
open ResLat, Coordination, Prelude in {
}

View File

@@ -1,18 +0,0 @@
--# -path=.:../abstract:../common:prelude
concrete GrammarLat of Grammar =
NounLat,
VerbLat,
AdjectiveLat,
AdverbLat,
-- NumeralLat,
SentenceLat,
-- QuestionLat,
-- RelativeLat,
-- ConjunctionLat,
-- PhraseLat,
TextX,
StructuralLat
-- IdiomLat
** {
} ;

View File

@@ -1,30 +0,0 @@
--concrete IdiomLat of Idiom = CatLat ** open Prelude, ResLat in {
--
-- flags optimize=all_subs ;
--
-- lin
-- ImpersCl vp = mkClause "it" (agrP3 Sg) vp ;
-- GenericCl vp = mkClause "one" (agrP3 Sg) vp ;
--
-- CleftNP np rs = mkClause "it" (agrP3 Sg)
-- (insertObj (\\_ => rs.s ! np.a)
-- (insertObj (\\_ => np.s ! rs.c) (predAux auxBe))) ;
--
-- CleftAdv ad s = mkClause "it" (agrP3 Sg)
-- (insertObj (\\_ => conjThat ++ s.s)
-- (insertObj (\\_ => ad.s) (predAux auxBe))) ;
--
-- ExistNP np =
-- mkClause "there" (agrP3 (fromAgr np.a).n)
-- (insertObj (\\_ => np.s ! Acc) (predAux auxBe)) ;
--
-- ExistIP ip =
-- mkQuestion (ss (ip.s ! Nom))
-- (mkClause "there" (agrP3 ip.n) (predAux auxBe)) ;
--
-- ProgrVP vp = insertObj (\\a => vp.ad ++ vp.prp ++ vp.s2 ! a) (predAux auxBe) ;
--
-- ImpPl1 vp = {s = "let's" ++ infVP True vp (AgP1 Pl)} ;
--
--}
--

View File

@@ -1,176 +0,0 @@
abstract IrregEngAbs = Cat ** {
fun
awake_V : V ;
bear_V : V ;
beat_V : V ;
become_V : V ;
begin_V : V ;
bend_V : V ;
beset_V : V ;
bet_V : V ;
bid_V : V ;
bind_V : V ;
bite_V : V ;
bleed_V : V ;
blow_V : V ;
break_V : V ;
breed_V : V ;
bring_V : V ;
broadcast_V : V ;
build_V : V ;
burn_V : V ;
burst_V : V ;
buy_V : V ;
cast_V : V ;
catch_V : V ;
choose_V : V ;
cling_V : V ;
come_V : V ;
cost_V : V ;
creep_V : V ;
cut_V : V ;
deal_V : V ;
dig_V : V ;
dive_V : V ;
do_V : V ;
draw_V : V ;
dream_V : V ;
drive_V : V ;
drink_V : V ;
eat_V : V ;
fall_V : V ;
feed_V : V ;
feel_V : V ;
fight_V : V ;
find_V : V ;
fit_V : V ;
flee_V : V ;
fling_V : V ;
fly_V : V ;
forbid_V : V ;
forget_V : V ;
forgive_V : V ;
forsake_V : V ;
freeze_V : V ;
get_V : V ;
give_V : V ;
go_V : V ;
grind_V : V ;
grow_V : V ;
hang_V : V ;
have_V : V ;
hear_V : V ;
hide_V : V ;
hit_V : V ;
hold_V : V ;
hurt_V : V ;
keep_V : V ;
kneel_V : V ;
knit_V : V ;
know_V : V ;
lay_V : V ;
lead_V : V ;
leap_V : V ;
learn_V : V ;
leave_V : V ;
lend_V : V ;
let_V : V ;
lie_V : V ;
light_V : V ;
lose_V : V ;
make_V : V ;
mean_V : V ;
meet_V : V ;
misspell_V : V ;
mistake_V : V ;
mow_V : V ;
overcome_V : V ;
overdo_V : V ;
overtake_V : V ;
overthrow_V : V ;
pay_V : V ;
plead_V : V ;
prove_V : V ;
put_V : V ;
quit_V : V ;
read_V : V ;
rid_V : V ;
ride_V : V ;
ring_V : V ;
rise_V : V ;
run_V : V ;
saw_V : V ;
say_V : V ;
see_V : V ;
seek_V : V ;
sell_V : V ;
send_V : V ;
set_V : V ;
sew_V : V ;
shake_V : V ;
shave_V : V ;
shear_V : V ;
shed_V : V ;
shine_V : V ;
shoe_V : V ;
shoot_V : V ;
show_V : V ;
shrink_V : V ;
shut_V : V ;
sing_V : V ;
sink_V : V ;
sit_V : V ;
sleep_V : V ;
slay_V : V ;
slide_V : V ;
sling_V : V ;
slit_V : V ;
smite_V : V ;
sow_V : V ;
speak_V : V ;
speed_V : V ;
spend_V : V ;
spill_V : V ;
spin_V : V ;
spit_V : V ;
split_V : V ;
spread_V : V ;
spring_V : V ;
stand_V : V ;
steal_V : V ;
stick_V : V ;
sting_V : V ;
stink_V : V ;
stride_V : V ;
strike_V : V ;
string_V : V ;
strive_V : V ;
swear_V : V ;
sweep_V : V ;
swell_V : V ;
swim_V : V ;
swing_V : V ;
take_V : V ;
teach_V : V ;
tear_V : V ;
tell_V : V ;
think_V : V ;
thrive_V : V ;
throw_V : V ;
thrust_V : V ;
tread_V : V ;
understand_V : V ;
uphold_V : V ;
upset_V : V ;
wake_V : V ;
wear_V : V ;
weave_V : V ;
wed_V : V ;
weep_V : V ;
wind_V : V ;
win_V : V ;
withhold_V : V ;
withstand_V : V ;
wring_V : V ;
write_V : V ;
}

View File

@@ -1,181 +0,0 @@
----# -path=.:prelude:../abstract:../common
--
--concrete IrregLat of IrregLatAbs = CatLat ** open ParadigmsLat in {
--
--flags optimize=values ;
--
-- lin
-- awake_V = irregV "awake" "awoke" "awoken" ;
-- bear_V = irregV "bear" "bore" "born" ;
-- beat_V = irregV "beat" "beat" "beat" ;
-- become_V = irregV "become" "became" "become" ;
-- begin_V = irregV "begin" "began" "begun" ;
-- bend_V = irregV "bend" "bent" "bent" ;
-- beset_V = irregV "beset" "beset" "beset" ;
-- bet_V = irregDuplV "bet" "bet" "bet" ;
-- bid_V = irregDuplV "bid" (variants {"bid" ; "bade"}) (variants {"bid" ; "bidden"}) ;
-- bind_V = irregV "bind" "bound" "bound" ;
-- bite_V = irregV "bite" "bit" "bitten" ;
-- bleed_V = irregV "bleed" "bled" "bled" ;
-- blow_V = irregV "blow" "blew" "blown" ;
-- break_V = irregV "break" "broke" "broken" ;
-- breed_V = irregV "breed" "bred" "bred" ;
-- bring_V = irregV "bring" "brought" "brought" ;
-- broadcast_V = irregV "broadcast" "broadcast" "broadcast" ;
-- build_V = irregV "build" "built" "built" ;
-- burn_V = irregV "burn" (variants {"burned" ; "burnt"}) (variants {"burned" ; "burnt"}) ;
-- burst_V = irregV "burst" "burst" "burst" ;
-- buy_V = irregV "buy" "bought" "bought" ;
-- cast_V = irregV "cast" "cast" "cast" ;
-- catch_V = irregV "catch" "caught" "caught" ;
-- choose_V = irregV "choose" "chose" "chosen" ;
-- cling_V = irregV "cling" "clung" "clung" ;
-- come_V = irregV "come" "came" "come" ;
-- cost_V = irregV "cost" "cost" "cost" ;
-- creep_V = irregV "creep" "crept" "crept" ;
-- cut_V = irregDuplV "cut" "cut" "cut" ;
-- deal_V = irregV "deal" "dealt" "dealt" ;
-- dig_V = irregDuplV "dig" "dug" "dug" ;
-- dive_V = irregV "dive" (variants {"dived" ; "dove"}) "dived" ;
-- do_V = mk5V "do" "does" "did" "done" "doing" ;
-- draw_V = irregV "draw" "drew" "drawn" ;
-- dream_V = irregV "dream" (variants {"dreamed" ; "dreamt"}) (variants {"dreamed" ; "dreamt"}) ;
-- drive_V = irregV "drive" "drove" "driven" ;
-- drink_V = irregV "drink" "drank" "drunk" ;
-- eat_V = irregV "eat" "ate" "eaten" ;
-- fall_V = irregV "fall" "fell" "fallen" ;
-- feed_V = irregV "feed" "fed" "fed" ;
-- feel_V = irregV "feel" "felt" "felt" ;
-- fight_V = irregV "fight" "fought" "fought" ;
-- find_V = irregV "find" "found" "found" ;
-- fit_V = irregDuplV "fit" "fit" "fit" ;
-- flee_V = irregV "flee" "fled" "fled" ;
-- fling_V = irregV "fling" "flung" "flung" ;
-- fly_V = irregV "fly" "flew" "flown" ;
-- forbid_V = irregDuplV "forbid" "forbade" "forbidden" ;
-- forget_V = irregDuplV "forget" "forgot" "forgotten" ;
-- forgive_V = irregV "forgive" "forgave" "forgiven" ;
-- forsake_V = irregV "forsake" "forsook" "forsaken" ;
-- freeze_V = irregV "freeze" "froze" "frozen" ;
-- get_V = irregDuplV "get" "got" "gotten" ;
-- give_V = irregV "give" "gave" "given" ;
-- go_V = mk5V "go" "goes" "went" "gone" "going" ;
-- grind_V = irregV "grind" "ground" "ground" ;
-- grow_V = irregV "grow" "grew" "grown" ;
-- hang_V = irregV "hang" "hung" "hung" ;
-- have_V = mk5V "have" "has" "had" "had" "having" ;
-- hear_V = irregV "hear" "heard" "heard" ;
-- hide_V = irregV "hide" "hid" "hidden" ;
-- hit_V = irregDuplV "hit" "hit" "hit" ;
-- hold_V = irregV "hold" "held" "held" ;
-- hurt_V = irregV "hurt" "hurt" "hurt" ;
-- keep_V = irregV "keep" "kept" "kept" ;
-- kneel_V = irregV "kneel" "knelt" "knelt" ;
-- knit_V = irregDuplV "knit" "knit" "knit" ;
-- know_V = irregV "know" "knew" "know" ;
-- lay_V = irregV "lay" "laid" "laid" ;
-- lead_V = irregV "lead" "led" "led" ;
-- leap_V = irregV "leap" (variants {"leaped" ; "lept"}) (variants {"leaped" ; "lept"}) ;
-- learn_V = irregV "learn" (variants {"learned" ; "learnt"}) (variants {"learned" ; "learnt"}) ;
-- leave_V = irregV "leave" "left" "left" ;
-- lend_V = irregV "lend" "lent" "lent" ;
-- let_V = irregDuplV "let" "let" "let" ;
-- lie_V = irregV "lie" "lay" "lain" ;
-- light_V = irregV "light" (variants {"lighted" ; "lit"}) "lighted" ;
-- lose_V = irregV "lose" "lost" "lost" ;
-- make_V = irregV "make" "made" "made" ;
-- mean_V = irregV "mean" "meant" "meant" ;
-- meet_V = irregV "meet" "met" "met" ;
-- misspell_V = irregV "misspell" (variants {"misspelled" ; "misspelt"}) (variants {"misspelled" ; "misspelt"}) ;
-- mistake_V = irregV "mistake" "mistook" "mistaken" ;
-- mow_V = irregV "mow" "mowed" (variants {"mowed" ; "mown"}) ;
-- overcome_V = irregV "overcome" "overcame" "overcome" ;
-- overdo_V = mk5V "overdo" "overdoes" "overdid" "overdone" "overdoing" ;
-- overtake_V = irregV "overtake" "overtook" "overtaken" ;
-- overthrow_V = irregV "overthrow" "overthrew" "overthrown" ;
-- pay_V = irregV "pay" "paid" "paid" ;
-- plead_V = irregV "plead" "pled" "pled" ;
-- prove_V = irregV "prove" "proved" (variants {"proved" ; "proven"}) ;
-- put_V = irregDuplV "put" "put" "put" ;
-- quit_V = irregDuplV "quit" "quit" "quit" ;
-- read_V = irregV "read" "read" "read" ;
-- rid_V = irregDuplV "rid" "rid" "rid" ;
-- ride_V = irregV "ride" "rode" "ridden" ;
-- ring_V = irregV "ring" "rang" "rung" ;
-- rise_V = irregV "rise" "rose" "risen" ;
-- run_V = irregDuplV "run" "ran" "run" ;
-- saw_V = irregV "saw" "sawed" (variants {"sawed" ; "sawn"}) ;
-- say_V = irregV "say" "said" "said" ;
-- see_V = irregV "see" "saw" "seen" ;
-- seek_V = irregV "seek" "sought" "sought" ;
-- sell_V = irregV "sell" "sold" "sold" ;
-- send_V = irregV "send" "sent" "sent" ;
-- set_V = irregDuplV "set" "set" "set" ;
-- sew_V = irregV "sew" "sewed" (variants {"sewed" ; "sewn"}) ;
-- shake_V = irregV "shake" "shook" "shaken" ;
-- shave_V = irregV "shave" "shaved" (variants {"shaved" ; "shaven"}) ;
-- shear_V = irregV "shear" "shore" "shorn" ;
-- shed_V = irregDuplV "shed" "shed" "shed" ;
-- shine_V = irregV "shine" "shone" "shone" ;
-- shoe_V = irregV "shoe" "shoed" (variants {"shoed" ; "shod"}) ;
-- shoot_V = irregV "shoot" "shot" "shot" ;
-- show_V = irregV "show" "showed" (variants {"showed" ; "shown"}) ;
-- shrink_V = irregV "shrink" "shrank" "shrunk" ;
-- shut_V = irregDuplV "shut" "shut" "shut" ;
-- sing_V = irregV "sing" "sang" "sung" ;
-- sink_V = irregV "sink" "sank" "sunk" ;
-- sit_V = irregDuplV "sit" "sat" "sat" ;
-- sleep_V = irregV "sleep" "slept" "slept" ;
-- slay_V = irregV "slay" "slew" "slain" ;
-- slide_V = irregV "slide" "slid" "slid" ;
-- sling_V = irregV "sling" "slung" "slung" ;
-- slit_V = irregDuplV "slit" "slit" "slit" ;
-- smite_V = irregV "smite" "smote" "smitten" ;
-- sow_V = irregV "sow" "sowed" (variants {"sowed" ; "sown"}) ;
-- speak_V = irregV "speak" "spoke" "spoken" ;
-- speed_V = irregV "speed" "sped" "sped" ;
-- spend_V = irregV "spend" "spent" "spent" ;
-- spill_V = irregV "spill" (variants {"spilled" ; "spilt"}) (variants {"spilled" ; "spilt"}) ;
-- spin_V = irregDuplV "spin" "spun" "spun" ;
-- spit_V = irregDuplV "spit" (variants {"spit" ; "spat"}) "spit" ;
-- split_V = irregDuplV "split" "split" "split" ;
-- spread_V = irregV "spread" "spread" "spread" ;
-- spring_V = irregV "spring" (variants {"sprang" ; "sprung"}) "sprung" ;
-- stand_V = irregV "stand" "stood" "stood" ;
-- steal_V = irregV "steal" "stole" "stolen" ;
-- stick_V = irregV "stick" "stuck" "stuck" ;
-- sting_V = irregV "sting" "stung" "stung" ;
-- stink_V = irregV "stink" "stank" "stunk" ;
-- stride_V = irregV "stride" "strod" "stridden" ;
-- strike_V = irregV "strike" "struck" "struck" ;
-- string_V = irregV "string" "strung" "strung" ;
-- strive_V = irregV "strive" "strove" "striven" ;
-- swear_V = irregV "swear" "swore" "sworn" ;
-- sweep_V = irregV "sweep" "swept" "swept" ;
-- swell_V = irregV "swell" "swelled" (variants {"swelled" ; "swollen"}) ;
-- swim_V = irregDuplV "swim" "swam" "swum" ;
-- swing_V = irregV "swing" "swung" "swung" ;
-- take_V = irregV "take" "took" "taken" ;
-- teach_V = irregV "teach" "taught" "taught" ;
-- tear_V = irregV "tear" "tore" "torn" ;
-- tell_V = irregV "tell" "told" "told" ;
-- think_V = irregV "think" "thought" "thought" ;
-- thrive_V = irregV "thrive" (variants {"thrived" ; "throve"}) "thrived" ;
-- throw_V = irregV "throw" "threw" "thrown" ;
-- thrust_V = irregV "thrust" "thrust" "thrust" ;
-- tread_V = irregV "tread" "trod" "trodden" ;
-- understand_V = irregV "understand" "understood" "understood" ;
-- uphold_V = irregV "uphold" "upheld" "upheld" ;
-- upset_V = irregDuplV "upset" "upset" "upset" ;
-- wake_V = irregV "wake" "woke" "woken" ;
-- wear_V = irregV "wear" "wore" "worn" ;
-- weave_V = irregV "weave" (variants {"weaved" ; "wove"}) (variants {"weaved" ; "woven"}) ;
-- wed_V = irregDuplV "wed" "wed" "wed" ;
-- weep_V = irregV "weep" "wept" "wept" ;
-- wind_V = irregV "wind" "wound" "wound" ;
-- win_V = irregDuplV "win" "won" "won" ;
-- withhold_V = irregV "withhold" "withheld" "withheld" ;
-- withstand_V = irregV "withstand" "withstood" "withstood" ;
-- wring_V = irregV "wring" "wrung" "wrung" ;
-- write_V = irregV "write" "wrote" "written" ;
--}

View File

@@ -1,10 +0,0 @@
--# -path=.:../abstract:../common:prelude
concrete LangLat of Lang =
GrammarLat,
LexiconLat
** {
flags startcat = Phr ; unlexer = text ; lexer = text ;
} ;

View File

@@ -1,377 +0,0 @@
--# -path=.:prelude
concrete LexiconLat of Lexicon = CatLat ** open
ParadigmsLat,
-- IrregLat,
Prelude in {
flags
optimize=values ;
lin
-- airplane_N = mkN "airplane" ;
-- answer_V2S = mkV2S (regV "answer") toP ;
-- apartment_N = mkN "apartment" ;
-- apple_N = mkN "apple" ;
art_N = mkN "ars" ;
-- ask_V2Q = mkV2Q (regV "ask") noPrep ;
baby_N = mkN "infans" ;
bad_A = mkA "malus" ;
-- bank_N = mkN "bank" ;
beautiful_A = mkA "pulcher" ;
-- become_VA = mkVA (irregV "become" "became" "become") ;
beer_N = mkN "cerevisia" ;
-- beg_V2V = mkV2V (regDuplV "beg") noPrep toP ;
big_A = mkA "magnus" ;
-- bike_N = mkN "bike" ;
bird_N = mkN "avis" "avis" masculine ;
black_A = mkA "niger" ;
-- blue_A = regADeg "blue" ;
-- boat_N = mkN "boat" ;
book_N = mkN "liber" ;
-- boot_N = mkN "boot" ;
-- boss_N = mkN human (mkN "boss") ;
boy_N = mkN "liber" ;
bread_N = mkN "panis" "panis" masculine ;
break_V2 = mkV2 (mkV "rumpo" "rupi" "ruptum" "rumpere") ;
-- broad_A = regADeg "broad" ;
-- brother_N2 = mkN2 (mkN masculine (mkN "brother")) (mkPrep "of") ;
-- brown_A = regADeg "brown" ;
-- butter_N = mkN "butter" ;
-- buy_V2 = dirV2 (irregV "buy" "bought" "bought") ;
-- camera_N = mkN "camera" ;
-- cap_N = mkN "cap" ;
-- car_N = mkN "car" ;
-- carpet_N = mkN "carpet" ;
cat_N = mkN "felis" ;
-- ceiling_N = mkN "ceiling" ;
-- chair_N = mkN "chair" ;
-- cheese_N = mkN "cheese" ;
-- child_N = mk2N "child" "children" ;
-- church_N = mkN "church" ;
city_N = mkN "urbs" "urbis" feminine ;
-- clean_A = regADeg "clean" ;
-- clever_A = regADeg "clever" ;
-- close_V2 = dirV2 (regV "close") ;
-- coat_N = mkN "coat" ;
-- cold_A = regADeg "cold" ;
-- come_V = (irregV "come" "came" "come") ;
-- computer_N = mkN "computer" ;
-- country_N = mkN "country" ;
-- cousin_N = mkN human (mkN "cousin") ;
-- cow_N = mkN "cow" ;
-- die_V = (regV "die") ;
-- dirty_A = regADeg "dirty" ;
-- distance_N3 = mkN3 (mkN "distance") fromP toP ;
-- doctor_N = mkN human (mkN "doctor") ;
-- dog_N = mkN "dog" ;
-- door_N = mkN "door" ;
-- drink_V2 = dirV2 (irregV "drink" "drank" "drunk") ;
-- easy_A2V = mkA2V (regA "easy") forP ;
-- eat_V2 = dirV2 (irregV "eat" "ate" "eaten") ;
-- empty_A = regADeg "empty" ;
-- enemy_N = mkN "enemy" ;
-- factory_N = mkN "factory" ;
-- father_N2 = mkN2 (mkN masculine (mkN "father")) (mkPrep "of") ;
-- fear_VS = mkVS (regV "fear") ;
-- find_V2 = dirV2 (irregV "find" "found" "found") ;
-- fish_N = mk2N "fish" "fish" ;
-- floor_N = mkN "floor" ;
-- forget_V2 = dirV2 (irregDuplV "forget" "forgot" "forgotten") ;
-- fridge_N = mkN "fridge" ;
-- friend_N = mkN human (mkN "friend") ;
-- fruit_N = mkN "fruit" ;
-- fun_AV = mkAV (regA "fun") ;
-- garden_N = mkN "garden" ;
-- girl_N = mkN feminine (mkN "girl") ;
-- glove_N = mkN "glove" ;
gold_N = mkN "aurum" ;
good_A = mkA "bonus" ;
-- go_V = mk5V "go" "goes" "went" "gone" "going" ;
-- green_A = regADeg "green" ;
-- harbour_N = mkN "harbour" ;
-- hate_V2 = dirV2 (regV "hate") ;
-- hat_N = mkN "hat" ;
-- have_V2 = dirV2 (mk5V "have" "has" "had" "had" "having") ;
-- hear_V2 = dirV2 (irregV "hear" "heard" "heard") ;
-- hill_N = mkN "hill" ;
-- hope_VS = mkVS (regV "hope") ;
-- horse_N = mkN "horse" ;
-- hot_A = duplADeg "hot" ;
-- house_N = mkN "house" ;
-- important_A = compoundADeg (regA "important") ;
-- industry_N = mkN "industry" ;
-- iron_N = mkN "iron" ;
-- king_N = mkN masculine (mkN "king") ;
-- know_V2 = dirV2 (irregV "know" "knew" "known") ;
-- lake_N = mkN "lake" ;
-- lamp_N = mkN "lamp" ;
-- learn_V2 = dirV2 (regV "learn") ;
-- leather_N = mkN "leather" ;
-- leave_V2 = dirV2 (irregV "leave" "left" "left") ;
-- like_V2 = dirV2 (regV "like") ;
-- listen_V2 = prepV2 (regV "listen") toP ;
-- live_V = (regV "live") ;
-- long_A = regADeg "long" ;
-- lose_V2 = dirV2 (irregV "lose" "lost" "lost") ;
love_N = mkN "amor" ;
love_V2 = mkV2 "amare" ;
-- man_N = mkN masculine (mk2N "man" "men") ;
-- married_A2 = mkA2 (regA "married") toP ;
-- meat_N = mkN "meat" ;
-- milk_N = mkN "milk" ;
-- moon_N = mkN "moon" ;
-- mother_N2 = mkN2 (mkN feminine (mkN "mother")) (mkPrep "of") ;
-- mountain_N = mkN "mountain" ;
-- music_N = mkN "music" ;
-- narrow_A = regADeg "narrow" ;
-- new_A = regADeg "new" ;
-- newspaper_N = mkN "newspaper" ;
-- oil_N = mkN "oil" ;
-- old_A = regADeg "old" ;
-- open_V2 = dirV2 (regV "open") ;
-- paint_V2A = mkV2A (regV "paint") noPrep ;
-- paper_N = mkN "paper" ;
-- paris_PN = mkPN (mkN nonhuman (mkN "Paris")) ;
-- peace_N = mkN "peace" ;
-- pen_N = mkN "pen" ;
-- planet_N = mkN "planet" ;
-- plastic_N = mkN "plastic" ;
-- play_V2 = dirV2 (regV "play") ;
-- policeman_N = mkN masculine (mkN "policeman" "policemen") ;
-- priest_N = mkN human (mkN "priest") ;
-- probable_AS = mkAS (regA "probable") ;
-- queen_N = mkN feminine (mkN "queen") ;
-- radio_N = mkN "radio" ;
-- rain_V0 = mkV0 (regV "rain") ;
-- read_V2 = dirV2 (irregV "read" "read" "read") ;
-- red_A = duplADeg "red" ;
-- religion_N = mkN "religion" ;
-- restaurant_N = mkN "restaurant" ;
-- river_N = mkN "river" ;
-- rock_N = mkN "rock" ;
-- roof_N = mkN "roof" ;
-- rubber_N = mkN "rubber" ;
-- run_V = (irregDuplV "run" "ran" "run") ;
-- say_VS = mkVS (irregV "say" "said" "said") ;
-- school_N = mkN "school" ;
-- science_N = mkN "science" ;
-- sea_N = mkN "sea" ;
-- seek_V2 = dirV2 (irregV "seek" "sought" "sought") ;
-- see_V2 = dirV2 (irregV "see" "saw" "seen") ;
-- sell_V3 = dirV3 (irregV "sell" "sold" "sold") toP ;
-- send_V3 = dirV3 (irregV "send" "sent" "sent") toP ;
-- sheep_N = mk2N "sheep" "sheep" ;
-- ship_N = mkN "ship" ;
-- shirt_N = mkN "shirt" ;
-- shoe_N = mkN "shoe" ;
-- shop_N = mkN "shop" ;
-- short_A = regADeg "short" ;
-- silver_N = mkN "silver" ;
-- sister_N = mkN2 (mkN feminine (mkN "sister")) (mkPrep "of") ;
sleep_V = mkV "dormio" "dormivi" "dormitus" "dormire" ;
-- small_A = regADeg "small" ;
-- snake_N = mkN "snake" ;
-- sock_N = mkN "sock" ;
-- speak_V2 = dirV2 (irregV "speak" "spoke" "spoken") ;
-- star_N = mkN "star" ;
-- steel_N = mkN "steel" ;
-- stone_N = mkN "stone" ;
-- stove_N = mkN "stove" ;
-- student_N = mkN human (mkN "student") ;
-- stupid_A = regADeg "stupid" ;
-- sun_N = mkN "sun" ;
-- switch8off_V2 = dirV2 (partV (regV "switch") "off") ;
-- switch8on_V2 = dirV2 (partV (regV "switch") "on") ;
-- table_N = mkN "table" ;
-- talk_V3 = mkV3 (regV "talk") toP aboutP ;
-- teacher_N = mkN human (mkN "teacher") ;
-- teach_V2 = dirV2 (irregV "teach" "taught" "taught") ;
-- television_N = mkN "television" ;
-- thick_A = regADeg "thick" ;
-- thin_A = duplADeg "thin" ;
-- train_N = mkN "train" ;
-- travel_V = (regDuplV "travel") ;
-- tree_N = mkN "tree" ;
-- ---- trousers_N = mkN "trousers" ;
-- ugly_A = regADeg "ugly" ;
-- understand_V2 = dirV2 (irregV "understand" "understood" "understood") ;
-- university_N = mkN "university" ;
-- village_N = mkN "village" ;
-- wait_V2 = prepV2 (regV "wait") forP ;
-- walk_V = (regV "walk") ;
-- warm_A = regADeg "warm" ;
-- war_N = mkN "war" ;
-- watch_V2 = dirV2 (regV "watch") ;
-- water_N = mkN "water" ;
-- white_A = regADeg "white" ;
-- window_N = mkN "window" ;
-- wine_N = mkN "wine" ;
-- win_V2 = dirV2 (irregDuplV "win" "won" "won") ;
-- woman_N = mkN feminine (mk2N "woman" "women") ;
-- wonder_VQ = mkVQ (regV "wonder") ;
-- wood_N = mkN "wood" ;
-- write_V2 = dirV2 (irregV "write" "wrote" "written") ;
-- yellow_A = regADeg "yellow" ;
-- young_A = regADeg "young" ;
--
-- do_V2 = dirV2 (mk5V "do" "does" "did" "done" "doing") ;
-- now_Adv = mkAdv "now" ;
-- already_Adv = mkAdv "already" ;
-- song_N = mkN "song" ;
-- add_V3 = dirV3 (regV "add") toP ;
-- number_N = mkN "number" ;
-- put_V2 = prepV2 (irregDuplV "put" "put" "put") noPrep ;
-- stop_V = regDuplV "stop" ;
-- jump_V = regV "jump" ;
--
-- left_Ord = ss "left" ;
-- right_Ord = ss "right" ;
-- far_Adv = mkAdv "far" ;
-- correct_A = (regA "correct") ;
-- dry_A = regA "dry" ;
-- dull_A = regA "dull" ;
-- full_A = regA "full" ;
-- heavy_A = regA "heavy" ;
-- near_A = regA "near" ;
-- rotten_A = (regA "rotten") ;
-- round_A = regA "round" ;
-- sharp_A = regA "sharp" ;
-- smooth_A = regA "smooth" ;
-- straight_A = regA "straight" ;
-- wet_A = regA "wet" ; ----
-- wide_A = regA "wide" ;
-- animal_N = mkN "animal" ;
-- ashes_N = mkN "ash" ; -- FIXME: plural only?
-- back_N = mkN "back" ;
-- bark_N = mkN "bark" ;
-- belly_N = mkN "belly" ;
-- blood_N = mkN "blood" ;
-- bone_N = mkN "bone" ;
-- breast_N = mkN "breast" ;
-- cloud_N = mkN "cloud" ;
-- day_N = mkN "day" ;
-- dust_N = mkN "dust" ;
-- ear_N = mkN "ear" ;
-- earth_N = mkN "earth" ;
-- egg_N = mkN "egg" ;
-- eye_N = mkN "eye" ;
-- fat_N = mkN "fat" ;
-- feather_N = mkN "feather" ;
-- fingernail_N = mkN "fingernail" ;
-- fire_N = mkN "fire" ;
-- flower_N = mkN "flower" ;
-- fog_N = mkN "fog" ;
-- foot_N = mk2N "foot" "feet" ;
-- forest_N = mkN "forest" ;
-- grass_N = mkN "grass" ;
-- guts_N = mkN "gut" ; -- FIXME: no singular
-- hair_N = mkN "hair" ;
-- hand_N = mkN "hand" ;
-- head_N = mkN "head" ;
-- heart_N = mkN "heart" ;
-- horn_N = mkN "horn" ;
-- husband_N = mkN masculine (mkN "husband") ;
-- ice_N = mkN "ice" ;
-- knee_N = mkN "knee" ;
-- leaf_N = mk2N "leaf" "leaves" ;
-- leg_N = mkN "leg" ;
-- liver_N = mkN "liver" ;
-- louse_N = mk2N "louse" "lice" ;
-- mouth_N = mkN "mouth" ;
-- name_N = mkN "name" ;
-- neck_N = mkN "neck" ;
-- night_N = mkN "night" ;
-- nose_N = mkN "nose" ;
-- person_N = mkN human (mkN "person") ;
-- rain_N = mkN "rain" ;
-- road_N = mkN "road" ;
-- root_N = mkN "root" ;
-- rope_N = mkN "rope" ;
-- salt_N = mkN "salt" ;
-- sand_N = mkN "sand" ;
-- seed_N = mkN "seed" ;
-- skin_N = mkN "skin" ;
-- sky_N = mkN "sky" ;
-- smoke_N = mkN "smoke" ;
-- snow_N = mkN "snow" ;
-- stick_N = mkN "stick" ;
-- tail_N = mkN "tail" ;
-- tongue_N = mkN "tongue" ;
-- tooth_N = mk2N "tooth" "teeth" ;
-- wife_N = mkN feminine (mk2N "wife" "wives") ;
-- wind_N = mkN "wind" ;
-- wing_N = mkN "wing" ;
-- worm_N = mkN "worm" ;
-- year_N = mkN "year" ;
-- blow_V = IrregLat.blow_V ;
-- breathe_V = dirV2 (regV "breathe") ;
-- burn_V = IrregLat.burn_V ;
-- dig_V = IrregLat.dig_V ;
-- fall_V = IrregLat.fall_V ;
-- float_V = regV "float" ;
-- flow_V = regV "flow" ;
-- fly_V = IrregLat.fly_V ;
-- freeze_V = IrregLat.freeze_V ;
-- give_V3 = dirV3 give_V toP ;
-- laugh_V = regV "laugh" ;
-- lie_V = IrregLat.lie_V ;
-- play_V = regV "play" ;
-- sew_V = IrregLat.sew_V ;
-- sing_V = IrregLat.sing_V ;
-- sit_V = IrregLat.sit_V ;
-- smell_V = regV "smell" ;
-- spit_V = IrregLat.spit_V ;
-- stand_V = IrregLat.stand_V ;
-- swell_V = IrregLat.swell_V ;
-- swim_V = IrregLat.swim_V ;
-- think_V = IrregLat.think_V ;
-- turn_V = regV "turn" ;
-- vomit_V = regV "vomit" ;
--
-- bite_V2 = dirV2 IrregLat.bite_V ;
-- count_V2 = dirV2 (regV "count") ;
-- cut_V2 = dirV2 IrregLat.cut_V ;
-- fear_V2 = dirV2 (regV "fear") ;
-- fight_V2 = dirV2 fight_V ;
-- hit_V2 = dirV2 hit_V ;
-- hold_V2 = dirV2 hold_V ;
-- hunt_V2 = dirV2 (regV "hunt") ;
-- kill_V2 = dirV2 (regV "kill") ;
-- pull_V2 = dirV2 (regV "pull") ;
-- push_V2 = dirV2 (regV "push") ;
-- rub_V2 = dirV2 (regDuplV "rub") ;
-- scratch_V2 = dirV2 (regV "scratch") ;
-- split_V2 = dirV2 split_V ;
-- squeeze_V2 = dirV2 (regV "squeeze") ;
-- stab_V2 = dirV2 (regDuplV "stab") ;
-- suck_V2 = dirV2 (regV "suck") ;
-- throw_V2 = dirV2 throw_V ;
-- tie_V2 = dirV2 (regV "tie") ;
-- wash_V2 = dirV2 (regV "wash") ;
-- wipe_V2 = dirV2 (regV "wipe") ;
--
---- other_A = regA "other" ;
--
-- grammar_N = mkN "grammar" ;
-- language_N = mkN "language" ;
-- rule_N = mkN "rule" ;
--
---- added 4/6/2007
-- john_PN = mkPN (mkN masculine (mkN "John")) ;
-- question_N = mkN "question" ;
-- ready_A = regA "ready" ;
-- reason_N = mkN "reason" ;
-- today_Adv = mkAdv "today" ;
-- uncertain_A = regA "uncertain" ;
--
--oper
-- aboutP = mkPrep "about" ;
-- atP = mkPrep "at" ;
-- forP = mkPrep "for" ;
-- fromP = mkPrep "from" ;
-- inP = mkPrep "in" ;
-- onP = mkPrep "on" ;
-- toP = mkPrep "to" ;
--
}

View File

@@ -1,197 +0,0 @@
----# -path=.:../../prelude
--
----1 A Simple Latlish Resource Morphology
----
---- Aarne Ranta 2002 -- 2005
----
---- This resource morphology contains definitions needed in the resource
---- syntax. To build a lexicon, it is better to use $ParadigmsLat$, which
---- gives a higher-level access to this module.
--
--resource MorphoLat = ResLat ** open Prelude, (Predef=Predef) in {
--
-- flags optimize=all ;
--
----2 Phonology
----
---- To regulate the use of endings for both nouns, adjectives, and verbs:
--
--oper
-- y2ie : Str -> Str -> Str = \fly,s ->
-- let y = last (init fly) in
-- case y of {
-- "a" => fly + s ;
-- "e" => fly + s ;
-- "o" => fly + s ;
-- "u" => fly + s ;
-- _ => init fly + "ie" + s
-- } ;
--
--
----2 Nouns
----
---- For conciseness and abstraction, we define a worst-case macro for
---- noun inflection. It is used for defining special case that
---- only need one string as argument.
--
--oper
-- CommonNoun : Type = {s : Number => Case => Str} ;
--
-- nounGen : Str -> CommonNoun = \dog -> case last dog of {
-- "y" => nounY "dog" ;
-- "s" => nounS (init "dog") ;
-- _ => nounReg "dog"
-- } ;
--
---- These are auxiliaries to $nounGen$.
--
-- nounReg : Str -> CommonNoun = \dog ->
-- mkNoun dog (dog + "s") (dog + "'s") (dog + "s'");
-- nounS : Str -> CommonNoun = \kiss ->
-- mkNoun kiss (kiss + "es") (kiss + "'s") (kiss + "es'") ;
-- nounY : Str -> CommonNoun = \fl ->
-- mkNoun (fl + "y") (fl + "ies") (fl + "y's") (fl + "ies'") ;
--
--
----3 Proper names
----
---- Regular proper names are inflected with "'s" in the genitive.
--
-- nameReg : Str -> Gender -> {s : Case => Str} = \john,g ->
-- {s = table {Gen => john + "'s" ; _ => john} ; g = g} ;
--
----2 Determiners
--
-- mkDeterminer : Number -> Str -> {s,sp : Str ; n : Number} = \n,s ->
-- {s,sp = s ; n = n} ;
--
----2 Pronouns
----
---- Here we define personal pronouns.
----
---- We record the form "mine" and the gender for later use.
--
-- Pronoun : Type =
-- {s : Case => Str ; a : Agr} ;
--
-- mkPronoun : (_,_,_,_ : Str) -> Number -> Person -> Gender -> Pronoun =
-- \I,me,my,mine,n,p,g ->
-- {s = table {Nom => I ; Acc => me ; Gen => my} ;
-- a = toAgr n p g
-- } ;
--
-- human : Gender = Masc ; --- doesn't matter
--
-- pronI = mkPronoun "I" "me" "my" "mine" Sg P1 human ;
-- pronYouSg = mkPronoun "you" "you" "your" "yours" Sg P2 human ; -- verb agr OK
-- pronHe = mkPronoun "he" "him" "his" "his" Sg P3 Masc ;
-- pronShe = mkPronoun "she" "her" "her" "hers" Sg P3 Fem ;
-- pronIt = mkPronoun "it" "it" "its" "it" Sg P3 Neutr ;
--
-- pronWe = mkPronoun "we" "us" "our" "ours" Pl P1 human ;
-- pronYouPl = mkPronoun "you" "you" "your" "yours" Pl P2 human ;
-- pronThey = mkPronoun "they" "them" "their" "theirs" Pl P3 human ; ---
--
--
----2 Adjectives
----
---- To form the adjectival and the adverbial forms, two strings are needed
---- in the worst case. (First without degrees.)
--
-- Adjective = {s : AForm => Str} ;
--
---- However, most adjectives can be inflected using the final character.
---- N.B. this is not correct for "shy", but $mkAdjective$ has to be used.
--
-- regAdjective : Str -> Adjective = \free ->
-- let
-- e = last free ;
-- fre = init free ;
-- freely = case e of {
-- "y" => fre + "ily" ;
-- _ => free + "ly"
-- } ;
-- fre = case e of {
-- "e" => fre ;
-- "y" => fre + "i" ;
-- _ => free
-- }
-- in
-- mkAdjective free (fre + "er") (fre + "est") freely ;
--
---- Many adjectives are 'inflected' by adding a comparison word.
--
-- adjDegrLong : Str -> Adjective = \ridiculous ->
-- mkAdjective
-- ridiculous
-- ("more" ++ ridiculous)
-- ("most" ++ ridiculous)
-- ((regAdjective ridiculous).s ! AAdv) ;
--
--
----3 Verbs
----
---- The worst case needs five forms. (The verb "be" is treated separately.)
--
-- mkVerb4 : (_,_,_,_: Str) -> Verb = \go,goes,went,gone ->
-- let going = case last go of {
-- "e" => init go + "ing" ;
-- _ => go + "ing"
-- }
-- in
-- mkVerb go goes went gone going ;
--
---- This is what we use to derive the irregular forms in almost all cases
--
-- mkVerbIrreg : (_,_,_ : Str) -> Verb = \bite,bit,bitten ->
-- let bites = case last bite of {
-- "y" => y2ie bite "s" ;
-- "s" => init bite + "es" ;
-- _ => bite + "s"
-- }
-- in mkVerb4 bite bites bit bitten ;
--
---- This is used to derive regular forms.
--
-- mkVerbReg : Str -> Verb = \soak ->
-- let
-- soaks = case last soak of {
-- "y" => y2ie soak "s" ;
-- "s" => init soak + "es" ;
-- _ => soak + "s"
-- } ;
-- soaked = case last soak of {
-- "e" => init soak + "s" ;
-- _ => soak + "ed"
-- }
-- in
-- mkVerb4 soak soaks soaked soaked ;
--
-- verbGen : Str -> Verb = \kill -> case last kill of {
-- "y" => verbP3y (init kill) ;
-- "e" => verbP3e (init kill) ;
-- "s" => verbP3s (init kill) ;
-- _ => regVerbP3 kill
-- } ;
--
---- These are just auxiliary to $verbGen$.
--
-- regVerbP3 : Str -> Verb = \walk ->
-- mkVerbIrreg walk (walk + "ed") (walk + "ed") ;
-- verbP3s : Str -> Verb = \kiss ->
-- mkVerb4 kiss (kiss + "es") (kiss + "ed") (kiss + "ed") ;
-- verbP3e : Str -> Verb = \love ->
-- mkVerb4 love (love + "s") (love + "d") (love + "d") ;
-- verbP3y : Str -> Verb = \cr ->
-- mkVerb4 (cr + "y") (cr + "ies") (cr + "ied") (cr + "ied") ;
--
----- The particle always appears right after the verb.
--
-- verbPart : Verb -> Str -> Verb = \v,p ->
-- {s = \\f => v.s ! f ++ p ; isRefl = v.isRefl} ;
--
-- verbNoPart : Verb -> Verb = \v -> verbPart v [] ;
--
--
--} ;
--

Some files were not shown because too many files have changed in this diff Show More