next-lib renamed to lib, lib to old-lib
165
lib/LICENSE
@@ -1,165 +0,0 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
@@ -1,19 +0,0 @@
|
||||
CC = gcc
|
||||
CFLAGS += -O2 -W -Wall
|
||||
|
||||
.PHONY: all clean
|
||||
|
||||
all: libgfcc.a
|
||||
|
||||
libgfcc.a: gfcc-tree.o gfcc-term.o
|
||||
ar r $@ $^
|
||||
|
||||
gfcc-tree.o: gfcc-tree.c gfcc-tree.h
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
gfcc-term.o: gfcc-term.c gfcc-term.h
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
clean:
|
||||
-rm -f libgfcc.a
|
||||
-rm -f *.o
|
||||
@@ -1,203 +0,0 @@
|
||||
#include "gfcc-term.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
static void *buffer = NULL;
|
||||
static size_t current;
|
||||
|
||||
extern void term_alloc_pool(size_t size) {
|
||||
if (buffer == NULL)
|
||||
buffer = malloc(size);
|
||||
current = 0;
|
||||
}
|
||||
|
||||
extern void term_free_pool() {
|
||||
if (buffer != NULL)
|
||||
free(buffer);
|
||||
buffer = NULL;
|
||||
}
|
||||
|
||||
extern void *term_alloc(size_t size) {
|
||||
void *off = buffer + current;
|
||||
current += size;
|
||||
return off;
|
||||
}
|
||||
|
||||
static inline Term *create_term(TermType type, int n) {
|
||||
Term *t = (Term*)term_alloc(sizeof(Term) + n * sizeof(Term *));
|
||||
t->type = type;
|
||||
t->value.size = n; /* FIXME: hack! */
|
||||
return t;
|
||||
}
|
||||
|
||||
extern Term *term_array(int n, ...) {
|
||||
Term *t = create_term(TERM_ARRAY, n);
|
||||
va_list ap;
|
||||
int i;
|
||||
|
||||
va_start(ap, n);
|
||||
for (i = 0; i < n; i++) {
|
||||
term_set_child(t, i, va_arg(ap, Term *));
|
||||
}
|
||||
va_end(ap);
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
extern Term *term_seq(int n, ...) {
|
||||
Term *t = create_term(TERM_SEQUENCE, n);
|
||||
va_list ap;
|
||||
int i;
|
||||
|
||||
va_start(ap, n);
|
||||
for (i = 0; i < n; i++) {
|
||||
term_set_child(t, i, va_arg(ap, Term *));
|
||||
}
|
||||
va_end(ap);
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
extern Term *term_variants(int n, ...) {
|
||||
Term *t = create_term(TERM_VARIANTS, n);
|
||||
va_list ap;
|
||||
int i;
|
||||
|
||||
va_start(ap, n);
|
||||
for (i = 0; i < n; i++) {
|
||||
term_set_child(t, i, va_arg(ap, Term *));
|
||||
}
|
||||
va_end(ap);
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
extern Term *term_glue(int n, ...) {
|
||||
Term *t = create_term(TERM_GLUE, n);
|
||||
va_list ap;
|
||||
int i;
|
||||
|
||||
va_start(ap, n);
|
||||
for (i = 0; i < n; i++) {
|
||||
term_set_child(t, i, va_arg(ap, Term *));
|
||||
}
|
||||
va_end(ap);
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
extern Term *term_rp(Term *t1, Term *t2) {
|
||||
Term *t = create_term(TERM_RECORD_PARAM, 2);
|
||||
term_set_child(t, 0, t1);
|
||||
term_set_child(t, 1, t2);
|
||||
return t;
|
||||
}
|
||||
|
||||
extern Term *term_suffix(const char *pref, Term *suf) {
|
||||
Term *t = create_term(TERM_SUFFIX_TABLE, 2);
|
||||
term_set_child(t,0,term_str(pref));
|
||||
term_set_child(t,1,suf);
|
||||
return t;
|
||||
}
|
||||
|
||||
extern Term *term_str(const char *s) {
|
||||
Term *t = create_term(TERM_STRING, 0);
|
||||
t->value.string_value = s;
|
||||
return t;
|
||||
}
|
||||
|
||||
extern Term *term_int(int i) {
|
||||
Term *t = create_term(TERM_INTEGER,0);
|
||||
t->value.integer_value = i;
|
||||
return t;
|
||||
}
|
||||
|
||||
extern Term *term_meta() {
|
||||
return create_term(TERM_META, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
extern Term *term_sel_int(Term *t, int i) {
|
||||
switch (t->type) {
|
||||
case TERM_ARRAY:
|
||||
return term_get_child(t,i);
|
||||
case TERM_SUFFIX_TABLE:
|
||||
return term_glue(2,
|
||||
term_get_child(t,0),
|
||||
term_sel_int(term_get_child(t,1),i));
|
||||
case TERM_META:
|
||||
return t;
|
||||
default:
|
||||
fprintf(stderr,"Error: term_sel_int %d %d\n", t->type, i);
|
||||
exit(1);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
extern Term *term_sel(Term *t1, Term *t2) {
|
||||
switch (t2->type) {
|
||||
case TERM_INTEGER:
|
||||
return term_sel_int(t1, t2->value.integer_value);
|
||||
case TERM_RECORD_PARAM:
|
||||
return term_sel(t1,term_get_child(t2,0));
|
||||
case TERM_META:
|
||||
return term_sel_int(t1,0);
|
||||
default:
|
||||
fprintf(stderr,"Error: term_sel %d %d\n", t1->type, t2->type);
|
||||
exit(1);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void term_print_sep(FILE *stream, Term *t, const char *sep) {
|
||||
int n = t->value.size;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
term_print(stream, term_get_child(t,i));
|
||||
if (i < n-1) {
|
||||
fputs(sep, stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern void term_print(FILE *stream, Term *t) {
|
||||
switch (t->type) {
|
||||
case TERM_ARRAY:
|
||||
term_print(stream, term_get_child(t,0));
|
||||
break;
|
||||
case TERM_SEQUENCE:
|
||||
term_print_sep(stream, t, " ");
|
||||
break;
|
||||
case TERM_VARIANTS:
|
||||
term_print_sep(stream, t, "/");
|
||||
break;
|
||||
case TERM_GLUE:
|
||||
term_print_sep(stream, t, "");
|
||||
break;
|
||||
case TERM_RECORD_PARAM:
|
||||
term_print(stream, term_get_child(t,0));
|
||||
break;
|
||||
case TERM_SUFFIX_TABLE:
|
||||
term_print(stream, term_get_child(t,0));
|
||||
term_print(stream, term_get_child(t,1));
|
||||
break;
|
||||
case TERM_META:
|
||||
fputs("?", stream);
|
||||
break;
|
||||
case TERM_STRING:
|
||||
fputs(t->value.string_value, stream);
|
||||
break;
|
||||
case TERM_INTEGER:
|
||||
fprintf(stream, "%d", t->value.integer_value);
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr,"Error: term_print %d\n", t->type);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
#ifndef GFCC_TERM_H
|
||||
#define GFCC_TERM_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
typedef enum {
|
||||
/* size = variable */
|
||||
TERM_ARRAY,
|
||||
TERM_SEQUENCE,
|
||||
TERM_VARIANTS,
|
||||
TERM_GLUE,
|
||||
/* size = 2 */
|
||||
TERM_RECORD_PARAM,
|
||||
TERM_SUFFIX_TABLE,
|
||||
/* size = 0 */
|
||||
TERM_META,
|
||||
TERM_STRING,
|
||||
TERM_INTEGER
|
||||
} TermType;
|
||||
|
||||
struct Term_ {
|
||||
TermType type;
|
||||
union {
|
||||
const char *string_value;
|
||||
int integer_value;
|
||||
int size;
|
||||
} value;
|
||||
struct Term_ *args[0];
|
||||
};
|
||||
|
||||
typedef struct Term_ Term;
|
||||
|
||||
|
||||
|
||||
static inline Term *term_get_child(Term *t, int n) {
|
||||
return t->args[n];
|
||||
}
|
||||
|
||||
static inline void term_set_child(Term *t, int n, Term *c) {
|
||||
t->args[n] = c;
|
||||
}
|
||||
|
||||
extern void term_alloc_pool(size_t size);
|
||||
extern void term_free_pool();
|
||||
extern void *term_alloc(size_t size);
|
||||
|
||||
|
||||
extern Term *term_array(int n, ...);
|
||||
extern Term *term_seq(int n, ...);
|
||||
extern Term *term_variants(int n, ...);
|
||||
extern Term *term_glue(int n, ...);
|
||||
|
||||
extern Term *term_rp(Term *t1, Term *t2);
|
||||
extern Term *term_suffix(const char *pref, Term *suf);
|
||||
extern Term *term_str(const char *s);
|
||||
extern Term *term_int(int i);
|
||||
extern Term *term_meta();
|
||||
|
||||
extern Term *term_sel_int(Term *t, int i);
|
||||
extern Term *term_sel(Term *t1, Term *t2);
|
||||
|
||||
|
||||
extern void term_print(FILE *stream, Term *t);
|
||||
|
||||
#endif
|
||||
@@ -1,61 +0,0 @@
|
||||
#include "gfcc-tree.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
extern int arity(Tree *t) {
|
||||
switch (t->type) {
|
||||
case ATOM_STRING:
|
||||
case ATOM_INTEGER:
|
||||
case ATOM_DOUBLE:
|
||||
case ATOM_META:
|
||||
return 0;
|
||||
default:
|
||||
return t->value.size;
|
||||
}
|
||||
}
|
||||
|
||||
static Tree *create_tree(atom_type c, int n) {
|
||||
Tree *t = (Tree *)malloc(sizeof(Tree) + n * sizeof(Tree *));
|
||||
t->type = c;
|
||||
return t;
|
||||
}
|
||||
|
||||
extern Tree *tree_string(const char *s) {
|
||||
Tree *t = create_tree(ATOM_STRING, 0);
|
||||
t->value.string_value = s;
|
||||
return t;
|
||||
}
|
||||
|
||||
extern Tree *tree_integer(int i) {
|
||||
Tree *t = create_tree(ATOM_INTEGER, 0);
|
||||
t->value.integer_value = i;
|
||||
return t;
|
||||
}
|
||||
|
||||
extern Tree *tree_double(double d) {
|
||||
Tree *t = create_tree(ATOM_DOUBLE, 0);
|
||||
t->value.double_value = d;
|
||||
return t;
|
||||
}
|
||||
|
||||
extern Tree *tree_meta() {
|
||||
return create_tree(ATOM_META, 0);
|
||||
}
|
||||
|
||||
extern Tree *tree_fun(atom_type f, int n) {
|
||||
Tree *t = create_tree(f, n);
|
||||
t->value.size = n;
|
||||
return t;
|
||||
}
|
||||
|
||||
|
||||
extern void tree_free(Tree *t) {
|
||||
int n = arity(t);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
tree_free(tree_get_child(t,i));
|
||||
}
|
||||
free(t);
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
#ifndef GFCC_TREE_H
|
||||
#define GFCC_TREE_H
|
||||
|
||||
typedef enum {
|
||||
ATOM_STRING,
|
||||
ATOM_INTEGER,
|
||||
ATOM_DOUBLE,
|
||||
ATOM_META,
|
||||
ATOM_FIRST_FUN
|
||||
} atom_type;
|
||||
|
||||
struct Tree_{
|
||||
atom_type type;
|
||||
union {
|
||||
const char *string_value;
|
||||
int integer_value;
|
||||
double double_value;
|
||||
int size;
|
||||
} value;
|
||||
struct Tree_ *args[0];
|
||||
};
|
||||
|
||||
typedef struct Tree_ Tree;
|
||||
|
||||
static inline Tree *tree_get_child(Tree *t, int n) {
|
||||
return t->args[n];
|
||||
}
|
||||
|
||||
static inline void tree_set_child(Tree *t, int n, Tree *a) {
|
||||
t->args[n] = a;
|
||||
}
|
||||
|
||||
extern int arity(Tree *t);
|
||||
|
||||
|
||||
extern Tree *tree_string(const char *s);
|
||||
|
||||
extern Tree *tree_integer(int i);
|
||||
|
||||
extern Tree *tree_double(double d);
|
||||
|
||||
extern Tree *tree_meta();
|
||||
|
||||
extern Tree *tree_fun(atom_type f, int n);
|
||||
|
||||
|
||||
extern void tree_free(Tree *t);
|
||||
|
||||
#endif
|
||||
107
lib/doc/German.dot
Normal file
@@ -0,0 +1,107 @@
|
||||
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"];
|
||||
|
||||
}
|
||||
BIN
lib/doc/German.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
75
lib/doc/Grammar.dot
Normal file
@@ -0,0 +1,75 @@
|
||||
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"];
|
||||
|
||||
}
|
||||
BIN
lib/doc/Grammar.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
68
lib/doc/Lang.dot
Normal file
@@ -0,0 +1,68 @@
|
||||
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"];
|
||||
|
||||
}
|
||||
BIN
lib/doc/Lang.png
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
16
lib/doc/Makefile
Normal file
@@ -0,0 +1,16 @@
|
||||
.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
|
||||
|
||||
@@ -102,7 +102,7 @@ getRules file = do
|
||||
_ -> getrs rs ss2
|
||||
rule s = (name, typ, ex)
|
||||
where
|
||||
ws = words s
|
||||
ws = takeWhile (/="--#") $ words s
|
||||
name = head ws
|
||||
(t,e) = span (/="--") (tail ws)
|
||||
typ = unwords $ filtype (drop 1 t)
|
||||
@@ -166,24 +166,28 @@ mkCatTable isLatex cs = inChunks chsize (\rs -> header ++ map mk1 rs) cs
|
||||
mk1 (name,expl,ex) = unwords ["|", showCat cs name, "|", expl, "|", typo ex, "|"]
|
||||
typo ex = if take 1 ex == "\"" then itf (init (tail ex)) else ex
|
||||
|
||||
srcPath = ("../src" ++)
|
||||
|
||||
synopsis = "synopsis.txt"
|
||||
commonAPI = "../abstract/Common.gf"
|
||||
catAPI = "../abstract/Cat.gf"
|
||||
syntaxAPI = "../api/Constructors.gf"
|
||||
structuralAPI = "../abstract/Structural.gf"
|
||||
commonAPI = srcPath "/abstract/Common.gf"
|
||||
catAPI = srcPath "/abstract/Cat.gf"
|
||||
syntaxAPI = srcPath "/api/Constructors.gf"
|
||||
structuralAPI = srcPath "/abstract/Structural.gf"
|
||||
paradigmFiles = [
|
||||
("Bulgarian", "../bulgarian/ParadigmsBul.gf"),
|
||||
("Danish", "../danish/ParadigmsDan.gf"),
|
||||
("English", "../english/ParadigmsEng.gf"),
|
||||
("Finnish", "../finnish/ParadigmsFin.gf"),
|
||||
("French", "../french/ParadigmsFre.gf"),
|
||||
("German", "../german/ParadigmsGer.gf"),
|
||||
-- ("Interlingua", "../interlingua/ParadigmsIna.gf"),
|
||||
("Italian", "../italian/ParadigmsIta.gf"),
|
||||
("Norwegian", "../norwegian/ParadigmsNor.gf"),
|
||||
("Russian", "../russian/ParadigmsRus.gf"),
|
||||
("Spanish", "../spanish/ParadigmsSpa.gf"),
|
||||
("Swedish", "../swedish/ParadigmsSwe.gf")
|
||||
("Bulgarian", srcPath "/bulgarian/ParadigmsBul.gf"),
|
||||
("Catalan", srcPath "/catalan/ParadigmsCat.gf"),
|
||||
("Danish", srcPath "/danish/ParadigmsDan.gf"),
|
||||
("English", srcPath "/english/ParadigmsEng.gf"),
|
||||
("Finnish", srcPath "/finnish/ParadigmsFin.gf"),
|
||||
("French", srcPath "/french/ParadigmsFre.gf"),
|
||||
("German", srcPath "/german/ParadigmsGer.gf"),
|
||||
-- ("Interlingua", srcPath "/interlingua/ParadigmsIna.gf"),
|
||||
("Italian", srcPath "/italian/ParadigmsIta.gf"),
|
||||
("Norwegian", srcPath "/norwegian/ParadigmsNor.gf"),
|
||||
("Romanian", srcPath "/romanian/ParadigmsRon.gf"),
|
||||
("Russian", srcPath "/russian/ParadigmsRus.gf"),
|
||||
("Spanish", srcPath "/spanish/ParadigmsSpa.gf"),
|
||||
("Swedish", srcPath "/swedish/ParadigmsSwe.gf")
|
||||
]
|
||||
|
||||
append s = appendFile synopsis ('\n':s)
|
||||
787
lib/doc/Resource-HOWTO.txt
Normal file
@@ -0,0 +1,787 @@
|
||||
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.
|
||||
|
||||
|
||||
111
lib/doc/Syntax.dot
Normal file
@@ -0,0 +1,111 @@
|
||||
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"];
|
||||
|
||||
}
|
||||
BIN
lib/doc/Syntax.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 120 KiB |
BIN
lib/doc/editor.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
267
lib/doc/index.txt
Normal file
@@ -0,0 +1,267 @@
|
||||
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.
|
||||
|
||||
581
lib/doc/official.txt
Normal file
@@ -0,0 +1,581 @@
|
||||
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"
|
||||
48
lib/doc/paradigms.txt
Normal file
@@ -0,0 +1,48 @@
|
||||
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 ;
|
||||
```
|
||||
@@ -13,7 +13,6 @@ B. Bringert and A. Ranta
|
||||
%!postproc(html): '(?i)(HREF="#AdV")( TITLE="[^"]*")?' '\1 TITLE="AdV - adverb directly attached to verb"'
|
||||
%!postproc(html): '(?i)(HREF="#Adv")( TITLE="[^"]*")?' '\1 TITLE="Adv - verb-phrase-modifying adverb"'
|
||||
%!postproc(html): '(?i)(HREF="#Ant")( TITLE="[^"]*")?' '\1 TITLE="Ant - anteriority"'
|
||||
%!postproc(html): '(?i)(HREF="#Art")( TITLE="[^"]*")?' '\1 TITLE="Art - article"'
|
||||
%!postproc(html): '(?i)(HREF="#CAdv")( TITLE="[^"]*")?' '\1 TITLE="CAdv - comparative adverb"'
|
||||
%!postproc(html): '(?i)(HREF="#CN")( TITLE="[^"]*")?' '\1 TITLE="CN - common noun (without determiner)"'
|
||||
%!postproc(html): '(?i)(HREF="#Card")( TITLE="[^"]*")?' '\1 TITLE="Card - cardinal number"'
|
||||
@@ -50,6 +49,7 @@ B. Bringert and A. Ranta
|
||||
%!postproc(html): '(?i)(HREF="#S")( TITLE="[^"]*")?' '\1 TITLE="S - declarative sentence"'
|
||||
%!postproc(html): '(?i)(HREF="#SC")( TITLE="[^"]*")?' '\1 TITLE="SC - embedded sentence or question"'
|
||||
%!postproc(html): '(?i)(HREF="#Subj")( TITLE="[^"]*")?' '\1 TITLE="Subj - subjunction"'
|
||||
%!postproc(html): '(?i)(HREF="#Temp")( TITLE="[^"]*")?' '\1 TITLE="Temp - temporal and aspectual features"'
|
||||
%!postproc(html): '(?i)(HREF="#Tense")( TITLE="[^"]*")?' '\1 TITLE="Tense - tense"'
|
||||
%!postproc(html): '(?i)(HREF="#Text")( TITLE="[^"]*")?' '\1 TITLE="Text - text consisting of several phrases"'
|
||||
%!postproc(html): '(?i)(HREF="#Utt")( TITLE="[^"]*")?' '\1 TITLE="Utt - sentence, question, word..."'
|
||||
@@ -71,10 +71,10 @@ B. Bringert and A. Ranta
|
||||
=Categories=
|
||||
|
||||
|
||||
Source 1: [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/abstract/Common.gf`` ../abstract/Common.gf]
|
||||
Source 1: [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/src/abstract/Common.gf`` ../src/abstract/Common.gf]
|
||||
|
||||
|
||||
Source 2: [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/abstract/Cat.gf`` ../abstract/Cat.gf]
|
||||
Source 2: [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/src/abstract/Cat.gf`` ../src/abstract/Cat.gf]
|
||||
|
||||
|
||||
==A hierarchic view==
|
||||
@@ -91,7 +91,6 @@ Source 2: [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/abstract/Cat.gf``
|
||||
| [AdV #AdV] | adverb directly attached to verb | //always// |
|
||||
| [Adv #Adv] | verb-phrase-modifying adverb | //in the house// |
|
||||
| [Ant #Ant] | anteriority | simultaneous, anterior |
|
||||
| [Art #Art] | article | //the// |
|
||||
| [CAdv #CAdv] | comparative adverb | //more// |
|
||||
| [CN #CN] | common noun (without determiner) | //red house// |
|
||||
| [Card #Card] | cardinal number | //seven// |
|
||||
@@ -128,6 +127,7 @@ Source 2: [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/abstract/Cat.gf``
|
||||
| [S #S] | declarative sentence | //she lived here// |
|
||||
| [SC #SC] | embedded sentence or question | //that it rains// |
|
||||
| [Subj #Subj] | subjunction | //if// |
|
||||
| [Temp #Temp] | temporal and aspectual features | past anterior |
|
||||
| [Tense #Tense] | tense | present, past, future |
|
||||
| [Text #Text] | text consisting of several phrases | //He is here. Why?// |
|
||||
| [Utt #Utt] | sentence, question, word... | //be quiet// |
|
||||
@@ -150,10 +150,10 @@ Source 2: [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/abstract/Cat.gf``
|
||||
=Syntax Rules and Structural Words=
|
||||
|
||||
|
||||
Source 1: [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/api/Constructors.gf`` ../api/Constructors.gf]
|
||||
Source 1: [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/src/api/Constructors.gf`` ../src/api/Constructors.gf]
|
||||
|
||||
|
||||
Source 2: [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/abstract/Structural.gf`` ../abstract/Structural.gf]
|
||||
Source 2: [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/src/abstract/Structural.gf`` ../src/abstract/Structural.gf]
|
||||
|
||||
|
||||
==A - one-place adjective==[A]
|
||||
@@ -164,10 +164,11 @@ Lexical category, constructors given in
|
||||
[lexical paradigms #RParadigms].
|
||||
==AP - adjectival phrase==[AP]
|
||||
|| Function | Type | Example ||
|
||||
| ``comparAP`` | [A #A] ``->`` [AP #AP] | //warmer// |
|
||||
| ``mkAP`` | [A #A] ``->`` [AP #AP] | //old// |
|
||||
| ``mkAP`` | [A #A] ``->`` [NP #NP] ``->`` [AP #AP] | //older than John// |
|
||||
| ``mkAP`` | [A2 #A2] ``->`` [NP #NP] ``->`` [AP #AP] | //married to her// |
|
||||
| ``mkAP`` | [A2 #A2] ``->`` [AP #AP] | //married to myself// |
|
||||
| ``mkAP`` | [A2 #A2] ``->`` [AP #AP] | //married// |
|
||||
| ``mkAP`` | [AP #AP] ``->`` [S #S] ``->`` [AP #AP] | //probable that John walks// |
|
||||
| ``mkAP`` | [AP #AP] ``->`` [QS #QS] ``->`` [AP #AP] | //uncertain if John walks// |
|
||||
| ``mkAP`` | [AP #AP] ``->`` [VP #VP] ``->`` [AP #AP] | //ready to go// |
|
||||
@@ -175,6 +176,9 @@ Lexical category, constructors given in
|
||||
| ``mkAP`` | [AdA #AdA] ``->`` [AP #AP] ``->`` [AP #AP] | //very very old// |
|
||||
| ``mkAP`` | [Conj #Conj] ``->`` [AP #AP] ``->`` [AP #AP] ``->`` [AP #AP] | //old and big// |
|
||||
| ``mkAP`` | [Conj #Conj] ``->`` [ListAP #ListAP] ``->`` [AP #AP] | //old, big, and warm// |
|
||||
| ``mkAP`` | [Ord #Ord] ``->`` [AP #AP] | //oldest// |
|
||||
| ``mkAP`` | [CAdv #CAdv] ``->`` [AP #AP] ``->`` [NP #NP] ``->`` [AP #AP] | //as old as John// |
|
||||
| ``reflAP`` | [A2 #A2] ``->`` [AP #AP] | //married to himself// |
|
||||
==AdA - adjective-modifying adverb==[AdA]
|
||||
|| Function | Type | Example ||
|
||||
| ``almost_AdA`` | [AdA #AdA] | //almost// |
|
||||
@@ -185,6 +189,8 @@ Lexical category, constructors given in
|
||||
==AdN - numeral-modifying adverb==[AdN]
|
||||
|| Function | Type | Example ||
|
||||
| ``almost_AdN`` | [AdN #AdN] | //almost// |
|
||||
| ``at_least_AdN`` | [AdN #AdN] | //at// |
|
||||
| ``at_most_AdN`` | [AdN #AdN] | //at// |
|
||||
| ``mkAdN`` | [CAdv #CAdv] ``->`` [AdN #AdN] | //more than// |
|
||||
==AdV - adverb directly attached to verb==[AdV]
|
||||
|| Function | Type | Example ||
|
||||
@@ -209,14 +215,11 @@ Lexical category, constructors given in
|
||||
| ``there_Adv`` | [Adv #Adv] | //there// |
|
||||
==Ant - anteriority==[Ant]
|
||||
|| Function | Type | Example ||
|
||||
| ``anteriorAnt`` | [Ant #Ant] | //(John has walked) --# notpresent// |
|
||||
| ``anteriorAnt`` | [Ant #Ant] | //(John has walked)// |
|
||||
| ``simultaneousAnt`` | [Ant #Ant] | //(John walks) [default]// |
|
||||
==Art - article==[Art]
|
||||
|| Function | Type | Example ||
|
||||
| ``a_Art`` | [Art #Art] | //a// |
|
||||
| ``the_Art`` | [Art #Art] | //the// |
|
||||
==CAdv - comparative adverb==[CAdv]
|
||||
|| Function | Type | Example ||
|
||||
| ``as_CAdv`` | [CAdv #CAdv] | //as// |
|
||||
| ``less_CAdv`` | [CAdv #CAdv] | //less// |
|
||||
| ``more_CAdv`` | [CAdv #CAdv] | //more// |
|
||||
==CN - common noun (without determiner)==[CN]
|
||||
@@ -286,6 +289,7 @@ Lexical category, constructors given in
|
||||
| ``and_Conj`` | [Conj #Conj] | //and// |
|
||||
| ``both7and_DConj`` | [Conj #Conj] | //both...and// |
|
||||
| ``either7or_DConj`` | [Conj #Conj] | //either...or// |
|
||||
| ``if_then_Conj`` | [Conj #Conj] | //if// |
|
||||
| ``or_Conj`` | [Conj #Conj] | //or// |
|
||||
==Det - determiner phrase==[Det]
|
||||
|| Function | Type | Example ||
|
||||
@@ -382,6 +386,10 @@ Lexical category, constructors given in
|
||||
|| Function | Type | Example ||
|
||||
| ``mkListNP`` | [NP #NP] ``->`` [NP #NP] ``->`` [ListNP #ListNP] | //John, I// |
|
||||
| ``mkListNP`` | [NP #NP] ``->`` [ListNP #ListNP] ``->`` [ListNP #ListNP] | //John, I, that// |
|
||||
==ListRS==[ListRS]
|
||||
|| Function | Type | Example ||
|
||||
| ``mkListRS`` | [RS #RS] ``->`` [RS #RS] ``->`` [ListRS #ListRS] | //who walks, who runs// |
|
||||
| ``mkListRS`` | [RS #RS] ``->`` [ListRS #ListRS] ``->`` [ListRS #ListRS] | //who walks, who runs, who sleeps// |
|
||||
==ListS==[ListS]
|
||||
|| Function | Type | Example ||
|
||||
| ``mkListS`` | [S #S] ``->`` [S #S] ``->`` [ListS #ListS] | //he walks, I run// |
|
||||
@@ -399,8 +407,6 @@ Lexical category, constructors given in
|
||||
|| Function | Type | Example ||
|
||||
| ``everybody_NP`` | [NP #NP] | //everybody// |
|
||||
| ``everything_NP`` | [NP #NP] | //everything// |
|
||||
| ``mkNP`` | [Art #Art] [N #N] ``->`` [NP #NP] | //the man// |
|
||||
| ``mkNP`` | [Art #Art] ``->`` ([Num #Num]) ``->`` [CN #CN] ``->`` [NP #NP] | //the five old men// |
|
||||
| ``mkNP`` | [Quant #Quant] ``->`` [N #N] ``->`` [NP #NP] | //this men// |
|
||||
| ``mkNP`` | [Quant #Quant] ``->`` ([Num #Num]) ``->`` [CN #CN] ``->`` [NP #NP] | //these five old men// |
|
||||
| ``mkNP`` | [Det #Det] ``->`` [N #N] ``->`` [NP #NP] | //the first man// |
|
||||
@@ -422,15 +428,19 @@ Lexical category, constructors given in
|
||||
| ``mkNP`` | [Predet #Predet] ``->`` [NP #NP] ``->`` [NP #NP] | //only John// |
|
||||
| ``mkNP`` | [NP #NP] ``->`` [V2 #V2] ``->`` [NP #NP] | //John killed// |
|
||||
| ``mkNP`` | [NP #NP] ``->`` [Adv #Adv] ``->`` [NP #NP] | //John in Paris// |
|
||||
| ``mkNP`` | [NP #NP] ``->`` [RS #RS] ``->`` [NP #NP] | //John, who lives in Paris// |
|
||||
| ``mkNP`` | [Conj #Conj] ``->`` [NP #NP] ``->`` [NP #NP] ``->`` [NP #NP] | //John and I// |
|
||||
| ``mkNP`` | [Conj #Conj] ``->`` [ListNP #ListNP] ``->`` [NP #NP] | //John, I, and that// |
|
||||
| ``nobody_NP`` | [NP #NP] | //nobody// |
|
||||
| ``nothing_NP`` | [NP #NP] | //nothing// |
|
||||
| ``somebody_NP`` | [NP #NP] | //somebody// |
|
||||
| ``something_NP`` | [NP #NP] | //something// |
|
||||
==Num - number determining element==[Num]
|
||||
|| Function | Type | Example ||
|
||||
| ``mkNum`` | [Numeral #Numeral] ``->`` [Num #Num] | //twenty// |
|
||||
| ``mkNum`` | [Digits #Digits] ``->`` [Num #Num] | //51// |
|
||||
| ``mkNum`` | [AdN #AdN] ``->`` [Num #Num] ``->`` [Num #Num] | //almost ten// |
|
||||
| ``mkNum`` | [Card #Card] ``->`` [Num #Num] | //almost ten// |
|
||||
| ``mkNum`` | [AdN #AdN] ``->`` [Card #Card] ``->`` [Num #Num] | //almost ten// |
|
||||
| ``plNum`` | [Num #Num] | //plural// |
|
||||
| ``sgNum`` | [Num #Num] | //singular// |
|
||||
==Numeral - cardinal or ordinal in words==[Numeral]
|
||||
@@ -478,6 +488,7 @@ Lexical category, constructors given in
|
||||
|| Function | Type | Example ||
|
||||
| ``all_Predet`` | [Predet #Predet] | //all// |
|
||||
| ``most_Predet`` | [Predet #Predet] | //most// |
|
||||
| ``not_Predet`` | [Predet #Predet] | //not// |
|
||||
| ``only_Predet`` | [Predet #Predet] | //only// |
|
||||
==Prep - preposition, or just case==[Prep]
|
||||
|| Function | Type | Example ||
|
||||
@@ -489,6 +500,7 @@ Lexical category, constructors given in
|
||||
| ``by8agent_Prep`` | [Prep #Prep] | //by (agent)// |
|
||||
| ``by8means_Prep`` | [Prep #Prep] | //by (means of)// |
|
||||
| ``during_Prep`` | [Prep #Prep] | //during// |
|
||||
| ``except_Prep`` | [Prep #Prep] | //except// |
|
||||
| ``for_Prep`` | [Prep #Prep] | //for// |
|
||||
| ``from_Prep`` | [Prep #Prep] | //from// |
|
||||
| ``in8front_Prep`` | [Prep #Prep] | //in front of// |
|
||||
@@ -534,7 +546,10 @@ Lexical category, constructors given in
|
||||
| ``mkQS`` | [Cl #Cl] ``->`` [QS #QS] | //does John walk// |
|
||||
==Quant - quantifier ('nucleus' of Det)==[Quant]
|
||||
|| Function | Type | Example ||
|
||||
| ``a_Quant`` | [Quant #Quant] | //a// |
|
||||
| ``no_Quant`` | [Quant #Quant] | //no// |
|
||||
| ``that_Quant`` | [Quant #Quant] | //that// |
|
||||
| ``the_Quant`` | [Quant #Quant] | //the// |
|
||||
| ``this_Quant`` | [Quant #Quant] | //this// |
|
||||
==RCl - relative clause, with all tenses==[RCl]
|
||||
|| Function | Type | Example ||
|
||||
@@ -550,6 +565,8 @@ Lexical category, constructors given in
|
||||
|| Function | Type | Example ||
|
||||
| ``mkRS`` | [RCl #RCl] ``->`` [RS #RS] | //that walk// |
|
||||
| ``mkRS`` | ([Tense #Tense]) ``->`` ([Ant #Ant]) ``->`` ([Pol #Pol]) ``->`` [RCl #RCl] ``->`` [RS #RS] | //that wouldn't have walked// |
|
||||
| ``mkRS`` | [Conj #Conj] ``->`` [RS #RS] ``->`` [RS #RS] ``->`` [RS #RS] | //who walks and whom I know// |
|
||||
| ``mkRS`` | [Conj #Conj] ``->`` [ListRS #ListRS] ``->`` [RS #RS] | //who walks, whose son runs, and whom I know// |
|
||||
==S - declarative sentence==[S]
|
||||
|| Function | Type | Example ||
|
||||
| ``mkS`` | [Cl #Cl] ``->`` [S #S] | //John walks// |
|
||||
@@ -566,11 +583,14 @@ Lexical category, constructors given in
|
||||
| ``because_Subj`` | [Subj #Subj] | //because// |
|
||||
| ``if_Subj`` | [Subj #Subj] | //if// |
|
||||
| ``when_Subj`` | [Subj #Subj] | //when// |
|
||||
==Temp - temporal and aspectual features==[Temp]
|
||||
Lexical category, constructors given in
|
||||
[lexical paradigms #RParadigms].
|
||||
==Tense - tense==[Tense]
|
||||
|| Function | Type | Example ||
|
||||
| ``conditionalTense`` | [Tense #Tense] | //(John would walk) --# notpresent// |
|
||||
| ``futureTense`` | [Tense #Tense] | //(John will walk) --# notpresent// |
|
||||
| ``pastTense`` | [Tense #Tense] | //(John walked) --# notpresent// |
|
||||
| ``conditionalTense`` | [Tense #Tense] | //(John would walk)// |
|
||||
| ``futureTense`` | [Tense #Tense] | //(John will walk)// |
|
||||
| ``pastTense`` | [Tense #Tense] | //(John walked)// |
|
||||
| ``presentTense`` | [Tense #Tense] | //(John walks) [default]// |
|
||||
==Text - text consisting of several phrases==[Text]
|
||||
|| Function | Type | Example ||
|
||||
@@ -589,6 +609,7 @@ Lexical category, constructors given in
|
||||
| ``mkUtt`` | [S #S] ``->`` [Utt #Utt] | //John walked// |
|
||||
| ``mkUtt`` | [Cl #Cl] ``->`` [Utt #Utt] | //John walks// |
|
||||
| ``mkUtt`` | [QS #QS] ``->`` [Utt #Utt] | //did John walk// |
|
||||
| ``mkUtt`` | [QCl #QCl] ``->`` [Utt #Utt] | //does John walk// |
|
||||
| ``mkUtt`` | [Imp #Imp] ``->`` [Utt #Utt] | //love yourself// |
|
||||
| ``mkUtt`` | ([ImpForm #ImpForm]) ``->`` ([Pol #Pol]) ``->`` [Imp #Imp] ``->`` [Utt #Utt] | //don't love yourselves// |
|
||||
| ``mkUtt`` | [IP #IP] ``->`` [Utt #Utt] | //who// |
|
||||
@@ -681,7 +702,7 @@ Lexical category, constructors given in
|
||||
#LParadigms
|
||||
|
||||
|
||||
source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/bulgarian/ParadigmsBul.gf`` ../bulgarian/ParadigmsBul.gf]
|
||||
source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/src/bulgarian/ParadigmsBul.gf`` ../src/bulgarian/ParadigmsBul.gf]
|
||||
|
||||
|
||||
|
||||
@@ -698,6 +719,8 @@ source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/bulgarian/ParadigmsBu
|
||||
| ``mkN007b`` | ``Str`` ``->`` [N #N] |
|
||||
| ``mkN007a`` | ``Str`` ``->`` [N #N] |
|
||||
| ``mkN008`` | ``Str`` ``->`` [N #N] |
|
||||
| ``mkN008b`` | ``Str`` ``->`` [N #N] |
|
||||
| ``mkN008c`` | ``Str`` ``->`` [N #N] |
|
||||
| ``mkN008a`` | ``Str`` ``->`` [N #N] |
|
||||
| ``mkN009`` | ``Str`` ``->`` [N #N] |
|
||||
| ``mkN009a`` | ``Str`` ``->`` [N #N] |
|
||||
@@ -708,7 +731,9 @@ source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/bulgarian/ParadigmsBu
|
||||
| ``mkN014`` | ``Str`` ``->`` [N #N] |
|
||||
| ``mkN014a`` | ``Str`` ``->`` [N #N] |
|
||||
| ``mkN015`` | ``Str`` ``->`` [N #N] |
|
||||
| ``mkN015a`` | ``Str`` ``->`` [N #N] |
|
||||
| ``mkN016`` | ``Str`` ``->`` [N #N] |
|
||||
| ``mkN016a`` | ``Str`` ``->`` [N #N] |
|
||||
| ``mkN017`` | ``Str`` ``->`` [N #N] |
|
||||
| ``mkN018`` | ``Str`` ``->`` [N #N] |
|
||||
| ``mkN018a`` | ``Str`` ``->`` [N #N] |
|
||||
@@ -796,7 +821,6 @@ source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/bulgarian/ParadigmsBu
|
||||
| ``mkA086`` | ``Str`` ``->`` [A #A] |
|
||||
| ``mkA087`` | ``Str`` ``->`` [A #A] |
|
||||
| ``mkA088`` | ``Str`` ``->`` [A #A] |
|
||||
| ``mkA089`` | ``Str`` ``->`` [A #A] |
|
||||
| ``mkA089a`` | ``Str`` ``->`` [A #A] |
|
||||
| ``mkV142`` | ``Str`` ``->`` [VTable #VTable] |
|
||||
| ``mkV143`` | ``Str`` ``->`` [VTable #VTable] |
|
||||
@@ -854,11 +878,78 @@ source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/bulgarian/ParadigmsBu
|
||||
| ``adjAdv`` | [A #A] ``->`` ``Str`` ``->`` [A #A] ``=`` |
|
||||
|
||||
|
||||
==Paradigms for Catalan==
|
||||
#LParadigms
|
||||
|
||||
|
||||
source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/src/catalan/ParadigmsCat.gf`` ../src/catalan/ParadigmsCat.gf]
|
||||
|
||||
|
||||
|
||||
|
||||
|| Function | Type ||
|
||||
| ``Gender`` | [Type #Type] |
|
||||
| ``masculine`` | [Gender #Gender] |
|
||||
| ``feminine`` | [Gender #Gender] |
|
||||
| ``Number`` | [Type #Type] |
|
||||
| ``singular`` | [Number #Number] |
|
||||
| ``plural`` | [Number #Number] |
|
||||
| ``accusative`` | [Prep #Prep] |
|
||||
| ``genitive`` | [Prep #Prep] |
|
||||
| ``dative`` | [Prep #Prep] |
|
||||
| ``mkPrep`` | ``Str`` ``->`` [Prep #Prep] |
|
||||
| ``mkN`` | ``(llum`` ``:`` ``Str)`` ``->`` [N #N] |
|
||||
| ``mkN`` | ``Str`` ``->`` [Gender #Gender] ``->`` [N #N] |
|
||||
| ``mkN`` | ``(disc,discos`` ``:`` ``Str)`` ``->`` [Gender #Gender] ``->`` [N #N] |
|
||||
| ``compN`` | [N #N] ``->`` ``Str`` ``->`` [N #N] |
|
||||
| ``mkN2`` | [N #N] ``->`` [Prep #Prep] ``->`` [N2 #N2] |
|
||||
| ``deN2`` | [N #N] ``->`` [N2 #N2] |
|
||||
| ``aN2`` | [N #N] ``->`` [N2 #N2] |
|
||||
| ``mkN3`` | [N #N] ``->`` [Prep #Prep] ``->`` [Prep #Prep] ``->`` [N3 #N3] |
|
||||
| ``mkPN`` | ``(Anna`` ``:`` ``Str)`` ``->`` [PN #PN] |
|
||||
| ``mkPN`` | ``(Pilar`` ``:`` ``Str)`` ``->`` [Gender #Gender] ``->`` [PN #PN] |
|
||||
| ``mkA`` | ``(sol`` ``:`` ``Str)`` ``->`` [A #A] |
|
||||
| ``mkA`` | ``(fort,forta,forts,fortes,fortament`` ``:`` ``Str)`` ``->`` [A #A] |
|
||||
| ``mkA`` | ``(bo`` ``:`` ``A)`` ``->`` ``(millor`` ``:`` ``A)`` ``->`` [A #A] |
|
||||
| ``prefixA`` | [A #A] ``->`` [A #A] |
|
||||
| ``mkA2`` | [A #A] ``->`` [Prep #Prep] ``->`` [A2 #A2] |
|
||||
| ``mkAdv`` | ``Str`` ``->`` [Adv #Adv] |
|
||||
| ``mkAdV`` | ``Str`` ``->`` [AdV #AdV] |
|
||||
| ``mkAdA`` | ``Str`` ``->`` [AdA #AdA] |
|
||||
| ``mkV`` | ``(cantar`` ``:`` ``Str)`` ``->`` [V #V] |
|
||||
| ``mkV`` | [Verbum #Verbum] ``->`` [V #V] |
|
||||
| ``reflV`` | [V #V] ``->`` [V #V] |
|
||||
| ``special_ppV`` | [V #V] ``->`` ``Str`` ``->`` [V #V] |
|
||||
| ``mkV2`` | ``Str`` ``->`` [V2 #V2] |
|
||||
| ``mkV2`` | [V #V] ``->`` [V2 #V2] |
|
||||
| ``mkV2`` | [V #V] ``->`` [Prep #Prep] ``->`` [V2 #V2] |
|
||||
| ``v2V`` | [V2 #V2] ``->`` [V #V] |
|
||||
| ``mkV3`` | [V #V] ``->`` [Prep #Prep] ``->`` [Prep #Prep] ``->`` [V3 #V3] |
|
||||
| ``dirV3`` | [V #V] ``->`` [Prep #Prep] ``->`` [V3 #V3] |
|
||||
| ``dirdirV3`` | [V #V] ``->`` [V3 #V3] |
|
||||
| ``mkV0`` | [V #V] ``->`` [V0 #V0] |
|
||||
| ``mkVS`` | [V #V] ``->`` [VS #VS] |
|
||||
| ``mkV2S`` | [V #V] ``->`` [Prep #Prep] ``->`` [V2S #V2S] |
|
||||
| ``mkVV`` | [V #V] ``->`` [VV #VV] |
|
||||
| ``deVV`` | [V #V] ``->`` [VV #VV] |
|
||||
| ``aVV`` | [V #V] ``->`` [VV #VV] |
|
||||
| ``mkV2V`` | [V #V] ``->`` [Prep #Prep] ``->`` [Prep #Prep] ``->`` [V2V #V2V] |
|
||||
| ``mkVA`` | [V #V] ``->`` [VA #VA] |
|
||||
| ``mkV2A`` | [V #V] ``->`` [Prep #Prep] ``->`` [Prep #Prep] ``->`` [V2A #V2A] |
|
||||
| ``mkVQ`` | [V #V] ``->`` [VQ #VQ] |
|
||||
| ``mkV2Q`` | [V #V] ``->`` [Prep #Prep] ``->`` [V2Q #V2Q] |
|
||||
| ``mkAS`` | [A #A] ``->`` [AS #AS] |
|
||||
| ``mkA2S`` | [A #A] ``->`` [Prep #Prep] ``->`` [A2S #A2S] |
|
||||
| ``mkAV`` | [A #A] ``->`` [Prep #Prep] ``->`` [AV #AV] |
|
||||
| ``mkA2V`` | [A #A] ``->`` [Prep #Prep] ``->`` [Prep #Prep] ``->`` [A2V #A2V] |
|
||||
| ``V0`` | [Type #Type] |
|
||||
|
||||
|
||||
==Paradigms for Danish==
|
||||
#LParadigms
|
||||
|
||||
|
||||
source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/danish/ParadigmsDan.gf`` ../danish/ParadigmsDan.gf]
|
||||
source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/src/danish/ParadigmsDan.gf`` ../src/danish/ParadigmsDan.gf]
|
||||
|
||||
|
||||
|
||||
@@ -929,7 +1020,7 @@ source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/danish/ParadigmsDan.g
|
||||
#LParadigms
|
||||
|
||||
|
||||
source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/english/ParadigmsEng.gf`` ../english/ParadigmsEng.gf]
|
||||
source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/src/english/ParadigmsEng.gf`` ../src/english/ParadigmsEng.gf]
|
||||
|
||||
|
||||
|
||||
@@ -952,32 +1043,55 @@ source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/english/ParadigmsEng.
|
||||
| ``mkN`` | [Gender #Gender] ``->`` [N #N] ``->`` [N #N] |
|
||||
| ``mkN`` | ``Str`` ``->`` [N #N] ``->`` [N #N] |
|
||||
| ``mkN2`` | [N #N] ``->`` [Prep #Prep] ``->`` [N2 #N2] |
|
||||
| ``regN2`` | ``Str`` ``->`` [N2 #N2] |
|
||||
| ``mkN2`` | [N #N] ``->`` ``Str`` ``->`` [N2 #N2] |
|
||||
| ``mkN2`` | ``Str`` ``->`` ``Str`` ``->`` [N2 #N2] |
|
||||
| ``mkN2`` | [N #N] ``->`` [N2 #N2] |
|
||||
| ``mkN2`` | ``Str`` ``->`` [N2 #N2] |
|
||||
| ``mkN3`` | [N #N] ``->`` [Prep #Prep] ``->`` [Prep #Prep] ``->`` [N3 #N3] |
|
||||
| ``mkPN`` | ``Str`` ``->`` [PN #PN] |
|
||||
| ``mkPN`` | [N #N] ``->`` [PN #PN] |
|
||||
| ``mkQuant`` | ``(this,`` ``these`` ``:`` ``Str)`` ``->`` [Quant #Quant] |
|
||||
| ``mkQuant`` | ``(no_sg,`` ``no_pl,`` ``none_sg,`` ``non_pl`` ``:`` ``Str)`` ``->`` [Quant #Quant] |
|
||||
| ``mkOrd`` | ``Str`` ``->`` [Ord #Ord] |
|
||||
| ``mkA`` | ``(happy`` ``:`` ``Str)`` ``->`` [A #A] |
|
||||
| ``mkA`` | ``(fat,fatter`` ``:`` ``Str)`` ``->`` [A #A] |
|
||||
| ``mkA`` | ``(good,better,best,well`` ``:`` ``Str)`` ``->`` [A #A] |
|
||||
| ``compoundA`` | [A #A] ``->`` [A #A] |
|
||||
| ``simpleA`` | [A #A] ``->`` [A #A] |
|
||||
| ``mkA2`` | [A #A] ``->`` [Prep #Prep] ``->`` [A2 #A2] |
|
||||
| ``mkA2`` | [A #A] ``->`` ``Str`` ``->`` [A2 #A2] |
|
||||
| ``mkA2`` | ``Str`` ``->`` [Prep #Prep] ``->`` [A2 #A2] |
|
||||
| ``mkA2`` | ``Str`` ``->`` ``Str`` ``->`` [A2 #A2] |
|
||||
| ``mkAdv`` | ``Str`` ``->`` [Adv #Adv] |
|
||||
| ``mkAdV`` | ``Str`` ``->`` [AdV #AdV] |
|
||||
| ``mkAdA`` | ``Str`` ``->`` [AdA #AdA] |
|
||||
| ``mkAdN`` | ``Str`` ``->`` [AdN #AdN] |
|
||||
| ``mkPrep`` | ``Str`` ``->`` [Prep #Prep] |
|
||||
| ``noPrep`` | [Prep #Prep] |
|
||||
| ``mkConj`` | ``Str`` ``->`` [Conj #Conj] |
|
||||
| ``mkConj`` | ``Str`` ``->`` [Number #Number] ``->`` [Conj #Conj] |
|
||||
| ``mkConj`` | ``Str`` ``->`` ``Str`` ``->`` [Conj #Conj] |
|
||||
| ``mkConj`` | ``Str`` ``->`` ``Str`` ``->`` [Number #Number] ``->`` [Conj #Conj] |
|
||||
| ``mkV`` | ``(cry`` ``:`` ``Str)`` ``->`` [V #V] |
|
||||
| ``mkV`` | ``(stop,`` ``stopped`` ``:`` ``Str)`` ``->`` [V #V] |
|
||||
| ``mkV`` | ``(drink,`` ``drank,`` ``drunk`` ``:`` ``Str)`` ``->`` [V #V] |
|
||||
| ``mkV`` | ``(run,`` ``ran,`` ``run,`` ``running`` ``:`` ``Str)`` ``->`` [V #V] |
|
||||
| ``mkV`` | ``(go,`` ``goes,`` ``went,`` ``gone,`` ``going`` ``:`` ``Str)`` ``->`` [V #V] |
|
||||
| ``mkV`` | ``Str`` ``->`` [V #V] ``->`` [V #V] |
|
||||
| ``partV`` | [V #V] ``->`` ``Str`` ``->`` [V #V] |
|
||||
| ``reflV`` | [V #V] ``->`` [V #V] |
|
||||
| ``mkV2`` | [V #V] ``->`` [Prep #Prep] ``->`` [V2 #V2] |
|
||||
| ``mkV2`` | ``Str`` ``->`` [V2 #V2] |
|
||||
| ``mkV2`` | [V #V] ``->`` [V2 #V2] |
|
||||
| ``mkV2`` | [V #V] ``->`` [Prep #Prep] ``->`` [V2 #V2] |
|
||||
| ``mkV2`` | [V #V] ``->`` ``Str`` ``->`` [V2 #V2] |
|
||||
| ``mkV2`` | ``Str`` ``->`` [Prep #Prep] ``->`` [V2 #V2] |
|
||||
| ``mkV2`` | ``Str`` ``->`` ``Str`` ``->`` [V2 #V2] |
|
||||
| ``mkV3`` | [V #V] ``->`` [Prep #Prep] ``->`` [Prep #Prep] ``->`` [V3 #V3] |
|
||||
| ``dirV3`` | [V #V] ``->`` [Prep #Prep] ``->`` [V3 #V3] |
|
||||
| ``dirdirV3`` | [V #V] ``->`` [V3 #V3] |
|
||||
| ``mkV3`` | [V #V] ``->`` [Prep #Prep] ``->`` [V3 #V3] |
|
||||
| ``mkV3`` | [V #V] ``->`` ``Str`` ``->`` [V3 #V3] |
|
||||
| ``mkV3`` | ``Str`` ``->`` ``Str`` ``->`` [V3 #V3] |
|
||||
| ``mkV3`` | [V #V] ``->`` [V3 #V3] |
|
||||
| ``mkV3`` | ``Str`` ``->`` [V3 #V3] |
|
||||
| ``mkV0`` | [V #V] ``->`` [V0 #V0] |
|
||||
| ``mkVS`` | [V #V] ``->`` [VS #VS] |
|
||||
| ``mkV2S`` | [V #V] ``->`` [Prep #Prep] ``->`` [V2S #V2S] |
|
||||
@@ -992,13 +1106,14 @@ source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/english/ParadigmsEng.
|
||||
| ``mkAV`` | [A #A] ``->`` [AV #AV] |
|
||||
| ``mkA2V`` | [A #A] ``->`` [Prep #Prep] ``->`` [A2V #A2V] |
|
||||
| ``V0`` | [Type #Type] |
|
||||
| ``mkSubj`` | ``Str`` ``->`` [Subj #Subj] ``=`` ``\s`` ``->`` ``{s`` ``=`` ``s`` ``lock_Subj`` ``=`` ``<>}`` |
|
||||
|
||||
|
||||
==Paradigms for Finnish==
|
||||
#LParadigms
|
||||
|
||||
|
||||
source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/finnish/ParadigmsFin.gf`` ../finnish/ParadigmsFin.gf]
|
||||
source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/src/finnish/ParadigmsFin.gf`` ../src/finnish/ParadigmsFin.gf]
|
||||
|
||||
|
||||
|
||||
@@ -1075,7 +1190,7 @@ source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/finnish/ParadigmsFin.
|
||||
#LParadigms
|
||||
|
||||
|
||||
source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/french/ParadigmsFre.gf`` ../french/ParadigmsFre.gf]
|
||||
source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/src/french/ParadigmsFre.gf`` ../src/french/ParadigmsFre.gf]
|
||||
|
||||
|
||||
|
||||
@@ -1115,6 +1230,7 @@ source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/french/ParadigmsFre.g
|
||||
| ``mkV`` | [V2 #V2] ``->`` [V #V] |
|
||||
| ``etreV`` | [V #V] ``->`` [V #V] |
|
||||
| ``reflV`` | [V #V] ``->`` [V #V] |
|
||||
| ``mkV2`` | ``Str`` ``->`` [V2 #V2] ``=`` ``\s`` ``->`` ``dirV2`` ``(regV`` ``s)`` |
|
||||
| ``mkV2`` | [V #V] ``->`` [V2 #V2] ``=`` ``dirV2`` |
|
||||
| ``mkV2`` | [V #V] ``->`` [Prep #Prep] ``->`` [V2 #V2] ``=`` ``mmkV2`` |
|
||||
| ``mkV3`` | [V #V] ``->`` [V3 #V3] |
|
||||
@@ -1142,7 +1258,7 @@ source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/french/ParadigmsFre.g
|
||||
#LParadigms
|
||||
|
||||
|
||||
source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/german/ParadigmsGer.gf`` ../german/ParadigmsGer.gf]
|
||||
source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/src/german/ParadigmsGer.gf`` ../src/german/ParadigmsGer.gf]
|
||||
|
||||
|
||||
|
||||
@@ -1172,6 +1288,7 @@ source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/german/ParadigmsGer.g
|
||||
| ``mkPN`` | ``(nom,acc,dat,gen`` ``:`` ``Str)`` ``->`` [PN #PN] |
|
||||
| ``mkA`` | ``Str`` ``->`` [A #A] |
|
||||
| ``mkA`` | ``(gut,besser,beste`` ``:`` ``Str)`` ``->`` [A #A] |
|
||||
| ``mkA`` | ``(gut,gute,besser,beste`` ``:`` ``Str)`` ``->`` [A #A] |
|
||||
| ``invarA`` | ``Str`` ``->`` [A #A] |
|
||||
| ``mkA2`` | [A #A] ``->`` [Prep #Prep] ``->`` [A2 #A2] |
|
||||
| ``mkAdv`` | ``Str`` ``->`` [Adv #Adv] |
|
||||
@@ -1189,8 +1306,9 @@ source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/german/ParadigmsGer.g
|
||||
| ``seinV`` | [V #V] ``->`` [V #V] |
|
||||
| ``habenV`` | [V #V] ``->`` [V #V] |
|
||||
| ``reflV`` | [V #V] ``->`` [Case #Case] ``->`` [V #V] |
|
||||
| ``mkV2`` | [V #V] ``->`` [Prep #Prep] ``->`` [V2 #V2] |
|
||||
| ``mkV2`` | ``Str`` ``->`` [V2 #V2] |
|
||||
| ``mkV2`` | [V #V] ``->`` [V2 #V2] |
|
||||
| ``mkV2`` | [V #V] ``->`` [Prep #Prep] ``->`` [V2 #V2] |
|
||||
| ``mkV2`` | [V #V] ``->`` [Case #Case] ``->`` [V2 #V2] |
|
||||
| ``mkV3`` | [V #V] ``->`` [Prep #Prep] ``->`` [Prep #Prep] ``->`` [V3 #V3] |
|
||||
| ``dirV3`` | [V #V] ``->`` [Prep #Prep] ``->`` [V3 #V3] |
|
||||
@@ -1215,7 +1333,7 @@ source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/german/ParadigmsGer.g
|
||||
#LParadigms
|
||||
|
||||
|
||||
source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/italian/ParadigmsIta.gf`` ../italian/ParadigmsIta.gf]
|
||||
source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/src/italian/ParadigmsIta.gf`` ../src/italian/ParadigmsIta.gf]
|
||||
|
||||
|
||||
|
||||
@@ -1283,7 +1401,7 @@ source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/italian/ParadigmsIta.
|
||||
#LParadigms
|
||||
|
||||
|
||||
source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/norwegian/ParadigmsNor.gf`` ../norwegian/ParadigmsNor.gf]
|
||||
source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/src/norwegian/ParadigmsNor.gf`` ../src/norwegian/ParadigmsNor.gf]
|
||||
|
||||
|
||||
|
||||
@@ -1350,11 +1468,52 @@ source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/norwegian/ParadigmsNo
|
||||
| ``V0`` | [Type #Type] |
|
||||
|
||||
|
||||
==Paradigms for Romanian==
|
||||
#LParadigms
|
||||
|
||||
|
||||
source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/src/romanian/ParadigmsRon.gf`` ../src/romanian/ParadigmsRon.gf]
|
||||
|
||||
|
||||
|
||||
|
||||
|| Function | Type ||
|
||||
| ``NGender`` | [Type #Type] |
|
||||
| ``masculine`` | [NGender #NGender] |
|
||||
| ``feminine`` | [NGender #NGender] |
|
||||
| ``neuter`` | [NGender #NGender] |
|
||||
| ``Gender`` | [Type #Type] |
|
||||
| ``Masculine`` | [Gender #Gender] |
|
||||
| ``Feminine`` | [Gender #Gender] |
|
||||
| ``Anim`` | [Type #Type] |
|
||||
| ``animate`` | [Anim #Anim] |
|
||||
| ``inanimate`` | ``Anim;`` |
|
||||
| ``Number`` | [Type #Type] |
|
||||
| ``singular`` | [Number #Number] |
|
||||
| ``plural`` | [Number #Number] |
|
||||
| ``Preposition`` | [Type #Type] |
|
||||
| ``NCase`` | [Type #Type] |
|
||||
| ``Acc`` | [NCase #NCase] |
|
||||
| ``Dat`` | [NCase #NCase] |
|
||||
| ``Gen`` | [NCase #NCase] |
|
||||
| ``mkPrep`` | ``Str`` ``->`` [NCase #NCase] ``->`` [Prep #Prep] |
|
||||
| ``noPrep`` | [NCase #NCase] ``->`` [Prep #Prep] |
|
||||
| ``mkN2`` | [N #N] ``->`` [Prep #Prep] ``->`` [N2 #N2] |
|
||||
| ``mkN3`` | [N #N] ``->`` [Prep #Prep] ``->`` [Prep #Prep] ``->`` [N3 #N3] |
|
||||
| ``mkPN`` | ``Str`` ``->`` [PN #PN] ``=`` ``mkPropN`` |
|
||||
| ``mkPN`` | ``Str`` ``->`` [Gender #Gender] ``->`` [PN #PN] ``=`` ``mkPropNoun`` |
|
||||
| ``mkPN`` | ``Str`` ``->`` [Gender #Gender] ``->`` [Number #Number] ``->`` [PN #PN] ``=`` ``mkProperNoun;`` |
|
||||
| ``mkPropN`` | ``Str`` ``->`` [PN #PN] ``=`` ``\Ion`` ``->`` |
|
||||
| ``mkPropNoun`` | ``Str`` ``->`` [Gender #Gender] ``->`` [PN #PN] ``=`` ``\Ion,`` ``gen`` ``->`` |
|
||||
| ``mkProperNoun`` | ``Str`` ``->`` [Gender #Gender] ``->`` [Number #Number] ``->`` [PN #PN] ``=`` ``\Ion,`` ``gen,`` ``num`` ``->`` |
|
||||
| ``mkA2`` | [A #A] ``->`` [Prep #Prep] ``->`` [A2 #A2] |
|
||||
|
||||
|
||||
==Paradigms for Russian==
|
||||
#LParadigms
|
||||
|
||||
|
||||
source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/russian/ParadigmsRus.gf`` ../russian/ParadigmsRus.gf]
|
||||
source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/src/russian/ParadigmsRus.gf`` ../src/russian/ParadigmsRus.gf]
|
||||
|
||||
|
||||
|
||||
@@ -1398,7 +1557,7 @@ source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/russian/ParadigmsRus.
|
||||
#LParadigms
|
||||
|
||||
|
||||
source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/spanish/ParadigmsSpa.gf`` ../spanish/ParadigmsSpa.gf]
|
||||
source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/src/spanish/ParadigmsSpa.gf`` ../src/spanish/ParadigmsSpa.gf]
|
||||
|
||||
|
||||
|
||||
@@ -1466,7 +1625,7 @@ source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/spanish/ParadigmsSpa.
|
||||
#LParadigms
|
||||
|
||||
|
||||
source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/swedish/ParadigmsSwe.gf`` ../swedish/ParadigmsSwe.gf]
|
||||
source [``http://www.cs.chalmers.se/~aarne/GF/lib/resource/src/swedish/ParadigmsSwe.gf`` ../src/swedish/ParadigmsSwe.gf]
|
||||
|
||||
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
|
||||
<TITLE>GF Grammar Libraries</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1>GF Grammar Libraries</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Author: Aarne Ranta <aarne (at) cs.chalmers.se></I><BR>
|
||||
Last update: Fri Dec 22 15:19:46 2006
|
||||
</FONT></CENTER>
|
||||
|
||||
<P>
|
||||
One of the main ideas of
|
||||
<A HREF="..">GF</A>
|
||||
is the use of libraries in grammar writing, in a way familiar
|
||||
from software engineering. In this way, large grammars can
|
||||
be built in cooperation, and old grammars or parts of them
|
||||
can be reused in new grammars. The slides
|
||||
<A HREF="resource-1.0/doc/gslt-sem-2006.html">Grammars as Software Libraries</A>
|
||||
give some introduction to this idea.
|
||||
</P>
|
||||
<H2>The resource grammar library</H2>
|
||||
<P>
|
||||
This library covers basic linguistic structures of
|
||||
different languages.
|
||||
</P>
|
||||
<P>
|
||||
<A HREF="resource-1.0/doc">Version 1.1</A> released 22 December 2006
|
||||
(enhanced version of 1.0).
|
||||
Covers Danish, English, Finnish, French, German, Italian, Norwegian,
|
||||
Russian, Spanish, and Swedish.
|
||||
</P>
|
||||
<P>
|
||||
Two older versions are also available:
|
||||
<A HREF="resource/">Version 0.9</A>
|
||||
and
|
||||
<A HREF="resource-0.6/">Version 0.6</A>.
|
||||
</P>
|
||||
<H2>The prelude library</H2>
|
||||
<P>
|
||||
The <A HREF="prelude/">prelude</A>
|
||||
library gives utility functions for different GF applications:
|
||||
</P>
|
||||
<P>
|
||||
<A HREF="resource-1.0/doc/gfdoc/Precedence.html">Precedence</A>. Utilities for
|
||||
formal languages: precedence levels, associatives, infixes.
|
||||
</P>
|
||||
<P>
|
||||
<A HREF="resource-1.0/doc/gfdoc/Predef.html">Predef</A>. Type signatures
|
||||
of predefined (hard-coded) functions.
|
||||
</P>
|
||||
<P>
|
||||
<A HREF="resource-1.0/doc/gfdoc/Prelude.html">Prelude</A>. Generic utilities
|
||||
for strings, tables, records, booleans.
|
||||
</P>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags index.txt -->
|
||||
</BODY></HTML>
|
||||
@@ -1,58 +0,0 @@
|
||||
GF Grammar Libraries
|
||||
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
|
||||
|
||||
One of the main ideas of
|
||||
[GF ..]
|
||||
is the use of libraries in grammar writing, in a way familiar
|
||||
from software engineering. In this way, large grammars can
|
||||
be built in cooperation, and old grammars or parts of them
|
||||
can be reused in new grammars. The slides
|
||||
[Grammars as Software Libraries resource-1.0/doc/gslt-sem-2006.html]
|
||||
give some introduction to this idea.
|
||||
|
||||
|
||||
|
||||
==The resource grammar library==
|
||||
|
||||
This library covers basic linguistic structures of
|
||||
different languages.
|
||||
|
||||
[Version 1.2 resource-1.0/doc] released 22 December 2006
|
||||
(enhanced version of 1.0).
|
||||
Covers Danish, English, Finnish, French, German, Italian, Norwegian,
|
||||
Russian, Spanish, and Swedish, and to a smaller extent Arabic and Catalan.
|
||||
|
||||
Two older versions are also available:
|
||||
[Version 0.9 resource/]
|
||||
and
|
||||
[Version 0.6 resource-0.6/].
|
||||
|
||||
|
||||
|
||||
==The prelude library==
|
||||
|
||||
The [prelude prelude/]
|
||||
library gives utility functions for different GF applications:
|
||||
|
||||
[Precedence resource-1.0/doc/gfdoc/Precedence.html]. Utilities for
|
||||
formal languages: precedence levels, associatives, infixes.
|
||||
|
||||
[Predef resource-1.0/doc/gfdoc/Predef.html]. Type signatures
|
||||
of predefined (hard-coded) functions.
|
||||
|
||||
[Prelude resource-1.0/doc/gfdoc/Prelude.html]. Generic utilities
|
||||
for strings, tables, records, booleans.
|
||||
|
||||
|
||||
==License==
|
||||
|
||||
All libraries in this directory and its subdirectories are
|
||||
releaced under GNU Lesser General Public License (LGPL). See the file
|
||||
[LICENSE ./LICENSE] for more details.
|
||||
@@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<link rel="stylesheet" type="text/css" href="style.css" />
|
||||
<script type="text/javascript" src="gflib.js"></script>
|
||||
<script type="text/javascript" src="editorGrammar.js"></script>
|
||||
<script type="text/javascript" src="grammar.js"></script>
|
||||
<script type="text/javascript" src="gfjseditor.js"></script>
|
||||
<title>Web-based Syntax Editor</title>
|
||||
</head>
|
||||
<body onload="mkEditor('editor', Food)" onkeydown="hotKeys(event)">
|
||||
<div id="editor">
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
Before Width: | Height: | Size: 161 B |
@@ -1,54 +0,0 @@
|
||||
/* Output */
|
||||
|
||||
function sayText(text) {
|
||||
document.voice_output_text = text;
|
||||
activateForm("voice_output");
|
||||
}
|
||||
|
||||
/* XHTML+Voice Utilities */
|
||||
|
||||
function activateForm(formid) {
|
||||
var form = document.getElementById(formid);
|
||||
var e = document.createEvent("UIEvents");
|
||||
e.initEvent("DOMActivate","true","true");
|
||||
form.dispatchEvent(e);
|
||||
}
|
||||
|
||||
|
||||
/* DOM utilities */
|
||||
|
||||
/* Gets the head element of the document. */
|
||||
function getHeadElement() {
|
||||
var hs = document.getElementsByTagName("head");
|
||||
if (hs.length == 0) {
|
||||
var head = document.createElement("head");
|
||||
document.documentElement.insertBefore(head, document.documentElement.firstChild);
|
||||
return head;
|
||||
} else {
|
||||
return hs[0];
|
||||
}
|
||||
}
|
||||
|
||||
/* Gets the body element of the document. */
|
||||
function getBodyElement() {
|
||||
var bs = document.getElementsByTagName("body");
|
||||
if (bs.length == 0) {
|
||||
var body = document.createElement("body");
|
||||
document.documentElement.appendChild(body);
|
||||
return body;
|
||||
} else {
|
||||
return bs[0];
|
||||
}
|
||||
}
|
||||
|
||||
/* Removes all the children of a node */
|
||||
function removeChildren(node) {
|
||||
while (node.hasChildNodes()) {
|
||||
node.removeChild(node.firstChild);
|
||||
}
|
||||
}
|
||||
|
||||
function setText(node, text) {
|
||||
removeChildren(node);
|
||||
node.appendChild(document.createTextNode(text));
|
||||
}
|
||||
|
Before Width: | Height: | Size: 201 B |
|
Before Width: | Height: | Size: 229 B |
@@ -1,241 +0,0 @@
|
||||
body {
|
||||
font-family:arial,helvetica,sans-serif;
|
||||
font-size:12px;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
#wrapper {
|
||||
width:740px;
|
||||
height:520px;
|
||||
margin:auto 50px;
|
||||
border:1px solid gray;
|
||||
padding:10px;
|
||||
|
||||
}
|
||||
|
||||
#absFrame {
|
||||
width:250px;
|
||||
height:250px;
|
||||
padding:10px;
|
||||
border:1px solid gray;
|
||||
float:left;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#conFrame {
|
||||
width:436px;
|
||||
height:250px;
|
||||
margin-left:10px;
|
||||
padding:10px;
|
||||
border:1px solid gray;
|
||||
float:left;
|
||||
white-space: normal;
|
||||
overflow:auto;
|
||||
}
|
||||
|
||||
#actFrame {
|
||||
width:250px;
|
||||
height:170px;
|
||||
margin-top:10px;
|
||||
padding:10px;
|
||||
border:1px solid gray;
|
||||
float:left;
|
||||
overflow:auto;
|
||||
}
|
||||
|
||||
#refFrame {
|
||||
width:436px;
|
||||
height:170px;
|
||||
margin-left:10px;
|
||||
margin-top:10px;
|
||||
padding:10px;
|
||||
border:1px solid gray;
|
||||
float:left;
|
||||
overflow:auto;
|
||||
}
|
||||
|
||||
#messageFrame {
|
||||
width:506px;
|
||||
height:15px;
|
||||
margin-top:10px;
|
||||
margin-right:10px;
|
||||
padding:10px;
|
||||
border:1px solid gray;
|
||||
float:left;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
#clipboardFrame {
|
||||
width:180px;
|
||||
height:15px;
|
||||
margin-top:10px;
|
||||
padding:10px;
|
||||
border:1px solid gray;
|
||||
float:left;
|
||||
overflow:auto;
|
||||
}
|
||||
|
||||
#tree {
|
||||
left: -10px;
|
||||
top: -10px;
|
||||
width: 250px;
|
||||
height: 250px;
|
||||
margin: 0px;
|
||||
padding: 10px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
ul {
|
||||
position: relative;
|
||||
list-style: none;
|
||||
margin-left: 20px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
li {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
img.tree-menu {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
a.tree:link, a.tree:visited, a.tree:active {
|
||||
color: black;
|
||||
background-color: white;
|
||||
text-decoration: none;
|
||||
margin-right:10px;
|
||||
}
|
||||
|
||||
a.tree:hover {
|
||||
color: blue;
|
||||
background-color: white;
|
||||
text-decoration: underline;
|
||||
margin-right:10px;
|
||||
}
|
||||
|
||||
a.treeSelected:link, a.treeSelected:visited, a.treeSelected:active {
|
||||
color: white;
|
||||
background-color: #3366CC;
|
||||
text-decoration: none;
|
||||
margin-right:10px;
|
||||
}
|
||||
|
||||
a.treeSelected:hover {
|
||||
color: white;
|
||||
background-color: #3366CC;
|
||||
text-decoration: underline;
|
||||
margin-right:10px;
|
||||
}
|
||||
|
||||
a.treeGray:link, a.treeGray:visited, a.treeGray:active {
|
||||
color: silver;
|
||||
background-color: white;
|
||||
text-decoration: none;
|
||||
margin-right:10px;
|
||||
}
|
||||
|
||||
a.treeGray:hover {
|
||||
color: silver;
|
||||
background-color: white;
|
||||
text-decoration: none;
|
||||
margin-right:10px;
|
||||
}
|
||||
|
||||
table.action, table.refinement, table.wrapper, table.tree, table.language {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
border-style: none;
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0px;
|
||||
}
|
||||
|
||||
tr.selected {
|
||||
color: white;
|
||||
background-color: #3366CC;
|
||||
}
|
||||
|
||||
tr.unavailable, tr.closed {
|
||||
color: silver;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
tr.unavailable:hover {
|
||||
color: silver;
|
||||
background-color: #3366CC;
|
||||
}
|
||||
|
||||
tr.action, tr.refinement, tr.wrapper, tr.tree {
|
||||
color: black;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
tr.action:hover, tr.refinement:hover, tr.wrapper:hover, tr.tree:hover {
|
||||
color: white;
|
||||
background-color: #3366CC;
|
||||
}
|
||||
|
||||
td.action {
|
||||
width: 220px;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
td.refinement, td.wrapper, td.tree {
|
||||
width: 515px;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
td.hotKey {
|
||||
width: 30px;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
td.language {
|
||||
color: black;
|
||||
background-color: white;
|
||||
margin: 1px;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
td.language:hover {
|
||||
color: blue;
|
||||
background-color: white;
|
||||
text-decoration: underline;
|
||||
margin: 1px;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
td.selected {
|
||||
color: white;
|
||||
background-color: #3366CC;
|
||||
margin: 1px;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
td.selected:hover {
|
||||
color: white;
|
||||
background-color: #3366CC;
|
||||
text-decoration: underline;
|
||||
margin: 1px;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
span.normal {
|
||||
color: black;
|
||||
background-color: white;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
span.selected {
|
||||
color: white;
|
||||
background-color: #3366CC;
|
||||
text-decoration: none;
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
body {
|
||||
color: black;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
dl {
|
||||
|
||||
}
|
||||
|
||||
dt {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
dl dd {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
dl.fromLang dt {
|
||||
display: none;
|
||||
}
|
||||
|
||||
dl.toLang {
|
||||
border-width: 1px 0 0 0;
|
||||
border-style: solid;
|
||||
border-color: #c0c0c0;
|
||||
}
|
||||
|
||||
dl.toLang dt {
|
||||
color: #c0c0c0;
|
||||
display: block;
|
||||
float: left;
|
||||
width: 5em;
|
||||
}
|
||||
|
||||
|
||||
dl.toLang dd {
|
||||
border-width: 0 0 1px 0;
|
||||
border-style: solid;
|
||||
border-color: #c0c0c0;
|
||||
}
|
||||
|
||||
|
||||
ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
li {
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<link rel="stylesheet" type="text/css" href="translator.css" />
|
||||
<script type="text/javascript" src="gflib.js"></script>
|
||||
<script type="text/javascript" src="grammar.js"></script>
|
||||
<script type="text/javascript" src="translator.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* CHANGE ME */
|
||||
var grammar = Food;
|
||||
|
||||
function updateTranslation () {
|
||||
var input = document.getElementById('inputText').value;
|
||||
var fromLang = document.getElementById('fromLang').value;
|
||||
var toLang = document.getElementById('toLang').value;
|
||||
var output = document.getElementById('output');
|
||||
var translation = grammar.translate(input, fromLang, toLang);
|
||||
removeChildren(output);
|
||||
output.appendChild(formatTranslation(translation));
|
||||
}
|
||||
|
||||
function populateLangs () {
|
||||
var f = document.getElementById('fromLang');
|
||||
var t = document.getElementById('toLang');
|
||||
for (var c in grammar.concretes) {
|
||||
addOption(f, c, c);
|
||||
addOption(t, c, c);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<title>Web-based GF Translator</title>
|
||||
</head>
|
||||
<body onload="populateLangs(Food, 'fromLang', 'toLang')">
|
||||
<form id="translate">
|
||||
<p>
|
||||
<input type="text" name="inputText" id="inputText" value="this cheese is warm" size="50" />
|
||||
</p>
|
||||
<p>
|
||||
From: <select name="fromLang" id="fromLang" onchange=""><option value="">Any language</option></select>
|
||||
To: <select name="toLang" id="toLang"><option value="">All languages</option></select>
|
||||
<input type="button" value="Translate" onclick="updateTranslation()" />
|
||||
</p>
|
||||
</form>
|
||||
<div id="output"></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,51 +0,0 @@
|
||||
function formatTranslation (outputs) {
|
||||
var dl1 = document.createElement("dl");
|
||||
dl1.className = "fromLang";
|
||||
for (var fromLang in outputs) {
|
||||
var ul = document.createElement("ul");
|
||||
addDefinition(dl1, document.createTextNode(fromLang), ul);
|
||||
for (var i in outputs[fromLang]) {
|
||||
var dl2 = document.createElement("dl");
|
||||
dl2.className = "toLang";
|
||||
for (var toLang in outputs[fromLang][i]) {
|
||||
addDefinition(dl2, document.createTextNode(toLang), document.createTextNode(outputs[fromLang][i][toLang]));
|
||||
}
|
||||
addItem(ul, dl2);
|
||||
}
|
||||
}
|
||||
|
||||
return dl1;
|
||||
}
|
||||
|
||||
/* DOM utilities for specific tags */
|
||||
|
||||
function addDefinition (dl, t, d) {
|
||||
var dt = document.createElement("dt");
|
||||
dt.appendChild(t);
|
||||
dl.appendChild(dt);
|
||||
var dd = document.createElement("dd");
|
||||
dd.appendChild(d);
|
||||
dl.appendChild(dd);
|
||||
}
|
||||
|
||||
function addItem (ul, i) {
|
||||
var li = document.createElement("li");
|
||||
li.appendChild(i);
|
||||
ul.appendChild(li);
|
||||
}
|
||||
|
||||
function addOption (select, value, content) {
|
||||
var option = document.createElement("option");
|
||||
option.value = value;
|
||||
option.appendChild(document.createTextNode(content));
|
||||
select.appendChild(option);
|
||||
}
|
||||
|
||||
/* General DOM utilities */
|
||||
|
||||
/* Removes all the children of a node */
|
||||
function removeChildren(node) {
|
||||
while (node.hasChildNodes()) {
|
||||
node.removeChild(node.firstChild);
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
RUNGHC=runghc
|
||||
RUNMAKE=$(RUNGHC) Make.hs
|
||||
|
||||
.PHONY: all present alltenses lang api math test demo synopsis link compiled clean
|
||||
|
||||
all: link present alltenses math
|
||||
|
||||
present:
|
||||
$(RUNMAKE) present lang
|
||||
$(RUNMAKE) present api
|
||||
|
||||
alltenses:
|
||||
$(RUNMAKE) lang
|
||||
$(RUNMAKE) api
|
||||
|
||||
lang:
|
||||
$(RUNMAKE) lang
|
||||
|
||||
api:
|
||||
$(RUNMAKE) api
|
||||
|
||||
math:
|
||||
$(RUNMAKE) math
|
||||
|
||||
compat:
|
||||
gf -batch */Compatibility*.gf
|
||||
cp -p */Compatibility*.gfo ../alltenses/
|
||||
cp -p */Compatibility*.gfo ../present/
|
||||
# $(RUNMAKE) present compat
|
||||
# $(RUNMAKE) compat
|
||||
|
||||
test:
|
||||
$(RUNMAKE) test
|
||||
|
||||
demo:
|
||||
$(RUNMAKE) demo
|
||||
|
||||
synopsis:
|
||||
cd doc ; $(RUNGHC) MkSynopsis ; cd ..
|
||||
|
||||
link:
|
||||
chmod a+x mkPresent
|
||||
|
||||
compiled:
|
||||
(cd .. && tar -zcf resource-compiled.tar.gz prelude alltenses present mathematical)
|
||||
|
||||
clean:
|
||||
$(RUNMAKE) clean
|
||||
|
||||
@@ -1,199 +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 Grammar 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
|
||||
};
|
||||
|
||||
--2 Text append
|
||||
|
||||
-- This is not in ground API, because it would destroy parsing.
|
||||
|
||||
appendText : Text -> Text -> Text ;
|
||||
|
||||
--.
|
||||
|
||||
pred = overload {
|
||||
pred : V -> NP -> Cl
|
||||
= \v,np -> PredVP np (UseV v) ;
|
||||
pred : V2 -> NP -> NP -> Cl
|
||||
= \v,np,ob -> PredVP np (ComplSlash (SlashV2a v) ob) ;
|
||||
pred : V3 -> NP -> NP -> NP -> Cl
|
||||
= \v,np,ob,ob2 ->
|
||||
PredVP np (ComplSlash (Slash2V3 v ob) ob2) ;
|
||||
pred : V -> NP -> NP -> Cl
|
||||
= \v,x,y -> PredVP (ConjNP and_Conj (BaseNP x y)) (UseV v) ;
|
||||
pred : A -> NP -> Cl
|
||||
= \a,np -> PredVP np (UseComp (CompAP (PositA a))) ;
|
||||
pred : A2 -> NP -> NP -> Cl
|
||||
= \a,x,y -> PredVP x (UseComp (CompAP (ComplA2 a y))) ;
|
||||
pred : A -> NP -> NP -> Cl
|
||||
= \a,x,y -> PredVP (ConjNP and_Conj (BaseNP x y)) (UseComp (CompAP (PositA a))) ;
|
||||
pred : N -> NP -> Cl
|
||||
= \n,x -> PredVP x (UseComp (CompNP (DetArtSg (IndefArt) (UseN n)))) ;
|
||||
pred : CN -> NP -> Cl
|
||||
= \n,x -> PredVP x (UseComp (CompNP (DetArtSg (IndefArt) n))) ;
|
||||
pred : NP -> NP -> Cl
|
||||
= \n,x -> PredVP x (UseComp (CompNP n)) ; pred : N2 -> NP -> NP -> Cl
|
||||
= \n,x,y -> PredVP x (UseComp (CompNP (DetArtSg (IndefArt) (ComplN2 n y)))) ;
|
||||
pred : N -> NP -> NP -> Cl
|
||||
= \n,x,y -> PredVP (ConjNP and_Conj (BaseNP x y)) (UseComp (CompNP (DetArtPl (IndefArt) (UseN n)))) ;
|
||||
pred : Adv -> NP -> Cl
|
||||
= \a,x -> PredVP x (UseComp (CompAdv a)) ;
|
||||
pred : Prep -> NP -> NP -> Cl
|
||||
= \p,x,y -> PredVP x (UseComp (CompAdv (PrepNP p y)))
|
||||
|
||||
} ;
|
||||
|
||||
app = overload {
|
||||
app : N -> NP
|
||||
= \n -> (DetArtSg (DefArt) (UseN n)) ;
|
||||
app : N2 -> NP -> NP
|
||||
= \n,x -> (DetArtSg (DefArt) (ComplN2 n x)) ;
|
||||
app : N3 -> NP -> NP -> NP
|
||||
= \n,x,y -> (DetArtSg (DefArt) (ComplN2 (ComplN3 n x) y)) ;
|
||||
app : N2 -> NP -> NP -> NP
|
||||
= \n,x,y -> (DetArtSg DefArt (ComplN2 n (ConjNP and_Conj (BaseNP x y)))) ;
|
||||
app : N2 -> N -> CN
|
||||
= \f,n -> ComplN2 f (DetArtPl (IndefArt) (UseN n)) ;
|
||||
|
||||
app : N2 -> NP -> CN = ComplN2 ;
|
||||
app : N3 -> NP -> NP -> CN = \n,x,y -> ComplN2 (ComplN3 n x) y ;
|
||||
app : N2 -> NP -> NP -> CN = \n,x,y ->
|
||||
ComplN2 n (ConjNP and_Conj (BaseNP x y)) ;
|
||||
} ;
|
||||
|
||||
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 : 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
|
||||
} ;
|
||||
|
||||
mod = overload {
|
||||
mod : A -> N -> CN
|
||||
= \a,n -> AdjCN (PositA a) (UseN n) ;
|
||||
mod : AP -> CN -> CN
|
||||
= \a,n -> AdjCN a n ;
|
||||
mod : AdA -> A -> AP
|
||||
= \m,a -> AdAP m (PositA a) ;
|
||||
|
||||
mod : Det -> N -> NP
|
||||
= \d,n -> DetCN d (UseN n) ;
|
||||
mod : Det -> CN -> NP
|
||||
= \d,n -> DetCN d n ;
|
||||
mod : Quant -> N -> NP
|
||||
= \q,n -> DetCN (DetQuant (q) NumSg) (UseN n) ;
|
||||
mod : Quant -> CN -> NP
|
||||
= \q,n -> DetCN (DetQuant (q) NumSg) n ;
|
||||
mod : Predet -> N -> NP
|
||||
= \q,n -> PredetNP q (DetArtPl (IndefArt) (UseN n)) ;
|
||||
mod : Numeral -> N -> NP
|
||||
= \nu,n -> DetCN (DetArtCard (IndefArt) (NumNumeral nu)) (UseN n)
|
||||
|
||||
} ;
|
||||
|
||||
neg = overload {
|
||||
neg : Imp -> Utt
|
||||
= UttImpSg PNeg ;
|
||||
neg : Cl -> S
|
||||
= UseCl TPres ASimul PNeg;
|
||||
neg : QCl -> QS
|
||||
= UseQCl TPres ASimul PNeg;
|
||||
neg : RCl -> RS
|
||||
= UseRCl TPres ASimul PNeg
|
||||
};
|
||||
|
||||
-- This is not in ground API, because it would destroy parsing.
|
||||
|
||||
appendText : Text -> Text -> Text
|
||||
= \x,y -> {s = x.s ++ y.s ; lock_Text = <>} ;
|
||||
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsAra = Combinators with (Grammar = GrammarAra) ;
|
||||
@@ -1,3 +0,0 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsBul = Combinators with (Grammar = GrammarBul) ;
|
||||
@@ -1,3 +0,0 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsCat = Combinators with (Grammar = GrammarCat) ;
|
||||
@@ -1,3 +0,0 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsDan = Combinators with (Grammar = GrammarDan) ;
|
||||
@@ -1,3 +0,0 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsEng = Combinators with (Grammar = GrammarEng) ;
|
||||
@@ -1,3 +0,0 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsFin = Combinators with (Grammar = GrammarFin) ;
|
||||
@@ -1,3 +0,0 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsFre = Combinators with (Grammar = GrammarFre) ;
|
||||
@@ -1,3 +0,0 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsGer = Combinators with (Grammar = GrammarGer) ;
|
||||
@@ -1,3 +0,0 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsHin = Combinators with (Grammar = GrammarHin) ;
|
||||
@@ -1,3 +0,0 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsIna = Combinators with (Grammar = GrammarIna) ;
|
||||
@@ -1,3 +0,0 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsIta = Combinators with (Grammar = GrammarIta) ;
|
||||
@@ -1,3 +0,0 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsNor = Combinators with (Grammar = GrammarNor) ;
|
||||
@@ -1,3 +0,0 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsRus = Combinators with (Grammar = GrammarRus) ;
|
||||
@@ -1,3 +0,0 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsSpa = Combinators with (Grammar = GrammarSpa) ;
|
||||
@@ -1,3 +0,0 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsSwe = Combinators with (Grammar = GrammarSwe) ;
|
||||
@@ -1,3 +0,0 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsTha = Combinators with (Grammar = GrammarTha) ;
|
||||
@@ -1,4 +0,0 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
instance SyntaxCat of Syntax = ConstructorsCat, CatCat, StructuralCat, CombinatorsCat ;
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource TryEng = SyntaxEng, LexiconEng, ParadigmsEng - [mkAdv] **
|
||||
open (P = ParadigmsEng) in {
|
||||
|
||||
oper
|
||||
|
||||
mkAdv = overload SyntaxEng {
|
||||
mkAdv : Str -> Adv = P.mkAdv ;
|
||||
} ;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
concrete QuestionAra of Question = CatAra ** open ResAra, ParamX in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
QuestCl cl = {
|
||||
s = \\t,p =>
|
||||
table {
|
||||
QIndir => "إِذا" ++ cl.s ! t ! p ! Verbal ;
|
||||
QDir => cl.s ! t ! p ! Verbal
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
--
|
||||
-- QuestVP qp vp =
|
||||
-- let cl = mkClause (qp.s ! Nom) {n = qp.n ; p = P3} vp
|
||||
-- in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! ODir} ;
|
||||
--
|
||||
-- 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
|
||||
-- }
|
||||
-- } ;
|
||||
--
|
||||
-- QuestIAdv iadv cl = {
|
||||
-- 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
|
||||
-- } ;
|
||||
--
|
||||
-- IDetCN idet num ord cn = {
|
||||
-- s = \\c => idet.s ++ num.s ++ ord.s ++ cn.s ! idet.n ! c ;
|
||||
-- n = idet.n
|
||||
-- } ;
|
||||
--
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
--# -path=.:../romance:../abstract:../common:prelude
|
||||
|
||||
concrete CatCat of Cat = CommonX - [Tense,TPres,TPast,TFut,TCond] ** CatRomance with -- JS restore TPast for notpresent
|
||||
(ResRomance = ResCat) ;
|
||||
@@ -1,160 +0,0 @@
|
||||
--# -path=.:../romance:../common:../../prelude
|
||||
|
||||
--1 A Simple Catalan Resource Morphology
|
||||
--
|
||||
-- Aarne Ranta 2002 -- 2005
|
||||
-- Jordi Saludes 2008: Derived from MorphoSpa.
|
||||
--
|
||||
-- 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 ; coding=utf8 ;
|
||||
|
||||
--2 Nouns
|
||||
--
|
||||
-- The following macro is useful for creating the forms of number-dependent
|
||||
-- tables, such as common nouns.
|
||||
-- gcc M2.3
|
||||
oper
|
||||
numForms : (_,_ : Str) -> Number => Str = \vi, vins ->
|
||||
table {Sg => vi ; Pl => vins} ;
|
||||
|
||||
nomCep : Str -> Number => Str = \cep ->
|
||||
numForms cep (cep + "s") ;
|
||||
|
||||
|
||||
nomCasa : Str -> Str -> Number => Str = \es,casa ->
|
||||
numForms casa (init casa + es) ;
|
||||
|
||||
nomFre : Str -> Number => Str = \fre ->
|
||||
numForms fre (fre + "ns") ;
|
||||
|
||||
nomCas : Str -> Number => Str = \cas ->
|
||||
numForms cas (cas + "os") ;
|
||||
|
||||
nomTest : Str -> Number => Str = \test ->
|
||||
numForms test (variants {test + "s"; test + "os"}) ;
|
||||
|
||||
nomFaig : Str -> Number => Str = \faig ->
|
||||
let
|
||||
fa = Predef.tk 2 faig
|
||||
in
|
||||
numForms faig (variants {fa + "jos" ; faig + "s"}) ;
|
||||
|
||||
nomDesig : Str -> Number => Str = \desig ->
|
||||
let
|
||||
desi = Predef.tk 1 desig
|
||||
in
|
||||
numForms desig (variants {desi + "tjos" ; desi + "gs"}) ;
|
||||
|
||||
nomTemps : Str -> Number => Str = \temps ->
|
||||
numForms temps temps ;
|
||||
|
||||
-- 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 ->
|
||||
let
|
||||
mkNounMas : (Str -> Number => Str) -> Noun = \rule -> mkNoun (rule noi) Masc
|
||||
in
|
||||
case last noi of {
|
||||
"a" => mkNoun (nomCasa "es" noi) Fem ;
|
||||
"s"|"x"|"ç" => mkNounMas nomCas ;
|
||||
"i"|"e" => mkNounMas nomFre ;
|
||||
"í" => mkNounMas (nomCasa "ins") ;
|
||||
"à" => mkNounMas (nomCasa "ans") ;
|
||||
"ó" => mkNounMas (nomCasa "ons") ;
|
||||
"g" => mkNounMas nomFaig ;
|
||||
_ => mkNounMas nomCep
|
||||
} ;
|
||||
|
||||
--2 Adjectives
|
||||
--
|
||||
-- Adjectives are conveniently seen as gender-dependent nouns.
|
||||
-- Here are some patterns. First one that describes the worst case.
|
||||
-- gcc M2.1
|
||||
|
||||
mkAdj : (_,_,_,_,_ : Str) -> Adj = \prim,prima,prims,primes,primament ->
|
||||
{s = table {
|
||||
AF Masc n => numForms prim prims ! n ;
|
||||
AF Fem n => numForms prima primes ! n ;
|
||||
AA => primament
|
||||
}
|
||||
} ;
|
||||
|
||||
--- Then the regular and invariant patterns.
|
||||
|
||||
adjPrim : Str -> Adj = \prim ->
|
||||
mkAdj prim (prim + "a") (prim + "s") (prim + "es") (prim + "ament") ;
|
||||
|
||||
adjBlau : Str -> Str -> Adj = \blau,blava ->
|
||||
let
|
||||
blav = Predef.tk 1 blava
|
||||
in
|
||||
mkAdj blau blava (blau + "s") (blav + "es") (blava + "ment") ;
|
||||
|
||||
adjFondo : Str -> Adj = \fondo ->
|
||||
let
|
||||
fond = Predef.tk 1 fondo
|
||||
in
|
||||
adjBlau fondo (fond + "a") ;
|
||||
|
||||
adjBo : Str -> Adj = \bo ->
|
||||
mkAdj bo (bo + "na") (bo + "ns") (bo + "nes") (bo + "nament") ;
|
||||
|
||||
adjFidel : Str -> Adj = \fidel ->
|
||||
let
|
||||
fidels = fidel + "s"
|
||||
in
|
||||
mkAdj fidel fidel fidels fidels (fidel + "ment") ;
|
||||
|
||||
mkAdjReg : Str -> Adj = \prim ->
|
||||
case last prim of {
|
||||
"e"|"u"|"o" => adjFondo prim ;
|
||||
_ => adjPrim prim
|
||||
} ;
|
||||
|
||||
|
||||
--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 ->
|
||||
{s = table {
|
||||
Ton Nom => il ;
|
||||
Ton x => prepCase x ++ Lui ;
|
||||
Aton Nom => strOpt il ; ---- [] ;
|
||||
Aton Acc => le ;
|
||||
Aton (CPrep P_a) => lui ;
|
||||
Aton q => prepCase q ++ Lui ; ---- GF bug with c or p!
|
||||
Poss Masc Sg => son ;
|
||||
Poss Fem Sg => sa ;
|
||||
Poss Masc Pl => ses ;
|
||||
Poss Fem Pl => 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 = \tal,g,n -> tal.s ! AF g n ;
|
||||
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
runghc hindi/Deva.hs $1
|
||||
@@ -1,197 +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 = ResEng ** 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 : Str ; n : Number} = \n,s ->
|
||||
{s = 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 [] ;
|
||||
|
||||
|
||||
} ;
|
||||
|
||||
@@ -1,131 +0,0 @@
|
||||
concrete StructuralEng of Structural = CatEng **
|
||||
open MorphoEng, (P = ParadigmsEng), Prelude in {
|
||||
|
||||
flags optimize=all ;
|
||||
|
||||
lin
|
||||
above_Prep = ss "above" ;
|
||||
after_Prep = ss "after" ;
|
||||
all_Predet = ss "all" ;
|
||||
almost_AdA, almost_AdN = ss "almost" ;
|
||||
although_Subj = ss "although" ;
|
||||
always_AdV = ss "always" ;
|
||||
and_Conj = sd2 [] "and" ** {n = Pl} ;
|
||||
---b and_Conj = ss "and" ** {n = Pl} ;
|
||||
because_Subj = ss "because" ;
|
||||
before_Prep = ss "before" ;
|
||||
behind_Prep = ss "behind" ;
|
||||
between_Prep = ss "between" ;
|
||||
both7and_DConj = sd2 "both" "and" ** {n = Pl} ;
|
||||
but_PConj = ss "but" ;
|
||||
by8agent_Prep = ss "by" ;
|
||||
by8means_Prep = ss "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 = ss "during" ;
|
||||
either7or_DConj = sd2 "either" "or" ** {n = Sg} ;
|
||||
everybody_NP = regNP "everybody" Sg ;
|
||||
every_Det = mkDeterminer Sg "every" ;
|
||||
everything_NP = regNP "everything" Sg ;
|
||||
everywhere_Adv = ss "everywhere" ;
|
||||
few_Det = mkDeterminer Pl "few" ;
|
||||
--- first_Ord = ss "first" ; DEPRECATED
|
||||
for_Prep = ss "for" ;
|
||||
from_Prep = ss "from" ;
|
||||
he_Pron = mkNP "he" "him" "his" Sg P3 Masc ;
|
||||
here_Adv = ss "here" ;
|
||||
here7to_Adv = ss ["to here"] ;
|
||||
here7from_Adv = ss ["from here"] ;
|
||||
how_IAdv = ss "how" ;
|
||||
how8many_IDet = mkDeterminer Pl ["how many"] ;
|
||||
if_Subj = ss "if" ;
|
||||
in8front_Prep = ss ["in front of"] ;
|
||||
i_Pron = mkNP "I" "me" "my" Sg P1 Masc ;
|
||||
in_Prep = ss "in" ;
|
||||
it_Pron = mkNP "it" "it" "its" Sg P3 Neutr ;
|
||||
less_CAdv = ss "less" ;
|
||||
many_Det = mkDeterminer Pl "many" ;
|
||||
more_CAdv = ss "more" ;
|
||||
most_Predet = ss "most" ;
|
||||
much_Det = mkDeterminer Sg "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 = ss "on" ;
|
||||
---- one_Quant = mkDeterminer Sg "one" ; -- DEPRECATED
|
||||
only_Predet = ss "only" ;
|
||||
or_Conj = sd2 [] "or" ** {n = Sg} ;
|
||||
otherwise_PConj = ss "otherwise" ;
|
||||
part_Prep = ss "of" ;
|
||||
please_Voc = ss "please" ;
|
||||
possess_Prep = ss "of" ;
|
||||
quite_Adv = ss "quite" ;
|
||||
she_Pron = mkNP "she" "her" "her" Sg P3 Fem ;
|
||||
so_AdA = ss "so" ;
|
||||
somebody_NP = regNP "somebody" Sg ;
|
||||
someSg_Det = mkDeterminer Sg "some" ;
|
||||
somePl_Det = mkDeterminer Pl "some" ;
|
||||
something_NP = regNP "something" Sg ;
|
||||
somewhere_Adv = ss "somewhere" ;
|
||||
that_Quant = mkQuant "that" "those" ;
|
||||
there_Adv = ss "there" ;
|
||||
there7to_Adv = ss "there" ;
|
||||
there7from_Adv = ss ["from there"] ;
|
||||
therefore_PConj = ss "therefore" ;
|
||||
they_Pron = mkNP "they" "them" "their" Pl P3 Masc ; ----
|
||||
this_Quant = mkQuant "this" "these" ;
|
||||
through_Prep = ss "through" ;
|
||||
too_AdA = ss "too" ;
|
||||
to_Prep = ss "to" ;
|
||||
under_Prep = ss "under" ;
|
||||
very_AdA = ss "very" ;
|
||||
want_VV = P.mkVV (P.regV "want") ;
|
||||
we_Pron = mkNP "we" "us" "our" Pl P1 Masc ;
|
||||
whatPl_IP = mkIP "what" "what" "what's" Pl ;
|
||||
whatSg_IP = mkIP "what" "what" "what's" Sg ;
|
||||
when_IAdv = ss "when" ;
|
||||
when_Subj = ss "when" ;
|
||||
where_IAdv = ss "where" ;
|
||||
which_IQuant = {s = \\_ => "which"} ;
|
||||
---b whichPl_IDet = mkDeterminer Pl ["which"] ;
|
||||
---b whichSg_IDet = mkDeterminer Sg ["which"] ;
|
||||
whoPl_IP = mkIP "who" "whom" "whose" Pl ;
|
||||
whoSg_IP = mkIP "who" "whom" "whose" Sg ;
|
||||
why_IAdv = ss "why" ;
|
||||
without_Prep = ss "without" ;
|
||||
with_Prep = ss "with" ;
|
||||
---b yes_Phr = ss "yes" ;
|
||||
yes_Utt = ss "yes" ;
|
||||
youSg_Pron = mkNP "you" "you" "your" Sg P2 Masc ;
|
||||
youPl_Pron = mkNP "you" "you" "your" Pl P2 Masc ;
|
||||
youPol_Pron = mkNP "you" "you" "your" Sg P2 Masc ;
|
||||
|
||||
|
||||
oper
|
||||
mkQuant : Str -> Str -> {s : Number => Str} = \x,y -> {
|
||||
s = table Number [x ; y]
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,222 +0,0 @@
|
||||
-- Adjective
|
||||
|
||||
PositA warm_A
|
||||
ComparA warm_A (UsePron i_Pron)
|
||||
ComplA2 married_A2 (UsePron she_Pron)
|
||||
ComplA2 married_A2 (DetNP (DetQuant (PossPron she_Pron) NumPl))
|
||||
ComplA2 married_A2 (DetNP (DetQuant (PossPron she_Pron) NumSg))
|
||||
ReflA2 married_A2
|
||||
PositA (UseA2 married_A2)
|
||||
SentAP (PositA good_A) (EmbedS (UseCl TPres ASimul PPos (PredVP (UsePron she_Pron) (UseComp (CompAdv here_Adv)))))
|
||||
AdAP very_AdA (PositA warm_A)
|
||||
|
||||
|
||||
-- Adverb
|
||||
|
||||
PositAdvAdj warm_A
|
||||
PrepNP in_Prep (DetArtSg DefArt (UseN house_N))
|
||||
ComparAdvAdj more_CAdv warm_A (UsePN john_PN)
|
||||
ComparAdvAdjS more_CAdv warm_A (UseCl TPres ASimul PPos (PredVP (UsePron he_Pron) (UseV run_V)))
|
||||
SubjS when_Subj (UseCl TPres ASimul PPos (PredVP (UsePron she_Pron) (UseV sleep_V)))
|
||||
AdNum (AdnCAdv more_CAdv) (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n5))))))
|
||||
|
||||
|
||||
-- Conjunction
|
||||
|
||||
ConjS and_Conj (BaseS (UseCl TPres ASimul PPos (PredVP (UsePron he_Pron) (UseV walk_V))) (UseCl TPres ASimul PPos (PredVP (UsePron she_Pron) (UseV run_V))))
|
||||
ConjAP and_Conj (BaseAP (PositA cold_A) (PositA warm_A))
|
||||
ConjNP or_Conj (BaseNP (UsePron she_Pron) (UsePron we_Pron))
|
||||
ConjAdv or_Conj (BaseAdv here_Adv there_Adv)
|
||||
ConjS either7or_DConj (BaseS (UseCl TPres ASimul PPos (PredVP (UsePron he_Pron) (UseV walk_V))) (UseCl TPres ASimul PPos (PredVP (UsePron she_Pron) (UseV run_V))))
|
||||
ConjAP both7and_DConj (BaseAP (PositA warm_A) (PositA cold_A))
|
||||
ConjNP either7or_DConj (BaseNP (UsePron he_Pron) (UsePron she_Pron))
|
||||
ConjAdv both7and_DConj (BaseAdv here_Adv there_Adv)
|
||||
|
||||
-- Idiom
|
||||
|
||||
ImpersCl (UseComp (CompAP (PositA hot_A)))
|
||||
GenericCl (UseV sleep_V)
|
||||
CleftNP (UsePron i_Pron) (UseRCl TPast ASimul PPos (RelVP IdRP (ComplSlash (SlashV2a do_V2) (UsePron it_Pron))))
|
||||
CleftAdv here_Adv (UseCl TPast ASimul PPos (PredVP (UsePron she_Pron) (UseV sleep_V)))
|
||||
ExistNP (DetArtSg IndefArt (UseN house_N))
|
||||
ExistIP (IdetCN (IdetQuant which_IQuant NumPl) (UseN house_N))
|
||||
PredVP (UsePron i_Pron) (ProgrVP (UseV sleep_V))
|
||||
ImpPl1 (UseV go_V)
|
||||
|
||||
-- Noun
|
||||
|
||||
DetArtSg DefArt (UseN man_N)
|
||||
UsePN john_PN
|
||||
UsePron he_Pron
|
||||
PredetNP only_Predet (DetArtSg DefArt (UseN man_N))
|
||||
PPartNP (DetArtSg DefArt (UseN man_N)) see_V2
|
||||
AdvNP (UsePN paris_PN) today_Adv
|
||||
RelNP (UsePN paris_PN) (UseRCl TPres ASimul PPos (RelVP IdRP (UseComp (CompAdv here_Adv))))
|
||||
DetNP (DetQuant this_Quant (NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n5))))))))
|
||||
DetCN (DetQuantOrd this_Quant (NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n5))))))) (OrdSuperl good_A)) (UseN man_N)
|
||||
DetCN (DetQuant this_Quant (NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n5)))))))) (UseN man_N)
|
||||
DetCN (DetQuant this_Quant NumPl) (UseN man_N)
|
||||
DetCN (DetQuant this_Quant NumSg) (UseN man_N)
|
||||
NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n5))))))
|
||||
NumCard (NumDigits (IIDig D_5 (IDig D_1)))
|
||||
NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot1plus n5 pot01)))))
|
||||
NumCard (AdNum almost_AdN (NumDigits (IIDig D_5 (IDig D_1))))
|
||||
OrdDigits (IIDig D_5 (IDig D_1))
|
||||
OrdNumeral (num (pot2as3 (pot1as2 (pot1plus n5 pot01))))
|
||||
OrdSuperl warm_A
|
||||
DetCN (DetArtOrd DefArt (NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n5))))))) (OrdSuperl good_A)) (UseN man_N)
|
||||
DetCN (DetArtCard DefArt (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n5))))))) (UseN man_N)
|
||||
DetCN (DetArtCard IndefArt (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (UseN man_N)
|
||||
DetCN (DetArtCard DefArt (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (UseN man_N)
|
||||
DetArtSg DefArt (UseN man_N)
|
||||
DetArtPl DefArt (UseN man_N)
|
||||
MassNP (UseN beer_N)
|
||||
DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN house_N)
|
||||
UseN house_N
|
||||
ComplN2 mother_N2 (DetArtSg DefArt (UseN king_N))
|
||||
ComplN2 (ComplN3 distance_N3 (DetCN (DetQuant this_Quant NumSg) (UseN city_N))) (UsePN paris_PN)
|
||||
UseN2 mother_N2
|
||||
ComplN2 (Use2N3 distance_N3) (DetCN (DetQuant this_Quant NumSg) (UseN city_N))
|
||||
ComplN2 (Use3N3 distance_N3) (UsePN paris_PN)
|
||||
UseN2 (Use2N3 distance_N3)
|
||||
AdjCN (PositA big_A) (UseN house_N)
|
||||
RelCN (UseN house_N) (UseRCl TPast ASimul PPos (RelSlash IdRP (SlashVP (UsePN john_PN) (SlashV2a buy_V2))))
|
||||
AdvCN (UseN house_N) (PrepNP on_Prep (DetArtSg DefArt (UseN hill_N)))
|
||||
SentCN (UseN question_N) (EmbedQS (UseQCl TPres ASimul PPos (QuestIAdv where_IAdv (PredVP (UsePron she_Pron) (UseV sleep_V)))))
|
||||
DetArtSg DefArt (ApposCN (UseN city_N) (UsePN paris_PN))
|
||||
DetCN (DetQuant (PossPron i_Pron) NumSg) (ApposCN (UseN friend_N) (UsePN john_PN))
|
||||
|
||||
-- Numeral
|
||||
|
||||
num (pot2as3 (pot1as2 (pot0as1 (pot0 n6))))
|
||||
num (pot2as3 (pot1as2 (pot0as1 pot01)))
|
||||
num (pot2as3 (pot1as2 (pot1 n6)))
|
||||
num (pot2as3 (pot1as2 pot110))
|
||||
num (pot2as3 (pot1as2 pot111))
|
||||
num (pot2as3 (pot1as2 (pot1to19 n6)))
|
||||
num (pot2as3 (pot1as2 (pot1 n6)))
|
||||
num (pot2as3 (pot1as2 (pot1plus n6 (pot0 n5))))
|
||||
num (pot2as3 (pot2 (pot0 n4)))
|
||||
num (pot2as3 (pot2plus (pot0 n4) (pot1plus n6 (pot0 n7))))
|
||||
num (pot3 (pot2plus (pot0 n4) (pot1plus n6 (pot0 n7))))
|
||||
num (pot3plus (pot2plus (pot0 n4) (pot1plus n6 (pot0 n7))) (pot1as2 (pot1plus n8 (pot0 n9))))
|
||||
IDig D_8
|
||||
IIDig D_8 (IIDig D_0 (IIDig D_0 (IIDig D_1 (IIDig D_7 (IIDig D_8 (IDig D_9))))))
|
||||
|
||||
|
||||
-- Phrase
|
||||
|
||||
PhrUtt but_PConj (UttImpSg PPos (ImpVP (AdvVP (UseV come_V) here_Adv))) (VocNP (DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN friend_N)))
|
||||
PhrUtt NoPConj (UttS (UseCl TPres ASimul PPos (PredVP (UsePN john_PN) (UseV walk_V)))) NoVoc
|
||||
UttQS (UseQCl TPres ASimul PPos (QuestCl (PredVP (UsePron it_Pron) (UseComp (CompAP (PositA good_A))))))
|
||||
UttImpSg PNeg (ImpVP (ReflVP (SlashV2a love_V2)))
|
||||
UttImpPl PNeg (ImpVP (ReflVP (SlashV2a love_V2)))
|
||||
UttImpPol PNeg (ImpVP (UseV sleep_V))
|
||||
UttIP whoPl_IP
|
||||
UttIP whoSg_IP
|
||||
UttIAdv why_IAdv
|
||||
UttNP (DetCN (DetQuant this_Quant NumSg) (UseN man_N))
|
||||
UttAdv here_Adv
|
||||
UttVP (UseV sleep_V)
|
||||
VocNP (DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN friend_N))
|
||||
|
||||
|
||||
-- Question
|
||||
|
||||
QuestCl (PredVP (UsePN john_PN) (UseV walk_V))
|
||||
QuestVP whoSg_IP (UseV walk_V)
|
||||
QuestSlash whoSg_IP (SlashVP (UsePN john_PN) (SlashV2a love_V2))
|
||||
QuestIAdv why_IAdv (PredVP (UsePN john_PN) (UseV walk_V))
|
||||
QuestIComp (CompIAdv where_IAdv) (UsePN john_PN)
|
||||
IdetCN (IdetQuant which_IQuant (NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n5)))))))) (UseN song_N)
|
||||
IdetIP (IdetQuant which_IQuant (NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n5))))))))
|
||||
AdvIP whoSg_IP (PrepNP in_Prep (UsePN paris_PN))
|
||||
IdetIP (IdetQuant which_IQuant NumSg)
|
||||
PrepIP with_Prep whoSg_IP
|
||||
QuestIComp (CompIAdv where_IAdv) (UsePron it_Pron)
|
||||
QuestIComp (CompIP whoSg_IP) (UsePron it_Pron)
|
||||
|
||||
|
||||
-- Relative
|
||||
|
||||
ExistNP (DetArtSg IndefArt (RelCN (UseN woman_N) (UseRCl TPres ASimul PPos (RelCl (PredVP (UsePN john_PN) (ComplSlash (SlashV2a love_V2) (UsePron she_Pron)))))))
|
||||
ExistNP (DetArtSg IndefArt (RelCN (UseN woman_N) (UseRCl TPres ASimul PPos (RelVP IdRP (ComplSlash (SlashV2a love_V2) (UsePN john_PN))))))
|
||||
ExistNP (DetArtSg IndefArt (RelCN (UseN woman_N) (UseRCl TPres ASimul PPos (RelSlash IdRP (SlashVP (UsePN john_PN) (SlashV2a love_V2))))))
|
||||
ExistNP (DetArtSg IndefArt (RelCN (UseN woman_N) (UseRCl TPres ASimul PPos (RelSlash (FunRP possess_Prep (DetArtSg DefArt (UseN2 mother_N2)) IdRP) (SlashVP (UsePN john_PN) (SlashV2a love_V2))))))
|
||||
|
||||
-- Sentence
|
||||
|
||||
PredVP (UsePN john_PN) (UseV walk_V)
|
||||
PredSCVP (EmbedS (UseCl TPres ASimul PPos (PredVP (UsePron she_Pron) (UseV go_V)))) (UseComp (CompAP (PositA good_A)))
|
||||
RelCN (UseN girl_N) (UseRCl TPres ASimul PPos (RelSlash IdRP (SlashVP (UsePron he_Pron) (SlashV2a see_V2))))
|
||||
RelCN (UseN girl_N) (UseRCl TPres ASimul PPos (RelSlash IdRP (AdvSlash (SlashVP (UsePron he_Pron) (SlashV2a see_V2)) today_Adv)))
|
||||
RelCN (UseN girl_N) (UseRCl TPres ASimul PPos (RelSlash IdRP (SlashPrep (PredVP (UsePron he_Pron) (UseV walk_V)) with_Prep)))
|
||||
RelCN (UseN girl_N) (UseRCl TPres ASimul PPos (RelSlash IdRP (SlashVS (UsePron she_Pron) say_VS (UseSlash TPres ASimul PPos (SlashVP (UsePron he_Pron) (SlashV2a love_V2))))))
|
||||
ImpVP (ReflVP (SlashV2a love_V2))
|
||||
EmbedS (UseCl TPres ASimul PPos (PredVP (UsePron she_Pron) (UseV go_V)))
|
||||
EmbedQS (UseQCl TPres ASimul PPos (QuestVP whoSg_IP (UseV go_V)))
|
||||
EmbedVP (UseV go_V)
|
||||
UseCl TCond AAnter PNeg (PredVP (UsePN john_PN) (UseV walk_V))
|
||||
UseQCl TCond AAnter PNeg (QuestCl (PredVP (UsePN john_PN) (UseV walk_V)))
|
||||
RelCN (UseN girl_N) (UseRCl TCond AAnter PNeg (RelVP IdRP (UseV walk_V)))
|
||||
RelCN (UseN girl_N) (UseRCl TCond AAnter PNeg (RelSlash IdRP (SlashPrep (PredVP (UsePron i_Pron) (UseV walk_V)) with_Prep)))
|
||||
RelS (UseCl TPres ASimul PPos (PredVP (UsePron she_Pron) (UseV sleep_V))) (UseRCl TPres ASimul PPos (RelVP IdRP (UseComp (CompAP (PositA good_A)))))
|
||||
|
||||
|
||||
-- Text
|
||||
|
||||
TEmpty
|
||||
TFullStop (PhrUtt NoPConj (UttS (UseCl TPres ASimul PPos (PredVP (UsePN john_PN) (UseV walk_V)))) NoVoc) TEmpty
|
||||
TQuestMark (PhrUtt NoPConj (UttQS (UseQCl TPres ASimul PPos (QuestCl (PredVP (UsePron they_Pron) (UseComp (CompAdv here_Adv)))))) NoVoc) TEmpty
|
||||
TExclMark (PhrUtt NoPConj (ImpPl1 (UseV go_V)) NoVoc) TEmpty
|
||||
|
||||
-- Verb
|
||||
|
||||
PredVP (UsePron i_Pron) (UseV sleep_V)
|
||||
PredVP (UsePron i_Pron) (ComplVV want_VV (UseV run_V))
|
||||
PredVP (UsePron i_Pron) (ComplVS say_VS (UseCl TPres ASimul PPos (PredVP (UsePron she_Pron) (UseV run_V))))
|
||||
PredVP (UsePron i_Pron) (ComplVQ wonder_VQ (UseQCl TPres ASimul PPos (QuestVP whoSg_IP (UseV run_V))))
|
||||
PredVP (UsePron they_Pron) (ComplVA become_VA (PositA red_A))
|
||||
PredVP (UsePron i_Pron) (ComplSlash (Slash3V3 give_V3 (UsePron he_Pron)) (UsePron it_Pron))
|
||||
PredVP (UsePron i_Pron) (ComplSlash (SlashV2V beg_V2V (UseV go_V)) (UsePron she_Pron))
|
||||
PredVP (UsePron i_Pron) (ComplSlash (SlashV2S answer_V2S (UseCl TPres ASimul PPos (PredVP (UsePron it_Pron) (UseComp (CompAP (PositA good_A)))))) (UsePron he_Pron))
|
||||
PredVP (UsePron i_Pron) (ComplSlash (SlashV2Q ask_V2Q (UseQCl TPast ASimul PPos (QuestVP whoSg_IP (UseV come_V)))) (UsePron he_Pron))
|
||||
PredVP (UsePron i_Pron) (ComplSlash (SlashV2A paint_V2A (PositA red_A)) (UsePron it_Pron))
|
||||
RelCN (UseN car_N) (UseRCl TPres ASimul PPos (RelSlash IdRP (SlashVP (UsePron i_Pron) (SlashVV want_VV (SlashV2a buy_V2)))))
|
||||
RelCN (UseN car_N) (UseRCl TPres ASimul PPos (RelSlash IdRP (SlashVP (UsePron they_Pron) (SlashV2VNP beg_V2V (UsePron i_Pron) (SlashV2a buy_V2)))))
|
||||
PredVP (UsePron he_Pron) (ReflVP (SlashV2a love_V2))
|
||||
PredVP (DetNP (DetQuant this_Quant NumSg)) (UseComp (CompAP (PositA warm_A)))
|
||||
PredVP (UsePron we_Pron) (PassV2 love_V2)
|
||||
PredVP (UsePron we_Pron) (AdvVP (UseV sleep_V) here_Adv)
|
||||
PredVP (UsePron we_Pron) (AdVVP always_AdV (UseV sleep_V))
|
||||
PredVP (UsePron we_Pron) (UseComp (CompAP (PositA small_A)))
|
||||
PredVP (UsePron i_Pron) (UseComp (CompNP (DetArtSg IndefArt (UseN man_N))))
|
||||
PredVP (UsePron i_Pron) (UseComp (CompAdv here_Adv))
|
||||
|
||||
|
||||
|
||||
-- Janna's and Krasimir's long examples
|
||||
|
||||
RelCN (UseN car_N) (UseRCl TPres ASimul PPos (RelSlash IdRP (SlashVP (UsePron they_Pron) (SlashV2VNP beg_V2V (UsePron i_Pron) (SlashVV want_VV (SlashV2A paint_V2A (PositA red_A)))))))
|
||||
PhrUtt NoPConj (UttImpSg PPos (ImpVP (AdVVP always_AdV (ComplSlash (SlashV2a listen_V2) (DetArtSg DefArt (UseN sea_N)))))) NoVoc
|
||||
PhrUtt NoPConj (UttS (UseCl TPres ASimul PPos (ExistNP (PredetNP only_Predet (DetCN (DetArtCard IndefArt (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n2))))))) (AdvCN (RelCN (UseN woman_N) (UseRCl TCond ASimul PPos (RelSlash IdRP (SlashPrep (PredVP (UsePron i_Pron) (ComplVV want_VV (PassV2 see_V2))) with_Prep)))) (PrepNP in_Prep (DetArtSg DefArt (UseN rain_N))))))))) NoVoc
|
||||
PhrUtt NoPConj (UttImpSg PPos (ImpVP (ComplSlash (SlashV2A paint_V2A (ConjAP both7and_DConj (BaseAP (ComparA small_A (DetArtSg DefArt (UseN sun_N))) (ComparA big_A (DetArtSg DefArt (UseN moon_N)))))) (DetArtSg DefArt (UseN earth_N))))) NoVoc
|
||||
PhrUtt NoPConj (ImpPl1 (ComplVS hope_VS (ConjS either7or_DConj (BaseS (UseCl TPres ASimul PPos (PredVP (DetArtSg DefArt (ComplN2 father_N2 (DetArtSg DefArt (UseN baby_N)))) (UseV run_V))) (UseCl TPres ASimul PPos (PredVP (DetArtSg DefArt (UseN2 (Use2N3 distance_N3))) (UseComp (CompAP (PositA small_A))))))))) NoVoc
|
||||
PhrUtt NoPConj (UttS (UseCl TPres ASimul PPos (PredVP (DetCN every_Det (UseN baby_N)) (UseComp (CompNP (ConjNP either7or_DConj (BaseNP (DetArtSg IndefArt (UseN boy_N)) (DetArtSg IndefArt (UseN girl_N))))))))) NoVoc
|
||||
PhrUtt NoPConj (UttAdv (ConjAdv either7or_DConj (ConsAdv here7from_Adv (BaseAdv there_Adv everywhere_Adv)))) NoVoc
|
||||
PhrUtt NoPConj (UttVP (PassV2 know_V2)) NoVoc
|
||||
RelCN (UseN bird_N) (UseRCl TPres ASimul PPos (RelSlash IdRP (SlashVP (UsePron i_Pron) (SlashVV want_VV (SlashV2A paint_V2A (PositA red_A))))))
|
||||
UttImpSg PPos (ImpVP (ComplVV want_VV (ComplSlash (SlashV2a buy_V2) (UsePron it_Pron))))
|
||||
UttImpSg PPos (ImpVP (ComplVV want_VV (ComplSlash (SlashV2A paint_V2A (PositA red_A)) (UsePron it_Pron))))
|
||||
UttImpSg PPos (ImpVP (ComplSlash (SlashVV want_VV (SlashV2VNP beg_V2V (UsePron i_Pron) (SlashV2a buy_V2))) (UsePron it_Pron)))
|
||||
PhrUtt NoPConj (UttS (UseCl TPres ASimul PPos (PredVP (DetArtPl DefArt (UseN fruit_N)) (ReflVP (Slash3V3 sell_V3 (DetArtSg DefArt (UseN road_N))))))) NoVoc
|
||||
PhrUtt NoPConj (UttS (UseCl TPres ASimul PPos (PredVP (UsePron i_Pron) (ReflVP (SlashV2V beg_V2V (UseV live_V)))))) NoVoc
|
||||
PhrUtt NoPConj (UttS (UseCl TPres ASimul PPos (PredVP (UsePron i_Pron) (ReflVP (SlashV2S answer_V2S (UseCl TPres ASimul PPos (ImpersCl (ComplVV must_VV (ReflVP (SlashV2a understand_V2)))))))))) NoVoc
|
||||
PhrUtt NoPConj (UttImpSg PPos (ImpVP (ReflVP (SlashV2Q ask_V2Q (UseQCl TPast ASimul PPos (QuestVP whoSg_IP (UseV come_V))))))) NoVoc
|
||||
PhrUtt NoPConj (UttS (UseCl TPast ASimul PPos (PredVP (UsePron i_Pron) (ReflVP (SlashV2A paint_V2A (ComparA beautiful_A (UsePN john_PN))))))) NoVoc
|
||||
|
||||
-- more long examples
|
||||
|
||||
UttS (UseCl TPres ASimul PPos (PredVP (DetCN (DetQuant this_Quant NumSg) (UseN grammar_N)) (ComplSlash (SlashV2a speak_V2) (DetCN (DetArtCard IndefArt (NumNumeral (num (pot2as3 (pot1as2 (pot1to19 n2)))))) (UseN language_N)))))
|
||||
UseCl TPast AAnter PPos (PredVP (UsePron she_Pron) (ComplSlash (SlashV2a buy_V2) (DetArtSg IndefArt (AdjCN (PositA red_A) (UseN house_N)))))
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
--# -path=.:../romance:../common:../abstract:../common:prelude
|
||||
|
||||
concrete CatFre of Cat = CommonX - [Tense,TPres,TPast,TFut,TCond] ** CatRomance with
|
||||
(ResRomance = ResFre) ;
|
||||
@@ -1,145 +0,0 @@
|
||||
import System
|
||||
|
||||
main = do
|
||||
s <- getContents
|
||||
let ofile = "devaout.html"
|
||||
writeFile ofile "<html><body>\n<p>\n"
|
||||
appendFile ofile $ udevap s
|
||||
appendFile ofile "\n<p></body></html>\n"
|
||||
system ("open " ++ ofile)
|
||||
|
||||
---main = interact udeva
|
||||
|
||||
udevap :: String -> String
|
||||
udevap = unlines . map (unwords . ("<p>":). map udevaWord . words) . lines
|
||||
|
||||
udeva :: String -> String
|
||||
udeva = unlines . map (unwords . map udevaWord . words) . lines
|
||||
|
||||
udevaGF :: String -> String
|
||||
udevaGF s = case s of
|
||||
'"':cs -> let (w,q:rest) = span (/='"') cs in '"' : udevaWord w ++ [q] ++ udevaGF rest
|
||||
c :cs -> c : udevaGF cs
|
||||
_ -> s
|
||||
|
||||
udevaWord = encodeUTF8 . str2deva
|
||||
|
||||
str2deva :: String -> String
|
||||
str2deva s = map toEnum $ case chop s of
|
||||
c:cs -> encodeInit c : map encode cs
|
||||
_ -> []
|
||||
|
||||
chop s = case s of
|
||||
['-'] -> [s]
|
||||
'-' :cs -> let (c:r) = chop cs in ('-':c) : r -- to force initial vowel
|
||||
'+' :cs -> let (c:r) = chop cs in ('+':c) : r -- to force non-initial vowel
|
||||
v:':':cs -> [v,':'] : chop cs
|
||||
v:'.':cs -> [v,'.'] : chop cs
|
||||
c:'a':cs -> [c] : chop cs
|
||||
c :cs -> [c] : chop cs
|
||||
_ -> []
|
||||
|
||||
encodeInit :: String -> Int
|
||||
encodeInit s = case s of
|
||||
'+':c -> encode c
|
||||
'-':c -> encodeInit c
|
||||
"a" -> 0x0905
|
||||
"a:" -> 0x0906
|
||||
"i" -> 0x0907
|
||||
"i:" -> 0x0908
|
||||
"u" -> 0x0909
|
||||
"u:" -> 0x090a
|
||||
"r:" -> 0x090b
|
||||
"e" -> 0x090f
|
||||
"E" -> 0x0910
|
||||
"o" -> 0x0913
|
||||
"O" -> 0x0914
|
||||
_ -> encode s
|
||||
|
||||
encode :: String -> Int
|
||||
encode s = case s of
|
||||
"k" -> 0x0915
|
||||
"K" -> 0x0916
|
||||
"g" -> 0x0917
|
||||
"G" -> 0x0918
|
||||
"N:" -> 0x0919
|
||||
|
||||
"c" -> 0x091a
|
||||
"C" -> 0x091b
|
||||
"j" -> 0x091c
|
||||
"J" -> 0x091d
|
||||
"n:" -> 0x091e
|
||||
|
||||
"t." -> 0x091f
|
||||
"T." -> 0x0920
|
||||
"d." -> 0x0921
|
||||
"D." -> 0x0922
|
||||
"n." -> 0x0923
|
||||
|
||||
"t" -> 0x0924
|
||||
"T" -> 0x0925
|
||||
"d" -> 0x0926
|
||||
"D" -> 0x0927
|
||||
"n" -> 0x0928
|
||||
|
||||
"p" -> 0x092a
|
||||
"P" -> 0x092b
|
||||
"b" -> 0x092c
|
||||
"B" -> 0x092d
|
||||
"m" -> 0x092e
|
||||
|
||||
"y" -> 0x092f
|
||||
"r" -> 0x0930
|
||||
"l" -> 0x0932
|
||||
"v" -> 0x0935
|
||||
|
||||
"S" -> 0x0936
|
||||
"s." -> 0x0937
|
||||
"s" -> 0x0938
|
||||
"h" -> 0x0939
|
||||
|
||||
"z" -> 0x095b
|
||||
"R" -> 0x095c
|
||||
|
||||
"a:" -> 0x093e
|
||||
"i" -> 0x093f
|
||||
"i:" -> 0x0940
|
||||
"u" -> 0x0941
|
||||
"u:" -> 0x0942
|
||||
"r:" -> 0x0943
|
||||
"e" -> 0x0947
|
||||
"E" -> 0x0948
|
||||
"o" -> 0x094b
|
||||
"O" -> 0x094c
|
||||
|
||||
"~" -> 0x0901
|
||||
"*" -> 0x0902
|
||||
|
||||
" " -> space
|
||||
"\n" -> fromEnum '\n'
|
||||
|
||||
'-':c -> encodeInit c
|
||||
'+':c -> encode c
|
||||
|
||||
_ -> 0x093e --- a:
|
||||
|
||||
|
||||
space = fromEnum ' '
|
||||
|
||||
|
||||
encodeUTF8 :: String -> String
|
||||
encodeUTF8 "" = ""
|
||||
encodeUTF8 (c:cs) =
|
||||
if c > '\x0000' && c < '\x0080' then
|
||||
c : encodeUTF8 cs
|
||||
else if c < toEnum 0x0800 then
|
||||
let i = fromEnum c
|
||||
in toEnum (0xc0 + i `div` 0x40) :
|
||||
toEnum (0x80 + i `mod` 0x40) :
|
||||
encodeUTF8 cs
|
||||
else
|
||||
let i = fromEnum c
|
||||
in toEnum (0xe0 + i `div` 0x1000) :
|
||||
toEnum (0x80 + (i `mod` 0x1000) `div` 0x40) :
|
||||
toEnum (0x80 + i `mod` 0x40) :
|
||||
encodeUTF8 cs
|
||||
@@ -1,131 +0,0 @@
|
||||
main = interact udeva
|
||||
|
||||
udeva :: String -> String
|
||||
udeva = unlines . map (unwords . map udevaWord . words) . lines
|
||||
|
||||
udevaGF :: String -> String
|
||||
udevaGF s = case s of
|
||||
'"':cs -> let (w,q:rest) = span (/='"') cs in '"' : udevaWord w ++ [q] ++ udevaGF rest
|
||||
c :cs -> c : udevaGF cs
|
||||
_ -> s
|
||||
|
||||
udevaWord = encodeUTF8 . str2deva
|
||||
|
||||
str2deva :: String -> String
|
||||
str2deva s = map toEnum $ case chop s of
|
||||
c:cs -> encodeInit c : map encode cs
|
||||
_ -> []
|
||||
|
||||
chop s = case s of
|
||||
['-'] -> [s]
|
||||
'-' :cs -> let (c:r) = chop cs in ('-':c) : r -- to force initial vowel
|
||||
'+' :cs -> let (c:r) = chop cs in ('+':c) : r -- to force non-initial vowel
|
||||
v:':':cs -> [v,':'] : chop cs
|
||||
v:'.':cs -> [v,'.'] : chop cs
|
||||
c:'a':cs -> [c] : chop cs
|
||||
c :cs -> [c] : chop cs
|
||||
_ -> []
|
||||
|
||||
encodeInit :: String -> Int
|
||||
encodeInit s = case s of
|
||||
'+':c -> encode c
|
||||
'-':c -> encodeInit c
|
||||
"a" -> 0x0905
|
||||
"a:" -> 0x0906
|
||||
"i" -> 0x0907
|
||||
"i:" -> 0x0908
|
||||
"u" -> 0x0909
|
||||
"u:" -> 0x090a
|
||||
"r:" -> 0x090b
|
||||
"e" -> 0x090f
|
||||
"E" -> 0x0910
|
||||
"o" -> 0x0913
|
||||
"O" -> 0x0914
|
||||
_ -> encode s
|
||||
|
||||
encode :: String -> Int
|
||||
encode s = case s of
|
||||
"k" -> 0x0915
|
||||
"K" -> 0x0916
|
||||
"g" -> 0x0917
|
||||
"G" -> 0x0918
|
||||
"N:" -> 0x0919
|
||||
|
||||
"c" -> 0x091a
|
||||
"C" -> 0x091b
|
||||
"j" -> 0x091c
|
||||
"J" -> 0x091d
|
||||
"n:" -> 0x091e
|
||||
|
||||
"t." -> 0x091f
|
||||
"T." -> 0x0920
|
||||
"d." -> 0x0921
|
||||
"D." -> 0x0922
|
||||
"n." -> 0x0923
|
||||
|
||||
"t" -> 0x0924
|
||||
"T" -> 0x0925
|
||||
"d" -> 0x0926
|
||||
"D" -> 0x0927
|
||||
"n" -> 0x0928
|
||||
|
||||
"p" -> 0x092a
|
||||
"P" -> 0x092b
|
||||
"b" -> 0x092c
|
||||
"B" -> 0x092d
|
||||
"m" -> 0x092e
|
||||
|
||||
"y" -> 0x092f
|
||||
"r" -> 0x0930
|
||||
"l" -> 0x0932
|
||||
"v" -> 0x0935
|
||||
|
||||
"S" -> 0x0936
|
||||
"s." -> 0x0937
|
||||
"s" -> 0x0938
|
||||
"h" -> 0x0939
|
||||
|
||||
"R" -> 0x095c
|
||||
|
||||
"a:" -> 0x093e
|
||||
"i" -> 0x093f
|
||||
"i:" -> 0x0940
|
||||
"u" -> 0x0941
|
||||
"u:" -> 0x0942
|
||||
"r:" -> 0x0943
|
||||
"e" -> 0x0947
|
||||
"E" -> 0x0948
|
||||
"o" -> 0x094b
|
||||
"O" -> 0x094c
|
||||
|
||||
"~" -> 0x0901
|
||||
"*" -> 0x0902
|
||||
|
||||
" " -> space
|
||||
"\n" -> fromEnum '\n'
|
||||
|
||||
'-':c -> encodeInit c
|
||||
'+':c -> encode c
|
||||
|
||||
_ -> 0x093e --- a:
|
||||
|
||||
|
||||
space = fromEnum ' '
|
||||
|
||||
|
||||
encodeUTF8 :: String -> String
|
||||
encodeUTF8 "" = ""
|
||||
encodeUTF8 (c:cs) =
|
||||
if c > '\x0000' && c < '\x0080' then
|
||||
c : encodeUTF8 cs
|
||||
else if c < toEnum 0x0800 then
|
||||
let i = fromEnum c
|
||||
in toEnum (0xc0 + i `div` 0x40) :
|
||||
toEnum (0x80 + i `mod` 0x40) :
|
||||
encodeUTF8 cs
|
||||
else
|
||||
let i = fromEnum c
|
||||
in toEnum (0xe0 + i `div` 0x1000) :
|
||||
toEnum (0x80 + (i `mod` 0x1000) `div` 0x40) :
|
||||
toEnum (0x80 + i `mod` 0x40) :
|
||||
encodeUTF8 cs
|
||||
@@ -1,19 +0,0 @@
|
||||
main = interact (concat . map mkOne . zip [10001..] . lines)
|
||||
|
||||
mkOne (i,line) = case line of
|
||||
'<':cs -> case pos line of
|
||||
"nuon" -> entry (show i) (word line) "N"
|
||||
"brev" -> entry (show i) (word line) "V"
|
||||
"evitcejda" -> entry (show i) (word line) "A"
|
||||
_ -> ""
|
||||
_ -> ""
|
||||
|
||||
pos line = case reverse line of
|
||||
'>':cs -> takeWhile (/='<') cs
|
||||
_ -> ""
|
||||
|
||||
word line = takeWhile (/='>') line
|
||||
|
||||
entry i w c =
|
||||
"fun w" ++ i ++ "_" ++ c ++ " : " ++ c ++ " ;\n" ++
|
||||
"lin w" ++ i ++ "_" ++ c ++ " = mk" ++ c ++ " \"" ++ w ++ "\" ;\n"
|
||||
@@ -1,551 +0,0 @@
|
||||
--# -path=.:..:../../abstract:../../common
|
||||
--
|
||||
----1 Hindi Lexical Paradigms
|
||||
|
||||
resource ParadigmsHin = open
|
||||
(Predef=Predef),
|
||||
Prelude,
|
||||
MorphoHin,
|
||||
CatHin
|
||||
in {
|
||||
|
||||
--2 Parameters
|
||||
|
||||
oper
|
||||
masculine : Gender ;
|
||||
feminine : Gender ;
|
||||
|
||||
masculine = Masc ; feminine = Fem ; --i
|
||||
|
||||
|
||||
--2 Nouns
|
||||
|
||||
mkN = overload {
|
||||
mkN : Str -> N
|
||||
= \s -> regNoun s ** {lock_N = <>} ;
|
||||
mkN : Str -> Gender -> N
|
||||
= \s,g -> reggNoun s g ** {lock_N = <>} ;
|
||||
mkN : (x1,_,_,_,_,x6 : Str) -> Gender -> N
|
||||
= \sd,so,sv,pd,po,pv,g -> mkNoun sd so sv pd po pv g ** {lock_N = <>} ;
|
||||
} ;
|
||||
|
||||
--2 Adjectives
|
||||
|
||||
mkA = overload {
|
||||
mkA : Str -> A
|
||||
= \s -> regAdjective s ** {lock_A = <>} ;
|
||||
mkA : (x1,_,x3 : Str) -> A
|
||||
= \msd,m,f -> mkAdjective msd m f ** {lock_A = <>} ;
|
||||
} ;
|
||||
|
||||
--2 Verbs
|
||||
|
||||
mkV = overload {
|
||||
mkV : Str -> V
|
||||
= \s -> regVerb s ** {lock_V = <>} ;
|
||||
mkV : (x1,_,_,_,_,_,_,_,_,_,_,_,_,_,x15 : Str) -> V
|
||||
= \inf,stem,ims,imp,ifs,ifp,pms,pmp,pfs,pfp,ss1,ss2,sp2,sp3,r ->
|
||||
mkVerb inf stem ims imp ifs ifp pms pmp pfs pfp ss1 ss2 sp2 sp3 r **
|
||||
{lock_V = <>} ;
|
||||
} ;
|
||||
|
||||
|
||||
mkV2 = overload {
|
||||
mkV2 : Str -> V2
|
||||
= \s -> regVerb s ** {c2 = {s = [] ; c = VTrans} ; lock_V2 = <>} ;
|
||||
mkV2 : V -> V2
|
||||
= \v -> v ** {c2 = {s = [] ; c = VTrans} ; lock_V2 = <>} ;
|
||||
mkV2 : V -> Str -> V2
|
||||
= \v,p -> v ** {c2 = {s = p ; c = VTransPost} ; lock_V2 = <>} ;
|
||||
} ;
|
||||
|
||||
|
||||
----3 Compound nouns
|
||||
----
|
||||
---- A compound noun is an uninflected string attached to an inflected noun,
|
||||
---- such as "baby boom", "chief executive officer".
|
||||
--
|
||||
-- mkN : Str -> N -> N
|
||||
-- } ;
|
||||
--
|
||||
--
|
||||
----3 Relational nouns
|
||||
----
|
||||
---- Relational nouns ("daughter of x") need a preposition.
|
||||
--
|
||||
-- mkN2 : N -> Prep -> N2 ;
|
||||
--
|
||||
---- The most common preposition is "of", and the following is a
|
||||
---- shortcut for regular relational nouns with "of".
|
||||
--
|
||||
-- regN2 : Str -> N2 ;
|
||||
--
|
||||
---- Use the function $mkPrep$ or see the section on prepositions below to
|
||||
---- form other prepositions.
|
||||
----
|
||||
---- Three-place relational nouns ("the connection from x to y") need two prepositions.
|
||||
--
|
||||
-- mkN3 : N -> Prep -> Prep -> N3 ;
|
||||
--
|
||||
--
|
||||
--
|
||||
----3 Proper names and noun phrases
|
||||
----
|
||||
---- Proper names, with a regular genitive, are formed from strings.
|
||||
--
|
||||
-- mkPN : overload {
|
||||
--
|
||||
-- mkPN : Str -> PN ;
|
||||
--
|
||||
---- Sometimes a common noun can be reused as a proper name, e.g. "Bank"
|
||||
--
|
||||
-- mkPN : N -> PN
|
||||
-- } ;
|
||||
--
|
||||
--
|
||||
----2 Adjectives
|
||||
--
|
||||
-- mkA : overload {
|
||||
--
|
||||
---- For regular adjectives, the adverbial and comparison forms are derived. This holds
|
||||
---- even for cases with the variations "happy - happily - happier - happiest",
|
||||
---- "free - freely - freer - freest", and "rude - rudest".
|
||||
--
|
||||
-- mkA : (happy : Str) -> A ;
|
||||
--
|
||||
---- However, the duplication of the final consonant cannot be predicted,
|
||||
---- but a separate case is used to give the comparative
|
||||
--
|
||||
-- mkA : (fat,fatter : Str) -> A ;
|
||||
--
|
||||
---- As many as four forms may be needed.
|
||||
--
|
||||
-- mkA : (good,better,best,well : Str) -> A
|
||||
-- } ;
|
||||
--
|
||||
---- To force comparison to be formed by "more - most",
|
||||
---- the following function is used:
|
||||
--
|
||||
-- compoundA : A -> A ; -- -/more/most ridiculous
|
||||
--
|
||||
--
|
||||
--
|
||||
----3 Two-place adjectives
|
||||
----
|
||||
---- Two-place adjectives need a preposition for their second argument.
|
||||
--
|
||||
-- mkA2 : A -> Prep -> A2 ;
|
||||
--
|
||||
--
|
||||
--
|
||||
----2 Adverbs
|
||||
--
|
||||
---- Adverbs are not inflected. Most lexical ones have position
|
||||
---- after the verb. Some can be preverbal (e.g. "always").
|
||||
--
|
||||
-- mkAdv : Str -> Adv ;
|
||||
-- mkAdV : Str -> AdV ;
|
||||
--
|
||||
---- Adverbs modifying adjectives and sentences can also be formed.
|
||||
--
|
||||
-- mkAdA : Str -> AdA ;
|
||||
--
|
||||
----2 Prepositions
|
||||
----
|
||||
---- A preposition as used for rection in the lexicon, as well as to
|
||||
---- build $PP$s in the resource API, just requires a string.
|
||||
--
|
||||
-- mkPrep : Str -> Prep ;
|
||||
-- noPrep : Prep ;
|
||||
--
|
||||
---- (These two functions are synonyms.)
|
||||
--
|
||||
----2 Verbs
|
||||
----
|
||||
--
|
||||
---- Verbs are constructed by the function $mkV$, which takes a varying
|
||||
---- number of arguments.
|
||||
--
|
||||
-- mkV : overload {
|
||||
--
|
||||
---- The regular verb function recognizes the special cases where the last
|
||||
---- character is "y" ("cry-cries" but "buy-buys") or a sibilant
|
||||
---- ("kiss-"kisses", "jazz-jazzes", "rush-rushes", "munch - munches",
|
||||
---- "fix - fixes").
|
||||
--
|
||||
-- mkV : (cry : Str) -> V ;
|
||||
--
|
||||
---- Give the present and past forms for regular verbs where
|
||||
---- the last letter is duplicated in some forms,
|
||||
---- e.g. "rip - ripped - ripping".
|
||||
--
|
||||
-- mkV : (stop, stopped : Str) -> V ;
|
||||
--
|
||||
---- There is an extensive list of irregular verbs in the module $IrregularHin$.
|
||||
---- In practice, it is enough to give three forms,
|
||||
---- e.g. "drink - drank - drunk".
|
||||
--
|
||||
-- mkV : (drink, drank, drunk : Str) -> V ;
|
||||
--
|
||||
---- Irregular verbs with duplicated consonant in the present participle.
|
||||
--
|
||||
-- mkV : (run, ran, run, running : Str) -> V ;
|
||||
--
|
||||
---- Except for "be", the worst case needs five forms: the infinitive and
|
||||
---- the third person singular present, the past indicative, and the
|
||||
---- past and present participles.
|
||||
--
|
||||
-- mkV : (go, goes, went, gone, going : Str) -> V
|
||||
-- };
|
||||
--
|
||||
---- Verbs with a particle.
|
||||
---- The particle, such as in "switch on", is given as a string.
|
||||
--
|
||||
-- partV : V -> Str -> V ;
|
||||
--
|
||||
---- Reflexive verbs.
|
||||
---- By default, verbs are not reflexive; this function makes them that.
|
||||
--
|
||||
-- reflV : V -> V ;
|
||||
--
|
||||
----3 Two-place verbs
|
||||
----
|
||||
---- Two-place verbs need a preposition, except the special case with direct object.
|
||||
---- (transitive verbs). Notice that a particle comes from the $V$.
|
||||
--
|
||||
-- mkV2 : overload {
|
||||
-- mkV2 : V -> Prep -> V2 ; -- believe in
|
||||
-- mkV2 : V -> V2 -- kill
|
||||
-- };
|
||||
--
|
||||
----3 Three-place verbs
|
||||
----
|
||||
---- Three-place (ditransitive) verbs need two prepositions, of which
|
||||
---- the first one or both can be absent.
|
||||
--
|
||||
-- mkV3 : V -> Prep -> Prep -> V3 ; -- speak, with, about
|
||||
-- dirV3 : V -> Prep -> V3 ; -- give,_,to
|
||||
-- dirdirV3 : V -> V3 ; -- give,_,_
|
||||
--
|
||||
----3 Other complement patterns
|
||||
----
|
||||
---- Verbs and adjectives can take complements such as sentences,
|
||||
---- questions, verb phrases, and adjectives.
|
||||
--
|
||||
-- mkV0 : V -> V0 ;
|
||||
-- mkVS : V -> VS ;
|
||||
-- mkV2S : V -> Prep -> V2S ;
|
||||
-- mkVV : V -> VV ;
|
||||
-- mkV2V : V -> Prep -> Prep -> V2V ;
|
||||
-- mkVA : V -> VA ;
|
||||
-- mkV2A : V -> Prep -> V2A ;
|
||||
-- mkVQ : V -> VQ ;
|
||||
-- mkV2Q : V -> Prep -> V2Q ;
|
||||
--
|
||||
-- mkAS : A -> AS ;
|
||||
-- mkA2S : A -> Prep -> A2S ;
|
||||
-- mkAV : A -> AV ;
|
||||
-- mkA2V : A -> Prep -> A2V ;
|
||||
--
|
||||
---- Notice: Categories $V0, AS, A2S, AV, A2V$ are just $A$.
|
||||
---- $V0$ is just $V$; the second argument is treated as adverb.
|
||||
--
|
||||
-- V0 : Type ;
|
||||
-- AS, A2S, AV, A2V : Type ;
|
||||
--
|
||||
----.
|
||||
----2 Definitions of paradigms
|
||||
----
|
||||
---- The definitions should not bother the user of the API. So they are
|
||||
---- hidden from the document.
|
||||
--
|
||||
-- Gender = MorphoHin.Gender ;
|
||||
-- Number = MorphoHin.Number ;
|
||||
-- Case = MorphoHin.Case ;
|
||||
-- human = Masc ;
|
||||
-- nonhuman = Neutr ;
|
||||
-- masculine = Masc ;
|
||||
-- feminine = Fem ;
|
||||
-- singular = Sg ;
|
||||
-- plural = Pl ;
|
||||
-- nominative = Nom ;
|
||||
-- genitive = Gen ;
|
||||
--
|
||||
-- Preposition : Type = Str ; -- obsolete
|
||||
--
|
||||
-- regN = \ray ->
|
||||
-- let rays = add_s ray
|
||||
-- in
|
||||
-- mk2N ray rays ;
|
||||
--
|
||||
--
|
||||
-- add_s : Str -> Str = \w -> case w of {
|
||||
-- _ + ("io" | "oo") => w + "s" ; -- radio, bamboo
|
||||
-- _ + ("s" | "z" | "x" | "sh" | "ch" | "o") => w + "es" ; -- bus, hero
|
||||
-- _ + ("a" | "o" | "u" | "e") + "y" => w + "s" ; -- boy
|
||||
-- x + "y" => x + "ies" ; -- fly
|
||||
-- _ => w + "s" -- car
|
||||
-- } ;
|
||||
--
|
||||
-- mk2N = \man,men ->
|
||||
-- let mens = case last men of {
|
||||
-- "s" => men + "'" ;
|
||||
-- _ => men + "'s"
|
||||
-- }
|
||||
-- in
|
||||
-- mk4N man men (man + "'s") mens ;
|
||||
--
|
||||
-- mk4N = \man,men,man's,men's ->
|
||||
-- mkNoun man man's men men's ** {g = Neutr ; lock_N = <>} ;
|
||||
--
|
||||
-- genderN g man = {s = man.s ; g = g ; lock_N = <>} ;
|
||||
--
|
||||
-- compoundN s n = {s = \\x,y => s ++ n.s ! x ! y ; g=n.g ; lock_N = <>} ;
|
||||
--
|
||||
-- mkPN = overload {
|
||||
-- mkPN : Str -> PN = regPN ;
|
||||
-- mkPN : N -> PN = nounPN
|
||||
-- } ;
|
||||
--
|
||||
--
|
||||
-- mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p.s} ;
|
||||
-- regN2 n = mkN2 (regN n) (mkPrep "of") ;
|
||||
-- mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p.s ; c3 = q.s} ;
|
||||
--
|
||||
----3 Relational common noun phrases
|
||||
----
|
||||
---- In some cases, you may want to make a complex $CN$ into a
|
||||
---- relational noun (e.g. "the old town hall of").
|
||||
--
|
||||
-- cnN2 : CN -> Prep -> N2 ;
|
||||
-- cnN3 : CN -> Prep -> Prep -> N3 ;
|
||||
--
|
||||
---- This is obsolete.
|
||||
-- cnN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p.s} ;
|
||||
-- cnN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p.s ; c3 = q.s} ;
|
||||
--
|
||||
-- regPN n = regGenPN n human ;
|
||||
-- regGenPN n g = nameReg n g ** {g = g ; lock_PN = <>} ;
|
||||
-- nounPN n = {s = n.s ! singular ; g = n.g ; lock_PN = <>} ;
|
||||
--
|
||||
-- mk2A a b = mkAdjective a a a b ** {lock_A = <>} ;
|
||||
-- regA a = regADeg a ** {lock_A = <>} ;
|
||||
--
|
||||
-- mkA2 a p = a ** {c2 = p.s ; lock_A2 = <>} ;
|
||||
--
|
||||
-- ADeg = A ; ----
|
||||
--
|
||||
-- mkADeg a b c d = mkAdjective a b c d ** {lock_A = <>} ;
|
||||
--
|
||||
-- regADeg happy =
|
||||
-- let
|
||||
-- happ = init happy ;
|
||||
-- y = last happy ;
|
||||
-- happie = case y of {
|
||||
-- "y" => happ + "ie" ;
|
||||
-- "e" => happy ;
|
||||
-- _ => happy + "e"
|
||||
-- } ;
|
||||
-- happily : Str = case happy of {
|
||||
-- _ + "y" => happ + "ily" ;
|
||||
-- _ + "ll" => happy + "y" ;
|
||||
-- _ => happy + "ly"
|
||||
-- } ;
|
||||
-- in mkADeg happy (happie + "r") (happie + "st") happily ;
|
||||
--
|
||||
-- duplADeg fat =
|
||||
-- mkADeg fat
|
||||
-- (fat + last fat + "er") (fat + last fat + "est") (fat + "ly") ;
|
||||
--
|
||||
-- compoundADeg a =
|
||||
-- let ad = (a.s ! AAdj Posit)
|
||||
-- in mkADeg ad ("more" ++ ad) ("most" ++ ad) (a.s ! AAdv) ;
|
||||
--
|
||||
-- adegA a = a ;
|
||||
--
|
||||
-- mkAdv x = ss x ** {lock_Adv = <>} ;
|
||||
-- mkAdV x = ss x ** {lock_AdV = <>} ;
|
||||
-- mkAdA x = ss x ** {lock_AdA = <>} ;
|
||||
--
|
||||
-- mkPrep p = ss p ** {lock_Prep = <>} ;
|
||||
-- noPrep = mkPrep [] ;
|
||||
--
|
||||
-- mk5V a b c d e = mkVerb a b c d e ** {s1 = [] ; lock_V = <>} ;
|
||||
--
|
||||
-- regV cry =
|
||||
-- let
|
||||
-- cr = init cry ;
|
||||
-- y = last cry ;
|
||||
-- cries = (regN cry).s ! Pl ! Nom ; -- !
|
||||
-- crie = init cries ;
|
||||
-- cried = case last crie of {
|
||||
-- "e" => crie + "d" ;
|
||||
-- _ => crie + "ed"
|
||||
-- } ;
|
||||
-- crying = case y of {
|
||||
-- "e" => case last cr of {
|
||||
-- "e" => cry + "ing" ;
|
||||
-- _ => cr + "ing"
|
||||
-- } ;
|
||||
-- _ => cry + "ing"
|
||||
-- }
|
||||
-- in mk5V cry cries cried cried crying ;
|
||||
--
|
||||
-- reg2V fit fitted =
|
||||
-- let fitt = Predef.tk 2 fitted ;
|
||||
-- in mk5V fit (fit + "s") (fitt + "ed") (fitt + "ed") (fitt + "ing") ;
|
||||
--
|
||||
-- regDuplV fit =
|
||||
-- case last fit of {
|
||||
-- ("a" | "e" | "i" | "o" | "u" | "y") =>
|
||||
-- Predef.error (["final duplication makes no sense for"] ++ fit) ;
|
||||
-- t =>
|
||||
-- let fitt = fit + t in
|
||||
-- mk5V fit (fit + "s") (fitt + "ed") (fitt + "ed") (fitt + "ing")
|
||||
-- } ;
|
||||
--
|
||||
-- irregV x y z = let reg = (regV x).s in
|
||||
-- mk5V x (reg ! VPres) y z (reg ! VPresPart) ** {s1 = [] ; lock_V = <>} ;
|
||||
--
|
||||
-- irreg4V x y z w = let reg = (regV x).s in
|
||||
-- mk5V x (reg ! VPres) y z w ** {s1 = [] ; lock_V = <>} ;
|
||||
--
|
||||
-- irregDuplV fit y z =
|
||||
-- let
|
||||
-- fitting = (regDuplV fit).s ! VPresPart
|
||||
-- in
|
||||
-- mk5V fit (fit + "s") y z fitting ;
|
||||
--
|
||||
-- partV v p = verbPart v p ** {lock_V = <>} ;
|
||||
-- reflV v = {s = v.s ; part = v.part ; lock_V = v.lock_V ; isRefl = True} ;
|
||||
--
|
||||
-- prepV2 v p = v ** {s = v.s ; s1 = v.s1 ; c2 = p.s ; lock_V2 = <>} ;
|
||||
-- dirV2 v = prepV2 v noPrep ;
|
||||
--
|
||||
-- mkV3 v p q = v ** {s = v.s ; s1 = v.s1 ; c2 = p.s ; c3 = q.s ; lock_V3 = <>} ;
|
||||
-- dirV3 v p = mkV3 v noPrep p ;
|
||||
-- dirdirV3 v = dirV3 v noPrep ;
|
||||
--
|
||||
-- mkVS v = v ** {lock_VS = <>} ;
|
||||
-- mkVV v = {
|
||||
-- s = table {VVF vf => v.s ! vf ; _ => variants {}} ;
|
||||
-- isAux = False ; lock_VV = <>
|
||||
-- } ;
|
||||
-- mkVQ v = v ** {lock_VQ = <>} ;
|
||||
--
|
||||
-- V0 : Type = V ;
|
||||
---- V2S, V2V, V2Q : Type = V2 ;
|
||||
-- AS, A2S, AV : Type = A ;
|
||||
-- A2V : Type = A2 ;
|
||||
--
|
||||
-- mkV0 v = v ** {lock_V = <>} ;
|
||||
-- mkV2S v p = prepV2 v p ** {lock_V2S = <>} ;
|
||||
-- mkV2V v p t = prepV2 v p ** {isAux = False ; lock_V2V = <>} ;
|
||||
-- mkVA v = v ** {lock_VA = <>} ;
|
||||
-- mkV2A v p = prepV2 v p ** {lock_V2A = <>} ;
|
||||
-- mkV2Q v p = prepV2 v p ** {lock_V2Q = <>} ;
|
||||
--
|
||||
-- mkAS v = v ** {lock_A = <>} ;
|
||||
-- mkA2S v p = mkA2 v p ** {lock_A = <>} ;
|
||||
-- mkAV v = v ** {lock_A = <>} ;
|
||||
-- mkA2V v p = mkA2 v p ** {lock_A2 = <>} ;
|
||||
--
|
||||
--
|
||||
---- pre-overload API and overload definitions
|
||||
--
|
||||
-- mk4N : (man,men,man's,men's : Str) -> N ;
|
||||
-- regN : Str -> N ;
|
||||
-- mk2N : (man,men : Str) -> N ;
|
||||
-- genderN : Gender -> N -> N ;
|
||||
-- compoundN : Str -> N -> N ;
|
||||
--
|
||||
-- mkN = overload {
|
||||
-- mkN : (man,men,man's,men's : Str) -> N = mk4N ;
|
||||
-- mkN : Str -> N = regN ;
|
||||
-- mkN : (man,men : Str) -> N = mk2N ;
|
||||
-- mkN : Gender -> N -> N = genderN ;
|
||||
-- mkN : Str -> N -> N = compoundN
|
||||
-- } ;
|
||||
--
|
||||
--
|
||||
-- mk2A : (free,freely : Str) -> A ;
|
||||
-- regA : Str -> A ;
|
||||
--
|
||||
-- mkA = overload {
|
||||
-- mkA : Str -> A = regA ;
|
||||
-- mkA : (fat,fatter : Str) -> A = \fat,fatter ->
|
||||
-- mkAdjective fat fatter (init fatter + "st") (fat + "ly") ** {lock_A = <>} ;
|
||||
-- mkA : (good,better,best,well : Str) -> A = \a,b,c,d ->
|
||||
-- mkAdjective a b c d ** {lock_A = <>}
|
||||
-- } ;
|
||||
--
|
||||
-- compoundA = compoundADeg ;
|
||||
--
|
||||
--
|
||||
-- mk5V : (go, goes, went, gone, going : Str) -> V ;
|
||||
-- regV : (cry : Str) -> V ;
|
||||
-- reg2V : (stop, stopped : Str) -> V;
|
||||
-- irregV : (drink, drank, drunk : Str) -> V ;
|
||||
-- irreg4V : (run, ran, run, running : Str) -> V ;
|
||||
--
|
||||
-- -- Use reg2V instead
|
||||
-- regDuplV : Str -> V ;
|
||||
-- -- Use irreg4V instead
|
||||
-- irregDuplV : (get, got, gotten : Str) -> V ;
|
||||
--
|
||||
-- mkV = overload {
|
||||
-- mkV : (cry : Str) -> V = regV ;
|
||||
-- mkV : (stop, stopped : Str) -> V = reg2V ;
|
||||
-- mkV : (drink, drank, drunk : Str) -> V = irregV ;
|
||||
-- mkV : (run, ran, run, running : Str) -> V = irreg4V ;
|
||||
-- mkV : (go, goes, went, gone, going : Str) -> V = mk5V
|
||||
-- };
|
||||
--
|
||||
-- prepV2 : V -> Prep -> V2 ;
|
||||
-- dirV2 : V -> V2 ;
|
||||
--
|
||||
-- mkV2 = overload {
|
||||
-- mkV2 : V -> Prep -> V2 = prepV2;
|
||||
-- mkV2 : V -> V2 = dirV2
|
||||
-- };
|
||||
--
|
||||
--
|
||||
------ obsolete
|
||||
--
|
||||
---- Comparison adjectives may two more forms.
|
||||
--
|
||||
-- ADeg : Type ;
|
||||
--
|
||||
-- mkADeg : (good,better,best,well : Str) -> ADeg ;
|
||||
--
|
||||
---- The regular pattern recognizes two common variations:
|
||||
---- "-e" ("rude" - "ruder" - "rudest") and
|
||||
---- "-y" ("happy - happier - happiest - happily")
|
||||
--
|
||||
-- regADeg : Str -> ADeg ; -- long, longer, longest
|
||||
--
|
||||
---- However, the duplication of the final consonant is nor predicted,
|
||||
---- but a separate pattern is used:
|
||||
--
|
||||
-- duplADeg : Str -> ADeg ; -- fat, fatter, fattest
|
||||
--
|
||||
---- If comparison is formed by "more", "most", as in general for
|
||||
---- long adjective, the following pattern is used:
|
||||
--
|
||||
-- compoundADeg : A -> ADeg ; -- -/more/most ridiculous
|
||||
--
|
||||
---- From a given $ADeg$, it is possible to get back to $A$.
|
||||
--
|
||||
-- adegA : ADeg -> A ;
|
||||
--
|
||||
--
|
||||
-- regPN : Str -> PN ;
|
||||
-- regGenPN : Str -> Gender -> PN ; -- John, John's
|
||||
--
|
||||
---- Sometimes you can reuse a common noun as a proper name, e.g. "Bank".
|
||||
--
|
||||
-- nounPN : N -> PN ;
|
||||
--
|
||||
--
|
||||
--
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
--# -path=.:../romance:../abstract:../common:prelude
|
||||
|
||||
concrete CatIta of Cat = CommonX - [Tense,TPres,TPast,TFut,TCond] ** CatRomance with
|
||||
(ResRomance = ResIta) ;
|
||||
@@ -1,31 +0,0 @@
|
||||
--1 The Mathematics API to the Resource Grammar
|
||||
|
||||
-- This grammar is a collection of the different modules.
|
||||
-- It differs from $Lang$ in two main ways:
|
||||
-- - the combinations in Noun, Verb, Adjective, Adverb, Sentence are not included
|
||||
-- - instead, Symbol and Predication are used
|
||||
--
|
||||
--
|
||||
-- In practice, the most important difference is that only present-tense sentences
|
||||
-- are included, and that symbolic expressions are recognized as NPs.
|
||||
|
||||
abstract Mathematical =
|
||||
Noun - [ComplN2], --- to avoid ambiguity
|
||||
-- Verb,
|
||||
Adjective,
|
||||
Adverb,
|
||||
Numeral,
|
||||
-- Sentence,
|
||||
Question,
|
||||
Relative,
|
||||
Conjunction,
|
||||
Phrase,
|
||||
Text,
|
||||
Idiom,
|
||||
Structural,
|
||||
|
||||
Symbol,
|
||||
Predication,
|
||||
|
||||
Lexicon
|
||||
** {} ;
|
||||
@@ -1,26 +0,0 @@
|
||||
--# -path=.:present:prelude
|
||||
|
||||
concrete MathematicalCat of Mathematical =
|
||||
NounCat - [ComplN2], --- to avoid ambiguity
|
||||
-- VerbCat,
|
||||
AdjectiveCat,
|
||||
AdverbCat,
|
||||
NumeralCat,
|
||||
-- SentenceCat,
|
||||
QuestionCat,
|
||||
RelativeCat,
|
||||
ConjunctionCat,
|
||||
PhraseCat,
|
||||
TextX - [Tense,TPres,TPast,TFut,TCond],
|
||||
IdiomCat,
|
||||
StructuralCat,
|
||||
|
||||
SymbolCat,
|
||||
PredicationCat, -- - [predV3,predV2], --- gf bug
|
||||
|
||||
LexiconCat
|
||||
** {
|
||||
|
||||
flags startcat = Phr ;
|
||||
|
||||
} ;
|
||||
@@ -1,27 +0,0 @@
|
||||
--# -path=.:present:prelude
|
||||
|
||||
concrete MathematicalDan of Mathematical =
|
||||
NounDan - [ComplN2], --- to avoid ambiguity
|
||||
-- VerbDan,
|
||||
AdjectiveDan,
|
||||
AdverbDan,
|
||||
NumeralDan,
|
||||
-- SentenceDan,
|
||||
QuestionDan,
|
||||
RelativeDan,
|
||||
ConjunctionDan,
|
||||
PhraseDan,
|
||||
TextX,
|
||||
IdiomDan,
|
||||
|
||||
StructuralDan,
|
||||
|
||||
SymbolDan,
|
||||
PredicationDan,
|
||||
|
||||
LexiconDan
|
||||
** {
|
||||
|
||||
flags startcat = Phr ;
|
||||
|
||||
} ;
|
||||
@@ -1,26 +0,0 @@
|
||||
--# -path=.:present:prelude
|
||||
|
||||
concrete MathematicalEng of Mathematical =
|
||||
NounEng - [ComplN2], --- to avoid ambiguity
|
||||
-- VerbEng,
|
||||
AdjectiveEng,
|
||||
AdverbEng,
|
||||
NumeralEng,
|
||||
-- SentenceEng,
|
||||
QuestionEng,
|
||||
RelativeEng,
|
||||
ConjunctionEng,
|
||||
PhraseEng,
|
||||
StructuralEng,
|
||||
TextX,
|
||||
IdiomEng,
|
||||
|
||||
SymbolEng,
|
||||
PredicationEng,
|
||||
|
||||
LexiconEng
|
||||
** {
|
||||
|
||||
flags startcat = Phr ;
|
||||
|
||||
} ;
|
||||
@@ -1,26 +0,0 @@
|
||||
--# -path=.:present:prelude
|
||||
|
||||
concrete MathematicalFin of Mathematical =
|
||||
NounFin - [ComplN2], --- to avoid ambiguity
|
||||
-- VerbFin,
|
||||
AdjectiveFin,
|
||||
AdverbFin,
|
||||
NumeralFin,
|
||||
-- SentenceFin,
|
||||
QuestionFin,
|
||||
RelativeFin,
|
||||
ConjunctionFin,
|
||||
PhraseFin,
|
||||
TextX,
|
||||
IdiomFin,
|
||||
StructuralFin,
|
||||
|
||||
SymbolFin,
|
||||
PredicationFin,
|
||||
|
||||
LexiconFin
|
||||
** {
|
||||
|
||||
flags startcat = Phr ;
|
||||
|
||||
} ;
|
||||
@@ -1,26 +0,0 @@
|
||||
--# -path=.:present:prelude
|
||||
|
||||
concrete MathematicalFre of Mathematical =
|
||||
NounFre - [ComplN2], --- to avoid ambiguity
|
||||
-- VerbFre,
|
||||
AdjectiveFre,
|
||||
AdverbFre,
|
||||
NumeralFre,
|
||||
-- SentenceFre,
|
||||
QuestionFre,
|
||||
RelativeFre,
|
||||
ConjunctionFre,
|
||||
PhraseFre,
|
||||
TextX - [Tense,TPres,TPast,TFut,TCond],
|
||||
IdiomFre,
|
||||
StructuralFre,
|
||||
|
||||
SymbolFre,
|
||||
PredicationFre - [predV3], ---- gf bug
|
||||
|
||||
LexiconFre
|
||||
** {
|
||||
|
||||
flags startcat = Phr ;
|
||||
|
||||
} ;
|
||||
@@ -1,26 +0,0 @@
|
||||
--# -path=.:present:prelude
|
||||
|
||||
concrete MathematicalGer of Mathematical =
|
||||
NounGer - [ComplN2], --- to avoid ambiguity
|
||||
-- VerbGer,
|
||||
AdjectiveGer,
|
||||
AdverbGer,
|
||||
NumeralGer,
|
||||
-- SentenceGer,
|
||||
QuestionGer,
|
||||
RelativeGer,
|
||||
ConjunctionGer,
|
||||
PhraseGer,
|
||||
TextX - [Tense,TPres],
|
||||
IdiomGer,
|
||||
StructuralGer,
|
||||
|
||||
SymbolGer,
|
||||
PredicationGer,
|
||||
|
||||
LexiconGer
|
||||
** {
|
||||
|
||||
flags startcat = Phr ;
|
||||
|
||||
} ;
|
||||
@@ -1,26 +0,0 @@
|
||||
--# -path=.:present:prelude
|
||||
|
||||
concrete MathematicalIta of Mathematical =
|
||||
NounIta - [ComplN2], --- to avoid ambiguity
|
||||
-- VerbIta,
|
||||
AdjectiveIta,
|
||||
AdverbIta,
|
||||
NumeralIta,
|
||||
-- SentenceIta,
|
||||
QuestionIta,
|
||||
RelativeIta,
|
||||
ConjunctionIta,
|
||||
PhraseIta,
|
||||
TextX - [Tense,TPres,TPast,TFut,TCond],
|
||||
IdiomIta,
|
||||
StructuralIta,
|
||||
|
||||
SymbolIta,
|
||||
PredicationIta, -- - [predV3,predV2], --- gf bug
|
||||
|
||||
LexiconIta
|
||||
** {
|
||||
|
||||
flags startcat = Phr ;
|
||||
|
||||
} ;
|
||||
@@ -1,27 +0,0 @@
|
||||
--# -path=.:present:prelude
|
||||
|
||||
concrete MathematicalNor of Mathematical =
|
||||
NounNor - [ComplN2], --- to avoid ambiguity
|
||||
-- VerbNor,
|
||||
AdjectiveNor,
|
||||
AdverbNor,
|
||||
NumeralNor,
|
||||
-- SentenceNor,
|
||||
QuestionNor,
|
||||
RelativeNor,
|
||||
ConjunctionNor,
|
||||
PhraseNor,
|
||||
TextX,
|
||||
IdiomNor,
|
||||
|
||||
StructuralNor,
|
||||
|
||||
SymbolNor,
|
||||
PredicationNor,
|
||||
|
||||
LexiconNor
|
||||
** {
|
||||
|
||||
flags startcat = Phr ;
|
||||
|
||||
} ;
|
||||
@@ -1,26 +0,0 @@
|
||||
--# -path=.:present:prelude
|
||||
|
||||
concrete MathematicalSpa of Mathematical =
|
||||
NounSpa - [ComplN2], --- to avoid ambiguity
|
||||
-- VerbSpa,
|
||||
AdjectiveSpa,
|
||||
AdverbSpa,
|
||||
NumeralSpa,
|
||||
-- SentenceSpa,
|
||||
QuestionSpa,
|
||||
RelativeSpa,
|
||||
ConjunctionSpa,
|
||||
PhraseSpa,
|
||||
TextSpa - [Tense,TPres,TPast,TFut,TCond],
|
||||
IdiomSpa,
|
||||
StructuralSpa,
|
||||
|
||||
SymbolSpa,
|
||||
PredicationSpa, -- - [predV3,predV2], --- gf bug
|
||||
|
||||
LexiconSpa
|
||||
** {
|
||||
|
||||
flags startcat = Phr ;
|
||||
|
||||
} ;
|
||||
@@ -1,27 +0,0 @@
|
||||
--# -path=.:present:prelude
|
||||
|
||||
concrete MathematicalSwe of Mathematical =
|
||||
NounSwe - [ComplN2], --- to avoid ambiguity
|
||||
-- VerbSwe,
|
||||
AdjectiveSwe,
|
||||
AdverbSwe,
|
||||
NumeralSwe,
|
||||
-- SentenceSwe,
|
||||
QuestionSwe,
|
||||
RelativeSwe,
|
||||
ConjunctionSwe,
|
||||
PhraseSwe,
|
||||
TextX,
|
||||
IdiomSwe,
|
||||
|
||||
StructuralSwe,
|
||||
|
||||
SymbolSwe,
|
||||
PredicationSwe,
|
||||
|
||||
LexiconSwe
|
||||
** {
|
||||
|
||||
flags startcat = Phr ;
|
||||
|
||||
} ;
|
||||
@@ -1,60 +0,0 @@
|
||||
--1 A Small Predication Library
|
||||
--
|
||||
-- (c) Aarne Ranta 2003-2006 under Gnu GPL.
|
||||
--
|
||||
-- This library is a derived library built on the language-independent Ground
|
||||
-- API of resource grammars.
|
||||
|
||||
abstract Predication = Cat ** {
|
||||
|
||||
--2 The category of atomic sentences
|
||||
|
||||
-- We want to use sentences in positive and negative forms but do not care about
|
||||
-- tenses.
|
||||
|
||||
fun
|
||||
PosCl : Cl -> S ; -- positive sentence: "x intersects y"
|
||||
NegCl : Cl -> S ; -- negative sentence: "x doesn't intersect y"
|
||||
|
||||
--2 Predication patterns.
|
||||
|
||||
predV : V -> NP -> Cl ; -- one-place verb: "x converges"
|
||||
predV2 : V2 -> NP -> NP -> Cl ; -- two-place verb: "x intersects y"
|
||||
predV3 : V3 -> NP->NP-> NP -> Cl; -- three-place verb: "x intersects y at z"
|
||||
predVColl : V -> NP -> NP -> Cl ; -- collective verb: "x and y intersect"
|
||||
predA : A -> NP -> Cl ; -- one-place adjective: "x is even"
|
||||
predA2 : A2 -> NP -> NP -> Cl ; -- two-place adj: "x is divisible by y"
|
||||
predAComp : A -> NP -> NP -> Cl; -- comparative adj: "x is greater than y"
|
||||
predAColl : A -> NP -> NP -> Cl ; -- collective adj: "x and y are parallel"
|
||||
predN : N -> NP -> Cl ; -- one-place noun: "x is a point"
|
||||
predN2 : N2 -> NP -> NP -> Cl ; -- two-place noun: "x is a divisor of y"
|
||||
predNColl : N -> NP -> NP -> Cl ; -- collective noun: "x and y are duals"
|
||||
predAdv : Adv -> NP -> Cl ; -- adverb: "x is inside"
|
||||
predPrep : Prep -> NP -> NP -> Cl ; -- preposition: "x is outside y"
|
||||
|
||||
--2 Imperatives and infinitives.
|
||||
|
||||
impV2 : V2 -> NP -> Phr ; -- imperative: "solve the equation E"
|
||||
infV2 : V2 -> NP -> Phr ; -- infinitive: "to solve the equation E"
|
||||
|
||||
--2 Individual-valued function applications
|
||||
|
||||
appN2 : N2 -> NP -> NP ; -- one-place function: "the successor of x"
|
||||
appN3 : N3 -> NP -> NP -> NP ; -- two-place function: "the distance from x to y"
|
||||
appColl : N2 -> NP -> NP -> NP ; -- collective function: "the sum of x and y"
|
||||
|
||||
--2 Families of types
|
||||
|
||||
-- These are expressed by relational nouns applied to arguments.
|
||||
|
||||
famN2 : N2 -> NP -> CN ; -- one-place family: "divisor of x"
|
||||
famN3 : N3 -> NP -> NP -> CN ; -- two-place family: "path from x to y"
|
||||
famColl : N2 -> NP -> NP -> CN ; -- collective family: "path between x and y"
|
||||
|
||||
--2 Type constructor
|
||||
|
||||
-- This is similar to a family except that the argument is a type.
|
||||
|
||||
typN2 : N2 -> CN -> CN ; -- constructed type: "list of integers"
|
||||
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
concrete PredicationCat of Predication = CatCat ** PredicationI with
|
||||
(Syntax = SyntaxCat),
|
||||
(Lang = LangCat) ;
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
concrete PredicationDan of Predication = CatDan ** PredicationI with
|
||||
(Syntax = SyntaxDan),
|
||||
(Lang = LangDan) ;
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
concrete PredicationEng of Predication = CatEng ** PredicationI with
|
||||
(Syntax = SyntaxEng),
|
||||
(Lang = LangEng) ;
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
concrete PredicationFin of Predication = CatFin ** PredicationI with
|
||||
(Syntax = SyntaxFin),
|
||||
(Lang = LangFin) ;
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
concrete PredicationFre of Predication = CatFre ** PredicationI with
|
||||
(Syntax = SyntaxFre),
|
||||
(Lang = LangFre) ;
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
concrete PredicationGer of Predication = CatGer ** PredicationI with
|
||||
(Syntax = SyntaxGer),
|
||||
(Lang = LangGer) ;
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
incomplete concrete PredicationI of Predication =
|
||||
Cat ** open ParamX, Lang, Syntax in {
|
||||
|
||||
flags optimize = all_subs ;
|
||||
|
||||
lin
|
||||
PosCl cl = mkS cl ;
|
||||
NegCl cl = mkS PNeg cl ;
|
||||
|
||||
--2 Predication patterns.
|
||||
|
||||
predV v x = PredVP x (UseV v) ; -- mkCl x v ;
|
||||
predV2 v x y = mkCl x v y ;
|
||||
predV3 v x y z = mkCl x v y z ;
|
||||
predVColl v x y = mkCl (mkNP and_Conj x y) v ;
|
||||
predA a x = mkCl x a ;
|
||||
predA2 a x y = mkCl x a y ;
|
||||
predAComp a x y = mkCl x a y ;
|
||||
predAColl a x y = mkCl (mkNP and_Conj x y) a ;
|
||||
predN n x = mkCl x (mkNP IndefArt (mkCN n)) ; --- Sg/Pl ?
|
||||
predN2 n x y = mkCl x (mkNP IndefArt (ComplN2 n y)) ; --- Sg/Pl ?
|
||||
predNColl n x y = mkCl (mkNP and_Conj x y) (mkNP IndefArt (mkCN n)) ;
|
||||
predAdv a x = mkCl x a ;
|
||||
predPrep p x y = mkCl x (mkAdv p y) ;
|
||||
|
||||
--2 Imperatives and infinitives.
|
||||
|
||||
impV2 v x = mkPhr (mkImp v x) ;
|
||||
infV2 v x = mkPhr (mkUtt (mkVP v x)) ;
|
||||
|
||||
--2 Individual-valued function applications
|
||||
|
||||
appN2 n x = mkNP DefArt (mkCN n x) ;
|
||||
appN3 n x y = mkNP DefArt (mkCN n x y) ;
|
||||
appColl n x y = mkNP DefArt (mkCN n (mkNP and_Conj x y)) ;
|
||||
|
||||
--2 Families of types
|
||||
|
||||
-- These are expressed by relational nouns applied to arguments.
|
||||
|
||||
famN2 n x = ComplN2 n x ;
|
||||
famN3 n x y = ComplN2 (ComplN3 n x) y ;
|
||||
famColl n x y = ComplN2 n (ConjNP and_Conj (BaseNP x y)) ;
|
||||
|
||||
--2 Type constructor
|
||||
|
||||
-- This is similar to a family except that the argument is a type.
|
||||
|
||||
typN2 f n = ComplN2 f (DetArtPl DefArt n) ;
|
||||
|
||||
}
|
||||