1
0
forked from GitHub/gf-core

readme and Makefile updated, test added

This commit is contained in:
aarne
2006-02-03 09:51:11 +00:00
parent d7fe2dd877
commit 95cc7878ce
28 changed files with 469 additions and 26 deletions

View File

@@ -1,5 +1,9 @@
all: langs test
test:
gf -src */Lang*.gf
echo "gr -cat=S -tr -number=11 | l -multi gf" | gf langs.gfcm
langs:
echo "s ;; pm | wf langs.gfcm" | gf -src */Lang??*.gf english/LangEng.gf
stat:
wc */*.gfc

View File

@@ -14,6 +14,15 @@ will be kept available, but 'resource' will be renamed 'resource-0.9',
and 'resource' will probably be made into a symbolic link to the
current version.
To test:
make
For translation from Eng to all others, try e.g.
gf langs.gfcm
> p -cat=Phr -mcfg "I haven't seen her" | l -multi
The main changes from 0.9 to 1.0 are
1. Refactoring of module structure: there are many more modules now.

View File

@@ -7,7 +7,7 @@
<P ALIGN="center"><CENTER><H1> Adjectives and adjectival phrases</H1>
<FONT SIZE="4">
<I>Author: </I><BR>
Last update: Thu Feb 2 16:24:06 2006
Last update: Fri Feb 3 10:28:10 2006
</FONT></CENTER>
<P></P>

View File

@@ -7,7 +7,7 @@
<P ALIGN="center"><CENTER><H1> Adverbs and adverbial phrases</H1>
<FONT SIZE="4">
<I>Author: </I><BR>
Last update: Thu Feb 2 16:24:06 2006
Last update: Fri Feb 3 10:28:10 2006
</FONT></CENTER>
<P></P>

View File

@@ -7,7 +7,7 @@
<P ALIGN="center"><CENTER><H1> The category system</H1>
<FONT SIZE="4">
<I>Author: </I><BR>
Last update: Thu Feb 2 16:24:07 2006
Last update: Fri Feb 3 10:28:10 2006
</FONT></CENTER>
<P></P>

View File

@@ -7,7 +7,7 @@
<P ALIGN="center"><CENTER><H1> Coordination</H1>
<FONT SIZE="4">
<I>Author: </I><BR>
Last update: Thu Feb 2 16:24:07 2006
Last update: Fri Feb 3 10:28:10 2006
</FONT></CENTER>
<P></P>

View File

@@ -14,7 +14,7 @@
<P></P>
<P>
Author:
Last update: Thu Feb 2 16:24:10 2006
Last update: Fri Feb 3 10:28:14 2006
</P>
<P>
Produced by

View File

@@ -7,7 +7,7 @@
<P ALIGN="center"><CENTER><H1> The Main Module of the Resource Grammar</H1>
<FONT SIZE="4">
<I>Author: </I><BR>
Last update: Thu Feb 2 16:24:07 2006
Last update: Fri Feb 3 10:28:10 2006
</FONT></CENTER>
<P></P>

View File

@@ -7,7 +7,7 @@
<P ALIGN="center"><CENTER><H1> The Mathematics API to the Resource Grammar</H1>
<FONT SIZE="4">
<I>Author: </I><BR>
Last update: Thu Feb 2 16:24:10 2006
Last update: Fri Feb 3 10:28:13 2006
</FONT></CENTER>
<P></P>

View File

@@ -14,7 +14,7 @@
<P></P>
<P>
Author:
Last update: Thu Feb 2 16:24:10 2006
Last update: Fri Feb 3 10:28:14 2006
</P>
<P>
Produced by

View File

@@ -7,7 +7,7 @@
<P ALIGN="center"><CENTER><H1> The construction of nouns, noun phrases, and determiners</H1>
<FONT SIZE="4">
<I>Author: </I><BR>
Last update: Thu Feb 2 16:24:07 2006
Last update: Fri Feb 3 10:28:11 2006
</FONT></CENTER>
<P></P>

View File

@@ -7,7 +7,7 @@
<P ALIGN="center"><CENTER><H1> Numerals</H1>
<FONT SIZE="4">
<I>Author: </I><BR>
Last update: Thu Feb 2 16:24:07 2006
Last update: Fri Feb 3 10:28:11 2006
</FONT></CENTER>
<P></P>

View File

@@ -43,7 +43,7 @@
<P></P>
<P>
Author:
Last update: Thu Feb 2 16:24:09 2006
Last update: Fri Feb 3 10:28:12 2006
</P>
<P>
Produced by

View File

@@ -41,7 +41,7 @@
<P></P>
<P>
Author:
Last update: Thu Feb 2 16:24:09 2006
Last update: Fri Feb 3 10:28:12 2006
</P>
<P>
Produced by

View File

@@ -35,7 +35,7 @@
<P></P>
<P>
Author:
Last update: Thu Feb 2 16:24:09 2006
Last update: Fri Feb 3 10:28:13 2006
</P>
<P>
Produced by

View File

@@ -41,7 +41,7 @@
<P></P>
<P>
Author:
Last update: Thu Feb 2 16:24:09 2006
Last update: Fri Feb 3 10:28:13 2006
</P>
<P>
Produced by

View File

@@ -43,7 +43,7 @@
<P></P>
<P>
Author:
Last update: Thu Feb 2 16:24:09 2006
Last update: Fri Feb 3 10:28:13 2006
</P>
<P>
Produced by

View File

@@ -0,0 +1,430 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
</HEAD><BODY BGCOLOR="white" TEXT="black">
<FONT SIZE="4">
</FONT></CENTER>
<P></P>
<HR NOSHADE SIZE=1>
<P></P>
<UL>
<LI><A HREF="#toc1">Spanish Lexical Paradigms</A>
<UL>
<LI><A HREF="#toc2">Parameters</A>
<LI><A HREF="#toc3">Nouns</A>
<UL>
<LI><A HREF="#toc4">Compound nouns</A>
<LI><A HREF="#toc5">Relational nouns</A>
<LI><A HREF="#toc6">Relational common noun phrases</A>
<LI><A HREF="#toc7">Proper names and noun phrases</A>
</UL>
<LI><A HREF="#toc8">Adjectives</A>
<UL>
<LI><A HREF="#toc9">Two-place adjectives</A>
<LI><A HREF="#toc10">Comparison adjectives</A>
</UL>
<LI><A HREF="#toc11">Adverbs</A>
<LI><A HREF="#toc12">Verbs</A>
<UL>
<LI><A HREF="#toc13">Two-place verbs</A>
<LI><A HREF="#toc14">Three-place verbs</A>
<LI><A HREF="#toc15">Other complement patterns</A>
</UL>
<LI><A HREF="#toc16">The definitions of the paradigms</A>
</UL>
</UL>
<P></P>
<HR NOSHADE SIZE=1>
<P></P>
<P>
Author:
Last update: Fri Feb 3 10:28:13 2006
</P>
<P>
Produced by
gfdoc - a rudimentary GF document generator.
(c) Aarne Ranta (<A HREF="mailto:aarne@cs.chalmers.se">aarne@cs.chalmers.se</A>) 2002 under GNU GPL.
</P>
<P>
==
</P>
<P>
# -path=.:../romance:../common:../abstract:../../prelude
</P>
<A NAME="toc1"></A>
<H1>Spanish Lexical Paradigms</H1>
<P>
Aarne Ranta 2003
</P>
<P>
This is an API to the user of the resource grammar
for adding lexical items. It gives functions for forming
expressions of open categories: nouns, adjectives, verbs.
</P>
<P>
Closed categories (determiners, pronouns, conjunctions) are
accessed through the resource syntax API, <CODE>Structural.gf</CODE>.
</P>
<P>
The main difference with <CODE>MorphoSpa.gf</CODE> is that the types
referred to are compiled resource grammar types. We have moreover
had the design principle of always having existing forms, rather
than stems, as string arguments of the paradigms.
</P>
<P>
The structure of functions for each word class <CODE>C</CODE> is the following:
first we give a handful of patterns that aim to cover all
regular cases. Then we give a worst-case function <CODE>mkC</CODE>, which serves as an
escape to construct the most irregular words of type <CODE>C</CODE>.
</P>
<PRE>
resource ParadigmsSpa =
open
(Predef=Predef),
Prelude,
CommonRomance,
ResSpa,
MorphoSpa,
BeschSpa,
CatSpa in {
flags optimize=all ;
</PRE>
<P></P>
<A NAME="toc2"></A>
<H2>Parameters</H2>
<P>
To abstract over gender names, we define the following identifiers.
</P>
<PRE>
oper
Gender : Type ;
masculine : Gender ;
feminine : Gender ;
</PRE>
<P></P>
<P>
To abstract over number names, we define the following.
</P>
<PRE>
Number : Type ;
singular : Number ;
plural : Number ;
</PRE>
<P></P>
<P>
Prepositions used in many-argument functions are either strings
(including the 'accusative' empty string) or strings that
amalgamate with the following word (the 'genitive' <I>de</I> and the
'dative' <I>à</I>).
</P>
<PRE>
Preposition : Type ;
accusative : Preposition ;
genitive : Preposition ;
dative : Preposition ;
mkPreposition : Str -&gt; Preposition ;
</PRE>
<P></P>
<A NAME="toc3"></A>
<H2>Nouns</H2>
<P>
Worst case: two forms (singular + plural),
and the gender.
</P>
<PRE>
mkN : (_,_ : Str) -&gt; Gender -&gt; N ; -- uomo, uomini, masculine
</PRE>
<P></P>
<P>
The regular function takes the singular form and the gender,
and computes the plural and the gender by a heuristic.
The heuristic says that the gender is feminine for nouns
ending with <I>a</I> or <I>z</I>, and masculine for all other words.
Nouns ending with <I>a</I>, <I>o</I>, <I>e</I> have the plural with <I>s</I>,
those ending with <I>z</I> have <I>ces</I> in plural; all other nouns
have <I>es</I> as plural ending. The accent is not dealt with.
</P>
<PRE>
regN : Str -&gt; N ;
</PRE>
<P></P>
<P>
To force a different gender, use one of the following functions.
</P>
<PRE>
mascN : N -&gt; N ;
femN : N -&gt; N ;
</PRE>
<P></P>
<A NAME="toc4"></A>
<H3>Compound nouns</H3>
<P>
Some nouns are ones where the first part is inflected as a noun but
the second part is not inflected. e.g. <I>numéro de téléphone</I>.
They could be formed in syntax, but we give a shortcut here since
they are frequent in lexica.
</P>
<PRE>
compN : N -&gt; Str -&gt; N ;
</PRE>
<P></P>
<A NAME="toc5"></A>
<H3>Relational nouns</H3>
<P>
Relational nouns (<I>fille de x</I>) need a case and a preposition.
</P>
<PRE>
mkN2 : N -&gt; Preposition -&gt; N2 ;
</PRE>
<P></P>
<P>
The most common cases are the genitive <I>de</I> and the dative <I>a</I>,
with the empty preposition.
</P>
<PRE>
deN2 : N -&gt; N2 ;
aN2 : N -&gt; N2 ;
</PRE>
<P></P>
<P>
Three-place relational nouns (<I>la connessione di x a y</I>) need two prepositions.
</P>
<PRE>
mkN3 : N -&gt; Preposition -&gt; Preposition -&gt; N3 ;
</PRE>
<P></P>
<A NAME="toc6"></A>
<H3>Relational common noun phrases</H3>
<P>
In some cases, you may want to make a complex <CODE>CN</CODE> into a
relational noun (e.g. <I>the old town hall of</I>). However, <CODE>N2</CODE> and
<CODE>N3</CODE> are purely lexical categories. But you can use the <CODE>AdvCN</CODE>
and <CODE>PrepNP</CODE> constructions to build phrases like this.
</P>
<A NAME="toc7"></A>
<H3>Proper names and noun phrases</H3>
<P>
Proper names need a string and a gender.
</P>
<PRE>
mkPN : Str -&gt; Gender -&gt; PN ; -- Jean
</PRE>
<P></P>
<P>
To form a noun phrase that can also be plural,
you can use the worst-case function.
</P>
<PRE>
mkNP : Str -&gt; Gender -&gt; Number -&gt; NP ;
</PRE>
<P></P>
<A NAME="toc8"></A>
<H2>Adjectives</H2>
<P>
Non-comparison one-place adjectives need five forms in the worst
case (masc and fem singular, masc plural, adverbial).
</P>
<PRE>
mkA : (solo,sola,soli,sole, solamente : Str) -&gt; A ;
</PRE>
<P></P>
<P>
For regular adjectives, all other forms are derived from the
masculine singular. The types of adjectives that are recognized are
<I>alto</I>, <I>fuerte</I>, <I>util</I>.
</P>
<PRE>
regA : Str -&gt; A ;
</PRE>
<P></P>
<P>
These functions create postfix adjectives. To switch
them to prefix ones (i.e. ones placed before the noun in
modification, as in <I>petite maison</I>), the following function is
provided.
</P>
<PRE>
prefA : A -&gt; A ;
</PRE>
<P></P>
<A NAME="toc9"></A>
<H3>Two-place adjectives</H3>
<P>
Two-place adjectives need a preposition for their second argument.
</P>
<PRE>
mkA2 : A -&gt; Preposition -&gt; A2 ;
</PRE>
<P></P>
<A NAME="toc10"></A>
<H3>Comparison adjectives</H3>
<P>
Comparison adjectives are in the worst case put up from two
adjectives: the positive (<I>bueno</I>), and the comparative (<I>mejor</I>).
</P>
<PRE>
mkADeg : A -&gt; A -&gt; A ;
</PRE>
<P></P>
<P>
If comparison is formed by <I>mas</I>, as usual in Spanish,
the following pattern is used:
</P>
<PRE>
compADeg : A -&gt; A ;
</PRE>
<P></P>
<P>
The regular pattern is the same as <CODE>regA</CODE> for plain adjectives,
with comparison by <I>mas</I>.
</P>
<PRE>
regADeg : Str -&gt; A ;
</PRE>
<P></P>
<A NAME="toc11"></A>
<H2>Adverbs</H2>
<P>
Adverbs are not inflected. Most lexical ones have position
after the verb.
</P>
<PRE>
mkAdv : Str -&gt; Adv ;
</PRE>
<P></P>
<P>
Some appear next to the verb (e.g. <I>siempre</I>).
</P>
<PRE>
mkAdV : Str -&gt; AdV ;
</PRE>
<P></P>
<P>
Adverbs modifying adjectives and sentences can also be formed.
</P>
<PRE>
mkAdA : Str -&gt; AdA ;
</PRE>
<P></P>
<A NAME="toc12"></A>
<H2>Verbs</H2>
<P>
Regular verbs are ones inflected like <I>cortar</I>, <I>deber</I>, or <I>vivir</I>.
The regular verb function is the first conjugation (<I>ar</I>) recognizes
the variations corresponding to the patterns
<I>actuar, cazar, guiar, pagar, sacar</I>. The module <CODE>BeschSpa</CODE> gives
the complete set of <I>Bescherelle</I> conjugations.
</P>
<PRE>
regV : Str -&gt; V ;
</PRE>
<P></P>
<P>
The module <CODE>BeschSpa</CODE> gives all the patterns of the <I>Bescherelle</I>
book. To use them in the category <CODE>V</CODE>, wrap them with the function
</P>
<PRE>
verboV : Verbum -&gt; V ;
</PRE>
<P></P>
<P>
To form reflexive verbs:
</P>
<PRE>
reflV : V -&gt; V ;
</PRE>
<P></P>
<P>
Verbs with a deviant passive participle: just give the participle
in masculine singular form as second argument.
</P>
<PRE>
special_ppV : V -&gt; Str -&gt; V ;
</PRE>
<P></P>
<A NAME="toc13"></A>
<H3>Two-place verbs</H3>
<P>
Two-place verbs need a preposition, except the special case with direct object.
(transitive verbs). Notice that a particle comes from the <CODE>V</CODE>.
</P>
<PRE>
mkV2 : V -&gt; Preposition -&gt; V2 ;
dirV2 : V -&gt; V2 ;
</PRE>
<P></P>
<P>
You can reuse a <CODE>V2</CODE> verb in <CODE>V</CODE>.
</P>
<PRE>
v2V : V2 -&gt; V ;
</PRE>
<P></P>
<A NAME="toc14"></A>
<H3>Three-place verbs</H3>
<P>
Three-place (ditransitive) verbs need two prepositions, of which
the first one or both can be absent.
</P>
<PRE>
mkV3 : V -&gt; Preposition -&gt; Preposition -&gt; V3 ; -- parler, à, de
dirV3 : V -&gt; Preposition -&gt; V3 ; -- donner,_,à
dirdirV3 : V -&gt; V3 ; -- donner,_,_
</PRE>
<P></P>
<A NAME="toc15"></A>
<H3>Other complement patterns</H3>
<P>
Verbs and adjectives can take complements such as sentences,
questions, verb phrases, and adjectives.
</P>
<PRE>
mkV0 : V -&gt; V0 ;
mkVS : V -&gt; VS ;
mkV2S : V -&gt; Preposition -&gt; V2S ;
mkVV : V -&gt; VV ; -- plain infinitive: "je veux parler"
deVV : V -&gt; VV ; -- "j'essaie de parler"
aVV : V -&gt; VV ; -- "j'arrive à parler"
mkV2V : V -&gt; Preposition -&gt; Preposition -&gt; V2V ;
mkVA : V -&gt; VA ;
mkV2A : V -&gt; Preposition -&gt; V2A ;
mkVQ : V -&gt; VQ ;
mkV2Q : V -&gt; Preposition -&gt; V2Q ;
mkAS : A -&gt; AS ;
subjAS : A -&gt; AS ;
mkA2S : A -&gt; Preposition -&gt; A2S ;
mkAV : A -&gt; Preposition -&gt; AV ;
mkA2V : A -&gt; Preposition -&gt; Preposition -&gt; A2V ;
</PRE>
<P></P>
<P>
Notice: categories <CODE>V2S, V2V, V2A, V2Q</CODE> are in v 1.0 treated
just as synonyms of <CODE>V2</CODE>, and the second argument is given
as an adverb. Likewise <CODE>AS, A2S, AV, A2V</CODE> are just <CODE>A</CODE>.
<CODE>V0</CODE> is just <CODE>V</CODE>.
</P>
<PRE>
V0, V2S, V2V, V2A, V2Q : Type ;
AS, A2S, AV, A2V : Type ;
</PRE>
<P></P>
<A NAME="toc16"></A>
<H2>The definitions of the paradigms</H2>
<P>
The definitions should not bother the user of the API. So they are
hidden from the document.
</P>
<!-- html code generated by txt2tags 2.0 (http://txt2tags.sf.net) -->
<!-- cmdline: txt2tags -thtml -\-toc spanish/ParadigmsSpa.txt -->
</BODY></HTML>

View File

@@ -43,7 +43,7 @@
<P></P>
<P>
Author:
Last update: Thu Feb 2 16:24:10 2006
Last update: Fri Feb 3 10:28:13 2006
</P>
<P>
Produced by

View File

@@ -7,7 +7,7 @@
<P ALIGN="center"><CENTER><H1> Phrases and utterances</H1>
<FONT SIZE="4">
<I>Author: </I><BR>
Last update: Thu Feb 2 16:24:08 2006
Last update: Fri Feb 3 10:28:11 2006
</FONT></CENTER>
<P></P>

View File

@@ -7,7 +7,7 @@
<P ALIGN="center"><CENTER><H1> A Small Predication Library</H1>
<FONT SIZE="4">
<I>Author: </I><BR>
Last update: Thu Feb 2 16:24:10 2006
Last update: Fri Feb 3 10:28:14 2006
</FONT></CENTER>
<P></P>

View File

@@ -7,7 +7,7 @@
<P ALIGN="center"><CENTER><H1> Questions and interrogative pronouns</H1>
<FONT SIZE="4">
<I>Author: </I><BR>
Last update: Thu Feb 2 16:24:08 2006
Last update: Fri Feb 3 10:28:11 2006
</FONT></CENTER>
<P></P>

View File

@@ -7,7 +7,7 @@
<P ALIGN="center"><CENTER><H1> Relative clauses and pronouns</H1>
<FONT SIZE="4">
<I>Author: </I><BR>
Last update: Thu Feb 2 16:24:08 2006
Last update: Fri Feb 3 10:28:11 2006
</FONT></CENTER>
<P></P>

View File

@@ -7,7 +7,7 @@
<P ALIGN="center"><CENTER><H1> Sentences, clauses, imperatives, and sentential complements</H1>
<FONT SIZE="4">
<I>Author: </I><BR>
Last update: Thu Feb 2 16:24:08 2006
Last update: Fri Feb 3 10:28:12 2006
</FONT></CENTER>
<P></P>

View File

@@ -7,7 +7,7 @@
<P ALIGN="center"><CENTER><H1> GF Resource Grammar API for Structural Words</H1>
<FONT SIZE="4">
<I>Author: </I><BR>
Last update: Thu Feb 2 16:24:08 2006
Last update: Fri Feb 3 10:28:12 2006
</FONT></CENTER>
<P></P>

View File

@@ -7,7 +7,7 @@
<P ALIGN="center"><CENTER><H1> Symbolic expressions</H1>
<FONT SIZE="4">
<I>Author: </I><BR>
Last update: Thu Feb 2 16:24:10 2006
Last update: Fri Feb 3 10:28:14 2006
</FONT></CENTER>
<P></P>

View File

@@ -7,7 +7,7 @@
<P ALIGN="center"><CENTER><H1> Tense, Polarity, and Anteriority</H1>
<FONT SIZE="4">
<I>Author: </I><BR>
Last update: Thu Feb 2 16:24:08 2006
Last update: Fri Feb 3 10:28:12 2006
</FONT></CENTER>
<P></P>

View File

@@ -7,7 +7,7 @@
<P ALIGN="center"><CENTER><H1> The construction of verb phrases</H1>
<FONT SIZE="4">
<I>Author: </I><BR>
Last update: Thu Feb 2 16:24:09 2006
Last update: Fri Feb 3 10:28:12 2006
</FONT></CENTER>
<P></P>