diff options
Diffstat (limited to 'contrib')
88 files changed, 0 insertions, 6843 deletions
diff --git a/contrib/c-bindings/PGFFFI.hs b/contrib/c-bindings/PGFFFI.hs deleted file mode 100644 index 5506e2b58..000000000 --- a/contrib/c-bindings/PGFFFI.hs +++ /dev/null @@ -1,232 +0,0 @@ --- GF C Bindings --- Copyright (C) 2008-2010 Kevin Kofler --- --- This library is free software; you can redistribute it and/or --- modify it under the terms of the GNU Lesser General Public --- License as published by the Free Software Foundation; either --- version 2.1 of the License, or (at your option) any later version. --- --- This library is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- Lesser General Public License for more details. --- --- You should have received a copy of the GNU Lesser General Public --- License along with this library; if not, see <http://www.gnu.org/licenses/>. - - -module PGFFFI where - -import PGF -import CString -import Foreign -import Foreign.C.Types -import Control.Exception -import IO -import Data.Maybe --- import GF.Text.Lexing - - --- Utility functions used in the implementation (not exported): - --- This is a kind of a hack, the FFI spec doesn't guarantee that this will work. --- The alternative would be to use Ptr () instead of StablePtr a everywhere. -nullStablePtr :: StablePtr a -nullStablePtr = (castPtrToStablePtr nullPtr) - -sizeOfStablePtr :: Int -sizeOfStablePtr = (sizeOf (nullStablePtr)) - -storeList :: [a] -> Ptr (StablePtr a) -> IO () -storeList list buf = do - case list of - carlist:cdrlist -> do - sptr <- (newStablePtr carlist) - (poke buf sptr) - (storeList cdrlist (plusPtr buf sizeOfStablePtr)) - [] -> (poke buf nullStablePtr) - -listToArray :: [a] -> IO (Ptr (StablePtr a)) -listToArray list = do - buf <- (mallocBytes ((sizeOfStablePtr) * ((length list) + 1))) - (storeList list buf) - return buf - - --- * PGF -foreign export ccall "gf_freePGF" freeStablePtr :: StablePtr PGF -> IO () - -foreign export ccall gf_readPGF :: CString -> IO (StablePtr PGF) -gf_readPGF path = do - p <- (peekCString path) - result <- (readPGF p) - (newStablePtr result) - --- * Identifiers -foreign export ccall "gf_freeCId" freeStablePtr :: StablePtr CId -> IO () - -foreign export ccall gf_mkCId :: CString -> IO (StablePtr CId) -gf_mkCId str = do - s <- (peekCString str) - (newStablePtr (mkCId s)) - -foreign export ccall gf_wildCId :: IO (StablePtr CId) -gf_wildCId = do - (newStablePtr (wildCId)) - -foreign export ccall gf_showCId :: StablePtr CId -> IO CString -gf_showCId cid = do - c <- (deRefStablePtr cid) - (newCString (showCId c)) - -foreign export ccall gf_readCId :: CString -> IO (StablePtr CId) -gf_readCId str = do - s <- (peekCString str) - case (readCId s) of - Just x -> (newStablePtr x) - Nothing -> (return (nullStablePtr)) - --- TODO: So we can create, print and free a CId, but can we do anything useful with it? --- We need some kind of C wrapper for the tree datastructures. - --- * Languages -foreign export ccall "gf_freeLanguage" freeStablePtr :: StablePtr Language -> IO () - -foreign export ccall gf_showLanguage :: StablePtr Language -> IO CString -gf_showLanguage lang = do - l <- (deRefStablePtr lang) - (newCString (showLanguage l)) - -foreign export ccall gf_readLanguage :: CString -> IO (StablePtr Language) -gf_readLanguage str = do - s <- (peekCString str) - case (readLanguage s) of - Just x -> (newStablePtr x) - Nothing -> (return (nullStablePtr)) - -foreign export ccall gf_languages :: StablePtr PGF -> IO (Ptr (StablePtr Language)) -gf_languages pgf = do - p <- (deRefStablePtr pgf) - (listToArray (languages p)) - -foreign export ccall gf_abstractName :: StablePtr PGF -> IO (StablePtr Language) -gf_abstractName pgf = do - p <- (deRefStablePtr pgf) - (newStablePtr (abstractName p)) - -foreign export ccall gf_languageCode :: StablePtr PGF -> StablePtr Language -> IO CString -gf_languageCode pgf lang = do - p <- (deRefStablePtr pgf) - l <- (deRefStablePtr lang) - case (languageCode p l) of - Just s -> (newCString s) - Nothing -> (return nullPtr) - --- * Types -foreign export ccall "gf_freeType" freeStablePtr :: StablePtr Type -> IO () - --- TODO: Hypo - --- TODO: allow nonempty scope -foreign export ccall gf_showType :: StablePtr Type -> IO CString -gf_showType tp = do - t <- (deRefStablePtr tp) - (newCString (showType [] t)) - -foreign export ccall gf_readType :: CString -> IO (StablePtr Type) -gf_readType str = do - s <- (peekCString str) - case (readType s) of - Just x -> (newStablePtr x) - Nothing -> (return (nullStablePtr)) - --- TODO: mkType, mkHypo, mkDepHypo, mkImplHypo - -foreign export ccall gf_categories :: StablePtr PGF -> IO (Ptr (StablePtr CId)) -gf_categories pgf = do - p <- (deRefStablePtr pgf) - (listToArray (categories p)) - -foreign export ccall gf_startCat :: StablePtr PGF -> IO (StablePtr Type) -gf_startCat pgf = do - p <- (deRefStablePtr pgf) - (newStablePtr (startCat p)) - --- TODO: * Functions - --- * Expressions & Trees --- ** Tree -foreign export ccall "gf_freeTree" freeStablePtr :: StablePtr Tree -> IO () - --- ** Expr -foreign export ccall "gf_freeExpr" freeStablePtr :: StablePtr Expr -> IO () - --- TODO: allow nonempty scope -foreign export ccall gf_showExpr :: StablePtr Expr -> IO CString -gf_showExpr expr = do - e <- (deRefStablePtr expr) - (newCString (showExpr [] e)) - -foreign export ccall gf_readExpr :: CString -> IO (StablePtr Expr) -gf_readExpr str = do - s <- (peekCString str) - case (readExpr s) of - Just x -> (newStablePtr x) - Nothing -> (return (nullStablePtr)) - --- * Operations --- ** Linearization -foreign export ccall gf_linearize :: StablePtr PGF -> StablePtr Language -> StablePtr Tree -> IO CString -gf_linearize pgf lang tree = do - p <- (deRefStablePtr pgf) - l <- (deRefStablePtr lang) - t <- (deRefStablePtr tree) - (newCString (linearize p l t)) - --- TODO: linearizeAllLang, linearizeAll, bracketedLinearize, tabularLinearizes --- TODO: groupResults - -foreign export ccall gf_showPrintName :: StablePtr PGF -> StablePtr Language -> StablePtr CId -> IO CString -gf_showPrintName pgf lang cid = do - p <- (deRefStablePtr pgf) - l <- (deRefStablePtr lang) - c <- (deRefStablePtr cid) - (newCString (showPrintName p l c)) - --- TODO: BracketedString(..), FId, LIndex, Forest.showBracketedString - --- ** Parsing -foreign export ccall gf_parse :: StablePtr PGF -> StablePtr Language -> StablePtr Type -> CString -> IO (Ptr (StablePtr Tree)) -gf_parse pgf lang cat input = do - p <- (deRefStablePtr pgf) - l <- (deRefStablePtr lang) - c <- (deRefStablePtr cat) - i <- (peekCString input) - (listToArray (parse p l c i)) - --- TODO: parseAllLang, parseAll, parse_, parseWithRecovery - --- TODO: ** Evaluation --- TODO: ** Type Checking --- TODO: ** Low level parsing API --- TODO: ** Generation --- TODO: ** Morphological Analysis --- TODO: ** Visualizations - --- TODO: * Browsing - --- GF.Text.Lexing: - --- foreign export ccall gf_stringOp :: CString -> CString -> IO CString --- gf_stringOp op str = do --- o <- (peekCString op) --- s <- (peekCString str) --- case (stringOp o) of --- Just fn -> (newCString (fn s)) --- Nothing -> (return nullPtr) - - --- Unused (exception handling): --- (Control.Exception.catch (listToArray (parse p l c i)) (\(e::SomeException) -> do --- (hPutStr stderr ("error: " ++ show e)) --- (return nullPtr))) diff --git a/contrib/c-bindings/build-gfctest.sh b/contrib/c-bindings/build-gfctest.sh deleted file mode 100644 index 37e7c97a3..000000000 --- a/contrib/c-bindings/build-gfctest.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -# GF C Bindings -# Copyright (C) 2008-2010 Kevin Kofler -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, see <http://www.gnu.org/licenses/>. -src=../../src -import=-i$src/runtime/haskell:$src/compiler -gf --make ../../examples/tutorial/embedded/QueryEng.gf && -ghc $import --make -fglasgow-exts -O2 -no-hs-main $* -c PGFFFI.hs && -ghc $import --make -fglasgow-exts -O2 -no-hs-main $* gfctest.c gf_lexing.c PGFFFI.hs -o gfctest diff --git a/contrib/c-bindings/gf_lexing.c b/contrib/c-bindings/gf_lexing.c deleted file mode 100644 index 4179db73f..000000000 --- a/contrib/c-bindings/gf_lexing.c +++ /dev/null @@ -1,287 +0,0 @@ -/* GF C Bindings - Copyright (C) 2010 Kevin Kofler - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, see <http://www.gnu.org/licenses/>. -*/ - -#include "gf_lexing.h" -#include <stddef.h> -#include <stdlib.h> -#include <string.h> -#include <ctype.h> - -typedef char **(*GF_Lexer)(const char *str); -typedef char *(*GF_Unlexer)(char **arr); - -static inline void freev(char **p) -{ - char **q = p; - while (*q) - free(*(q++)); - free(p); -} - -static char **words(const char *str) -{ - unsigned char *buf = (unsigned char *) strdup(str); - unsigned char *p = buf, *q; - char **result, **r; - size_t count = 0u; - while (isspace(*p)) p++; - q = p; - if (*p) count++; - while (*p) { - if (isspace(*p)) { - *(p++) = 0; - while (isspace(*p)) *(p++) = 0; - if (*p) count++; - } else p++; - } - r = result = malloc((count+1)*sizeof(char *)); - if (count) while (1) { - *(r++) = strdup((char *) q); - if (!--count) break; - while (*q) q++; - while (!*q) q++; - } - *r = NULL; - return result; -} - -static char *unwords(char **arr) -{ - size_t len = 0u; - char **p = arr, *result, *r; - while (*p) - len += strlen(*(p++)) + 1u; - if (!len) return calloc(1, 1); - r = result = malloc(len); - p = arr; - while (1) { - size_t l = strlen(*p); - strcpy(r, *(p++)); - if (!*p) break; - r += l; - *(r++) = ' '; - } - return result; -} - -static char **lines(const char *str) -{ - unsigned char *buf = (unsigned char *) strdup(str); - unsigned char *p = buf, *q; - char **result, **r; - size_t count = 0u; - while (*p == '\n') p++; - q = p; - if (*p) count++; - while (*p) { - if (*p == '\n') { - *(p++) = 0; - while (*p == '\n') *(p++) = 0; - if (*p) count++; - } else p++; - } - r = result = malloc((count+1)*sizeof(char *)); - if (count) while (1) { - *(r++) = strdup((char *) q); - if (!--count) break; - while (*q) q++; - while (!*q) q++; - } - *r = NULL; - return result; -} - -static char *unlines(char **arr) -{ - size_t len = 0u; - char **p = arr, *result, *r; - while (*p) - len += strlen(*(p++)) + 1u; - if (!len) return calloc(1, 1); - r = result = malloc(len); - p = arr; - while (1) { - size_t l = strlen(*p); - strcpy(r, *(p++)); - if (!*p) break; - r += l; - *(r++) = '\n'; - } - return result; -} - -static char *appLexer(GF_Lexer f, const char *str) -{ - char **arr = f(str), **p = arr, *result; - int ofs = 0; - while (*p && **p) p++; - while (*p) { - if (**p) p[-ofs] = *p; else ofs++; - p++; - } - p[-ofs] = NULL; - result = unwords(arr); - freev(arr); - return result; -} - -static char *appUnlexer(GF_Unlexer f, const char *str) -{ - char **arr = lines(str), **p = arr, *result; - while (*p) { - char **warr = words(*p); - free(*p); - *(p++) = f(warr); - freev(warr); - } - result = unlines(arr); - freev(arr); - return result; -} - -static inline int isPunct(char c) -{ - return c && strchr(".?!,:;", c); -} - -static inline int isMajorPunct(char c) -{ - return c && strchr(".?!", c); -} - -static inline int isMinorPunct(char c) -{ - return c && strchr(",:;", c); -} - -static char *charToStr(char c) -{ - char *result = malloc(2), *p = result; - *(p++) = c; - *p = 0; - return result; -} - -static char **lexChars(const char *str) -{ - char **result = malloc((strlen(str)+1)*sizeof(char *)), **r = result; - const char *p = str; - while (*p) { - if (!isspace(*p)) *(r++) = charToStr(*p); - p++; - } - *r = NULL; - return result; -} - -static char **lexText(const char *str) -{ - char **result = malloc((strlen(str)+1)*sizeof(char *)), **r = result; - const char *p = str; - int uncap = 1; - while (*p) { - if (isMajorPunct(*p)) { - *(r++) = charToStr(*(p++)); - uncap = 1; - } else if (isMinorPunct(*p)) { - *(r++) = charToStr(*(p++)); - uncap = 0; - } else if (isspace(*p)) { - p++; - uncap = 0; - } else { - const char *q = p; - char *word; - size_t l; - while (*p && !isspace(*p) && !isPunct(*p)) p++; - l = p - q; - word = malloc(l + 1); - strncpy(word, q, l); - word[l] = 0; - if (uncap) *word = tolower(*word); - *(r++) = word; - uncap = 0; - } - } - *r = NULL; - return result; -} - -static char *unlexText(char **arr) -{ - size_t len = 0u; - char **p = arr, *result, *r; - int cap = 1; - while (*p) - len += strlen(*(p++)) + 1u; - if (!len) return calloc(1, 1); - r = result = malloc(len); - p = arr; - while (1) { - size_t l = strlen(*p); - char *word = *(p++); - if (*word == '"' && word[l-1] == '"') word++, l--; - strncpy(r, word, l); - if (cap) *r = toupper(*r); - if (!*p) break; - r += l; - if (isPunct(**p) && !(*p)[1]) { - *(r++) = **p; - if (!p[1]) break; - cap = isMajorPunct(**(p++)); - } else cap = 0; - *(r++) = ' '; - } - *r = 0; - return result; - -} - -static char *stringop_chars(const char *str) -{ - return appLexer(lexChars, str); -} - -static char *stringop_lextext(const char *str) -{ - return appLexer(lexText, str); -} - -static char *stringop_words(const char *str) -{ - return appLexer(words, str); -} - -static char *stringop_unlextext(const char *str) -{ - return appUnlexer(unlexText, str); -} - -static char *stringop_unwords(const char *str) -{ - return appUnlexer(unwords, str); -} - -GF_StringOp gf_stringOp(const char *op) -{ - if (!strcmp(op, "chars")) return stringop_chars; - if (!strcmp(op, "lextext")) return stringop_lextext; - if (!strcmp(op, "words")) return stringop_words; - if (!strcmp(op, "unlextext")) return stringop_unlextext; - if (!strcmp(op, "unwords")) return stringop_unwords; - return NULL; -} diff --git a/contrib/c-bindings/gf_lexing.h b/contrib/c-bindings/gf_lexing.h deleted file mode 100644 index 6ab6960cc..000000000 --- a/contrib/c-bindings/gf_lexing.h +++ /dev/null @@ -1,26 +0,0 @@ -/* GF C Bindings - Copyright (C) 2010 Kevin Kofler - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, see <http://www.gnu.org/licenses/>. -*/ - -/* Function pointer type which applies a string operation to str, which is - assumed to be non-NULL. - The resulting string can be assumed to be non-NULL and must be freed using - free. */ -typedef char *(*GF_StringOp)(const char *str); - -/* Returns a GF_StringOp applying the operation op if available, otherwise - NULL. op is assumed to be non-NULL. The GF_StringOp MUST NOT be freed. */ -GF_StringOp gf_stringOp(const char *op); diff --git a/contrib/c-bindings/gfctest.c b/contrib/c-bindings/gfctest.c deleted file mode 100644 index ab0da52fc..000000000 --- a/contrib/c-bindings/gfctest.c +++ /dev/null @@ -1,50 +0,0 @@ -/* GF C Bindings - Copyright (C) 2008-2009 Kevin Kofler - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, see <http://www.gnu.org/licenses/>. -*/ - -#include <stdio.h> -#include <stdlib.h> -#include "pgf.h" -#include "gf_lexing.h" - -int main(int argc, char *argv[]) -{ - gf_init(&argc, &argv); - - GF_PGF pgf = gf_readPGF("Query.pgf"); - GF_Language lang = gf_readLanguage("QueryEng"); - GF_Type cat = gf_startCat(pgf); - char *lexed = gf_stringOp("lextext")("Is 2 prime"); - // char *lexed = "is 23 odd"; - GF_Tree *result = gf_parse(pgf, lang, cat, lexed); - free(lexed); - GF_Tree *p = result; - if (*p) { - do { - char *str = gf_showExpr(*(p++)); - puts(str); - free(str); - } while (*p); - } else - puts("no match"); - gf_freeTrees(result); - gf_freeType(cat); - gf_freeLanguage(lang); - gf_freePGF(pgf); - - gf_exit(); - return 0; -} diff --git a/contrib/c-bindings/gpl-3.0.txt b/contrib/c-bindings/gpl-3.0.txt deleted file mode 100644 index 94a9ed024..000000000 --- a/contrib/c-bindings/gpl-3.0.txt +++ /dev/null @@ -1,674 +0,0 @@ - GNU 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. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU 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 -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - <program> Copyright (C) <year> <name of author> - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -<http://www.gnu.org/licenses/>. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -<http://www.gnu.org/philosophy/why-not-lgpl.html>. diff --git a/contrib/c-bindings/lgpl-2.1.txt b/contrib/c-bindings/lgpl-2.1.txt deleted file mode 100644 index 602bfc946..000000000 --- a/contrib/c-bindings/lgpl-2.1.txt +++ /dev/null @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. 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 not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the 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 -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - <one line to give the library's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - <signature of Ty Coon>, 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/contrib/c-bindings/lgpl-3.0.txt b/contrib/c-bindings/lgpl-3.0.txt deleted file mode 100644 index cca7fc278..000000000 --- a/contrib/c-bindings/lgpl-3.0.txt +++ /dev/null @@ -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. diff --git a/contrib/c-bindings/pgf.h b/contrib/c-bindings/pgf.h deleted file mode 100644 index 12c555c0f..000000000 --- a/contrib/c-bindings/pgf.h +++ /dev/null @@ -1,68 +0,0 @@ -/* GF C Bindings - Copyright (C) 2008-2009 Kevin Kofler - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, see <http://www.gnu.org/licenses/>. -*/ - -#include "HsFFI.h" - -#ifdef __GLASGOW_HASKELL__ -#include "PGFFFI_stub.h" - -extern void __stginit_PGFFFI ( void ); -#endif - -static inline void gf_init(int *argc, char ***argv) -{ - hs_init(argc, argv); -#ifdef __GLASGOW_HASKELL__ - hs_add_root(__stginit_PGFFFI); -#endif -} - -static inline void gf_exit(void) -{ - hs_exit(); -} - -typedef HsStablePtr GF_PGF; -typedef HsStablePtr GF_CId; -typedef HsStablePtr GF_Language; -typedef HsStablePtr GF_Type; -typedef HsStablePtr GF_Tree; -typedef HsStablePtr GF_Expr; - -static inline void gf_freeCIds(GF_CId *p) -{ - GF_CId *q = p; - while (*q) - gf_freeCId(*(q++)); - free(p); -} - -static inline void gf_freeLanguages(GF_Language *p) -{ - GF_Language *q = p; - while (*q) - gf_freeLanguage(*(q++)); - free(p); -} - -static inline void gf_freeTrees(GF_Tree *p) -{ - GF_Type *q = p; - while (*q) - gf_freeTree(*(q++)); - free(p); -} diff --git a/contrib/c-bindings/readme-ffi.txt b/contrib/c-bindings/readme-ffi.txt deleted file mode 100644 index bc9abb294..000000000 --- a/contrib/c-bindings/readme-ffi.txt +++ /dev/null @@ -1,120 +0,0 @@ -GF C Bindings -Copyright (C) 2008-2010 Kevin Kofler - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, see <http://www.gnu.org/licenses/>. - - -This library provides access to the GF embedded grammars (PGF) API to C/C++ -applications. To use it: -1. #include "pgf.h" -2. call gf_init(&argc, &argv); at the beginning of main() -3. call gf_exit(); before exiting the program -4. build with: ghc --make -fglasgow-exts -O2 -no-hs-main $* x.c PGFFFI.hs -o x - - -Currently, the following functions from PGF are wrapped: -readPGF :: FilePath -> IO PGF -mkCId :: String -> CId -wildCId :: CId -showCId :: CId -> String -readCId :: String -> Maybe CId -showLanguage :: Language -> String -readLanguage :: String -> Maybe Language -languages :: PGF -> [Language] -abstractName :: PGF -> Language -languageCode :: PGF -> Language -> Maybe String -showType :: Type -> [CId] -> String (*) -readType :: String -> Maybe Type -categories :: PGF -> [CId] -startCat :: PGF -> Type -showExpr :: Expr -> [CId] -> String (*) -readExpr :: String -> Maybe Expr -linearize :: PGF -> Language -> Tree -> String -showPrintName :: PGF -> Language -> CId -> String -parse :: PGF -> Language -> Type -> String -> [Tree] -(*) The [CId] parameter is currently not mapped; instead, [] is always passed. - - -Some notes about the wrapping: -* "gf_" is prepended to the wrapped functions as a form of namespacing. -* Object types T are mapped to opaque C types GF_T which are handles to the - object. Whenever returned by a function, they get marked as used (so the - Haskell garbage collection won't delete them), so when you are done using - them, you should free them (assuming they're non-NULL) with the corresponding - gf_freeT function (i.e. one of: gf_freePGF, gf_freeLanguage, gf_freeType, - gf_freeCId, gf_freeTree, gf_freeExpr). (Internally, they are all Haskell - StablePtr handles, but this is subject to change.) -* Strings are mapped to char *. Strings returned by functions, when not NULL, - are allocated with malloc and should thus be freed with free when no longer - needed. -* A FilePath is a string. -* A type Maybe T is mapped the same way as just T, except that the returned - handle or char * can be NULL, so you should test them with a test like if (p). - Otherwise functions can be expected to always return non-NULL - handles/pointers. Conversely, arguments to functions are always assumed to be - non-NULL. -* Lists [T] are mapped to null-terminated arrays GF_T[], passed/returned as - pointers GF_T *. All objects in the array should be freed with the correct - gf_freeT function when no longer needed, the array itself with free. For your - convenience, the C header defines inline functions gf_freeLanguages, - gf_freeTypes and gf_freeTrees which free an entire array. -* Bool is wrapped to int using the usual C convention of 1 = True, 0 = False. -* A constant like wildCId is mapped to a function with no arguments, e.g. - GF_CId wildCId(void). The returned handle has to be freed as for any other - function. - - -Thus, the C prototypes for the wrapped functions are: -GF_PGF *gf_readPGF(char *path); -GF_CId gf_mkCId(char *str); -GF_CId wildCId(void); -char *gf_showCId(GF_CID cid); -GF_CId gf_readCId(char *str); /* may return NULL */ -char *gf_showLanguage(GF_Language lang); -GF_Language gf_readLanguage(char *str); /* may return NULL */ -GF_Language *gf_languages(GF_PGF pgf); -GF_Language gf_abstractName(GF_PGF pgf); -char *gf_languageCode(GF_PGF pgf, GF_Language lang); /* may return NULL */ -char *gf_showType(GF_Type tp); -GF_Type gf_readType(char *str); /* may return NULL */ -GF_CId *gf_categories(GF_PGF pgf); -GF_Type gf_startCat(GF_PGF pgf); -char *gf_showExpr(GF_Expr expr); -GF_Expr gf_readExpr(char *str); /* may return NULL */ -char *gf_linearize(GF_PGF pgf, GF_Language lang, GF_Tree tree); -char *gf_showPrintName(GF_PGF pgf, GF_Language lang, GF_CId cid); -GF_Tree *gf_parse(GF_PGF pgf, GF_Language lang, GF_Type cat, char *input); - -The C prototypes for the freeing functions are: -void gf_freePGF(GF_PGF pgf); -void gf_freeCId(GF_CId cid); -void gf_freeLanguage(GF_Language lang); -void gf_freeType(GF_Type tp); -void gf_freeTree(GF_Tree tree); -void gf_freeExpr(GF_Expr expr); -void gf_freeCIds(GF_Type *p); -void gf_freeLanguages(GF_Language *p); -void gf_freeTrees(GF_Tree *p); - - - -In addition, a C equivalent to the following function from GF.Text.Lexing: -stringOp :: String -> Maybe (String -> String) -is provided as: -typedef char *(*GF_StringOp)(const char *str); -GF_StringOp gf_stringOp(const char *op); /* may return NULL */ -which returns NULL if op is not a valid operation name, otherwise a pointer to a -function which applies the function corresponding to op to the string str. The -resulting string must be freed with free. The function pointer MUST NOT be -freed. diff --git a/contrib/eaglesconv/CollectLemmas.hs b/contrib/eaglesconv/CollectLemmas.hs deleted file mode 100644 index a63e7e1a8..000000000 --- a/contrib/eaglesconv/CollectLemmas.hs +++ /dev/null @@ -1,28 +0,0 @@ --- Copyright (C) 2011 Nikita Frolov - -import qualified Data.Text as T -import qualified Data.Text.IO as UTF8 -import System.IO -import System.Environment -import Control.Monad -import Control.Monad.State - -main :: IO () -main = do - args <- getArgs - forM_ args $ \ f -> do - entries <- UTF8.readFile f >>= (return . T.lines) - forM_ entries $ \ entry -> - do - let ws = T.words entry - form = head ws - tags = toPairs $ tail ws - forM_ tags $ \ (lemma, tag) -> - do - UTF8.putStrLn $ T.concat [lemma, sp, form, sp, tag] - where sp = T.singleton ' ' - - -toPairs xs = zip (stride 2 xs) (stride 2 (drop 1 xs)) - where stride _ [] = [] - stride n (x:xs) = x : stride n (drop (n-1) xs) diff --git a/contrib/eaglesconv/EaglesConv.hs b/contrib/eaglesconv/EaglesConv.hs deleted file mode 100644 index aa8929496..000000000 --- a/contrib/eaglesconv/EaglesConv.hs +++ /dev/null @@ -1,135 +0,0 @@ --- Copyright (C) 2011 Nikita Frolov - --- No, we can't pipeline parsing and generation, because there is no guarantee --- that we have collected all forms for a lemma before we've scanned the --- complete file. - -import qualified Data.Text as T -import qualified Data.Text.IO as UTF8 -import System.IO -import System.Environment -import Control.Monad -import Control.Monad.State -import qualified Data.Map as M -import Codec.Text.IConv -import qualified Data.ByteString.Lazy as BS -import qualified Data.ByteString.Internal as BSI - -import EaglesMatcher - -type Lemmas = M.Map T.Text Forms - -main :: IO () -main = do - args <- getArgs - forM_ args $ \ f -> do - entries <- UTF8.readFile f >>= (return . T.lines) - lemmas <- return $ execState (collectLemmas entries) (M.empty :: Lemmas) - mapM_ generateLin (M.assocs lemmas) - -collectLemmas entries = do - forM_ entries $ \ entry -> do - let ws = T.words entry - lemma = head ws - tags = toPairs $ tail ws - lemmas <- get - forM_ tags $ \ (form, tag) -> do - let forms = (case M.lookup lemma lemmas of - Just f -> f - Nothing -> M.empty) :: Forms - if isOpenCat . T.unpack $ tag - then put $ M.insert lemma (M.insert tag form forms) lemmas - else return () - -generateLin :: (T.Text, Forms) -> IO () -generateLin (lemma, forms) = do - let lemma' = myVeryOwnCyrillicRomanizationIConvSucks lemma - UTF8.putStr $ T.concat [T.pack "lin ", lemma'] - UTF8.putStr $ case T.unpack . head . M.keys $ forms of - ('N':_:_:_:g:a:'0':_) -> - T.concat $ [T.pack "_N = mkN "] - ++ map (quote . noun forms) [ ('N','S'), ('G','S') - , ('D','S'), ('F','S'), ('C','S'), ('O','S') - , ('L','S'), ('N','P'), ('G','P'), ('D','P') - , ('F','P'), ('C','P'), ('O','P') ] - ++ [showG g, sp, showAni a, ln] - ('N':_:c:n:g:a:_) -> - T.concat $ [T.pack "_PN = mkPN " - , quote $ noun forms ('N', 'S') - , showG g, sp - , showN n, sp, showAni a, ln] - ('A':_) -> - T.concat $ [T.pack "_A = mkA ", quote $ adj forms 'P', - if adj forms 'P' /= adj forms 'C' - then quote $ adj forms 'C' - else T.pack "" - , ln] - ('V':t) -> - let a = case t of - (_:_:_:_:'P':_:a':_) -> a' - (_:_:_:_:_:a':_) -> a' - in - T.concat $ [T.pack "_V = mkV ", showAsp a, sp] - ++ map (quote . verbPres forms) [ ('S','1'), ('S','2') - , ('S','3'), ('P','1') - , ('P','2'), ('P','3')] - ++ [ quote $ verbPast forms ('S', 'M') - , quote $ verbImp forms, quote $ verbInf forms, ln] - ('D':_) -> - T.concat $ [T.pack "_Adv = mkAdv " - , quote . adv $ forms, ln] - putStrLn "" - hFlush stdout - where quote x = T.concat [T.pack "\"", x, T.pack "\" "] - showG 'F' = T.pack "Fem" - showG 'A' = T.pack "Neut" - showG _ = T.pack "Masc" - showAni 'I' = T.pack "Inanimate" - showAni _ = T.pack "Animate" - showN 'P' = T.pack "Pl" - showN _ = T.pack "Sg" - showAsp 'F' = T.pack "Perfective" - showAsp _ = T.pack "Imperfective" - sp = T.singleton ' ' - ln = T.pack " ;" - -toPairs xs = zip (stride 2 xs) (stride 2 (drop 1 xs)) - where stride _ [] = [] - stride n (x:xs) = x : stride n (drop (n-1) xs) - -myVeryOwnCyrillicRomanizationIConvSucks s = T.pack . concatMap r . T.unpack $ s - where r 'а' = "a" - r 'б' = "b" - r 'в' = "v" - r 'г' = "g" - r 'д' = "d" - r 'е' = "je" - r 'ё' = "jo" - r 'ж' = "zh" - r 'з' = "z" - r 'и' = "i" - r 'й' = "jj" - r 'к' = "k" - r 'л' = "l" - r 'м' = "m" - r 'н' = "n" - r 'о' = "o" - r 'п' = "p" - r 'р' = "r" - r 'с' = "s" - r 'т' = "t" - r 'у' = "u" - r 'ф' = "f" - r 'х' = "kh" - r 'ц' = "c" - r 'ч' = "ch" - r 'ш' = "sh" - r 'щ' = "shc" - r 'ъ' = "yy" - r 'ы' = "y" - r 'ь' = "q" - r 'э' = "e" - r 'ю' = "ju" - r 'я' = "ja" - r '-' = "_" - r o = [o] diff --git a/contrib/eaglesconv/EaglesMatcher.hs b/contrib/eaglesconv/EaglesMatcher.hs deleted file mode 100644 index 27e76706f..000000000 --- a/contrib/eaglesconv/EaglesMatcher.hs +++ /dev/null @@ -1,63 +0,0 @@ --- Copyright (C) 2011 Nikita Frolov - --- The format specification can be found at --- http://devel.cpl.upc.edu/freeling/svn/trunk/doc/tagsets/tagset-ru.html - --- Bugs in the specification: --- Participle, 2nd field: case, not mood --- Participle, 6th field: field, not person --- Verb, persons can be denoted both with 'Pnumber' or just 'number' --- Noun, 10th field can be absent - --- No, it wouldn't be simpler to implement this grammar with Parsec or another --- parser combinator library. - - -module EaglesMatcher where - -import qualified Data.Text as T -import Data.List -import qualified Data.Map as M - -type Forms = M.Map T.Text T.Text - -isOpenCat ('A':_) = True -isOpenCat ('N':_) = True -isOpenCat ('V':_) = True -isOpenCat ('D':_) = True -isOpenCat _ = False - -noun forms (c, n) = findForm (matchNoun . T.unpack) forms - where matchNoun ('N':_:c':n':_) = c == c' && n == n' - matchNoun _ = False - -adj forms d = findForm (matchAdj . T.unpack) forms - where matchAdj ('A':'N':'S':'M':_:'F':d':_) = d == d - matchAdj _ = False - -verbPres forms (n, p) = findForm (matchPres . T.unpack) forms - where matchPres ('V':'D':n':_:'P':'P':p':_:'A':_) = n == n' && p == p' - matchPres ('V':'D':n':_:'F':'P':p':_:'A':_) = n == n' && p == p' - matchPres ('V':'D':n':_:'P':'P':p':_) = n == n' && p == p' - matchPres ('V':'D':n':_:'F':'P':p':_) = n == n' && p == p' - matchPres _ = False - -verbPast forms (n, g) = findForm (matchPast . T.unpack) forms - where matchPast ('V':'D':n':g':'S':_:_:'A':_) = n == n' && g == g' - matchPast _ = False - -verbImp forms = findForm (matchImp . T.unpack) forms - where matchImp ('V':'M':_) = True - matchImp _ = False - -verbInf forms = findForm (matchInf . T.unpack) forms - where matchInf ('V':'I':_) = True - matchInf _ = False - -adv forms = findForm (matchAdv . T.unpack) forms - where matchAdv ('D':d:_) = d == 'P' - matchAdv _ = False - -findForm match forms = case find match (M.keys forms) of - Just tag -> forms M.! tag - Nothing -> findForm (\ _ -> True) forms diff --git a/contrib/eaglesconv/EaglesParser.hs b/contrib/eaglesconv/EaglesParser.hs deleted file mode 100644 index 6fc64d3b8..000000000 --- a/contrib/eaglesconv/EaglesParser.hs +++ /dev/null @@ -1,239 +0,0 @@ --- Copyright (C) 2011 Nikita Frolov - --- An early version of the parser that requires somewhat more memory. Kept for --- nostalgic reasons. - -module EaglesParser where - -import qualified Data.Text as T -import Data.List -import qualified Data.Map as M - -type Forms = M.Map Tag T.Text - -data Tag = A Case Number Gender Animacy Form Degree Extra Obscene - | Adv Degree Extra Obscene - | AdvPron Extra - | Ord Case Number Gender Animacy - | AdjPron Case Number Gender Animacy Extra - | Frag Extra - | Conj Extra - | Inter Extra Obscene - | Num Case Number Gender Animacy Extra - | Part Extra - | Prep Extra - | N Case Number Gender Animacy Name Extra Obscene - | Pron Case Number Gender Animacy Extra - | V Mood Number Gender Tense Person Aspect Voice Trans Extra Obscene - | P Case Number Gender Tense Form Aspect Voice Trans Extra Obscene - deriving (Show, Ord, Eq) - -parseTag :: T.Text -> Tag -parseTag tag = case (T.unpack tag) of { - ('A':c:n:g:a:f:cmp:e:o:[]) -> A (readCase c) (readNumber n) - (readGender g) (readAnimacy a) - (readForm f) (readDegree cmp) - (readExtra e) (readObscene o) ; - ('D':cmp:e:o:[]) -> Adv (readDegree cmp) - (readExtra e) (readObscene o) ; - ('P':e:[]) -> AdvPron (readExtra e) ; - ('Y':c:n:g:a:[]) -> Ord (readCase c) (readNumber n) - (readGender g) (readAnimacy a) ; - ('R':c:n:g:a:e:[]) -> AdjPron (readCase c) (readNumber n) - (readGender g) (readAnimacy a) (readExtra e) ; - ('M':e:[]) -> Frag (readExtra e) ; - ('C':e:[]) -> Conj (readExtra e) ; - ('J':e:o:[]) -> Inter (readExtra e) (readObscene o) ; - ('Z':c:n:g:a:e:[]) -> Num (readCase c) (readNumber n) - (readGender g) (readAnimacy a) (readExtra e) ; - ('T':e:[]) -> Part (readExtra e) ; - ('B':e:[]) -> Prep (readExtra e) ; - ('N':_:c:n:g:a:name:e:o:_:[]) -> N (readCase c) (readNumber n) - (readGender g) (readAnimacy a) - (readName name) - (readExtra e) (readObscene o) ; - ('N':_:c:n:g:a:name:e:o:[]) -> N (readCase c) (readNumber n) - (readGender g) (readAnimacy a) - (readName name) - (readExtra e) (readObscene o) ; - ('E':c:n:g:a:e:[]) -> Pron (readCase c) (readNumber n) - (readGender g) (readAnimacy a) (readExtra e) ; - ('V':m:n:g:t:'P':p:a:v:tr:e:o:[]) -> V (readMood m) (readNumber n) - (readGender g) (readTense t) - (readPerson p) (readAspect a) - (readVoice v) (readTrans tr) - (readExtra e) (readObscene o) ; - ('V':m:n:g:t:'0':a:v:tr:e:o:[]) -> V (readMood m) (readNumber n) - (readGender g) (readTense t) - NP (readAspect a) - (readVoice v) (readTrans tr) - (readExtra e) (readObscene o) ; - ('V':m:n:g:t:p:a:v:tr:e:o:[]) -> V (readMood m) (readNumber n) - (readGender g) (readTense t) - (readPerson p) (readAspect a) - (readVoice v) (readTrans tr) - (readExtra e) (readObscene o) ; - ('Q':c:n:g:t:f:a:v:tr:e:o:[]) -> P (readCase c) (readNumber n) - (readGender g) (readTense t) - (readForm f) (readAspect a) - (readVoice v) (readTrans tr) - (readExtra e) (readObscene o) ; - _ -> error $ "Parse error: " ++ T.unpack tag } - -data Case = Nom | Gen | Dat | Acc | Inst | Prepos | Partit | Loc | Voc | NC - deriving (Show, Ord, Eq) - -readCase 'N' = Nom -readCase 'G' = Gen -readCase 'D' = Dat -readCase 'F' = Acc -readCase 'C' = Inst -readCase 'O' = Prepos -readCase 'P' = Partit -readCase 'L' = Loc -readCase 'V' = Voc -readCase '0' = NC - -data Number = Sg | Pl | NN deriving (Show, Ord, Eq) - -readNumber 'S' = Sg -readNumber 'P' = Pl -readNumber '0' = NN - -data Gender = Masc | Fem | Neut | Common | NG deriving (Show, Ord, Eq) - -readGender 'F' = Fem -readGender 'M' = Masc -readGender 'A' = Neut -readGender 'C' = Common -readGender '0' = NG - -data Animacy = Animate | Inanimate | NA deriving (Show, Ord, Eq) - -readAnimacy 'A' = Animate -readAnimacy 'I' = Inanimate -readAnimacy '0' = NA - -data Form = Short | Full | NF deriving (Show, Ord, Eq) - -readForm 'S' = Short -readForm 'F' = Full -readForm '0' = NF - -data Degree = Pos | Comp | Super | ND deriving (Show, Ord, Eq) - -readDegree 'E' = Super -readDegree 'C' = Comp -readDegree 'P' = Pos -readDegree '0' = ND - -data Extra = Introductory | Difficult | Distorted | Predicative - | Colloquial | Rare | Abbreviation | Obsolete | NE deriving (Show, Ord, Eq) - -readExtra 'P' = Introductory -readExtra 'D' = Difficult -readExtra 'V' = Distorted -readExtra 'R' = Predicative -readExtra 'I' = Colloquial -readExtra 'A' = Rare -readExtra 'B' = Abbreviation -readExtra 'E' = Obsolete -readExtra '0' = NE - -data Obscene = Obscene | NO deriving (Show, Ord, Eq) - -readObscene 'H' = Obscene -readObscene '0' = NO - -data Name = Topo | Proper | Patro | Family | NNa deriving (Show, Ord, Eq) - -readName 'G' = Topo -readName 'N' = Proper -readName 'S' = Patro -readName 'F' = Family -readName '0' = NNa - -data Mood = Gerund | Inf | Ind | Imp | NM deriving (Show, Ord, Eq) - -readMood 'G' = Gerund -readMood 'I' = Inf -readMood 'D' = Ind -readMood 'M' = Imp -readMood '0' = NM - -data Tense = Pres | Fut | Past | NT deriving (Show, Ord, Eq) - -readTense 'P' = Pres -readTense 'F' = Fut -readTense 'S' = Past -readTense '0' = NT - -data Person = P1 | P2 | P3 | NP deriving (Show, Ord, Eq) - -readPerson '1' = P1 -readPerson '2' = P2 -readPerson '3' = P3 - -data Aspect = Perf | Imperf | NAs deriving (Show, Ord, Eq) - -readAspect 'F' = Perf -readAspect 'N' = Imperf -readAspect '0' = NAs - -data Voice = Act | Pass | NV deriving (Show, Ord, Eq) - -readVoice 'A' = Act -readVoice 'S' = Pass -readVoice '0' = NV - -data Trans = Trans | Intrans | NTr deriving (Show, Ord, Eq) - -readTrans 'M' = Trans -readTrans 'A' = Intrans -readTrans '0' = NTr - -isOpenCat :: Tag -> Bool -isOpenCat (A _ _ _ _ _ _ _ _) = True -isOpenCat (N _ _ _ _ _ _ _) = True -isOpenCat (V _ _ _ _ _ _ _ _ _ _) = True -isOpenCat (Adv _ _ _) = True -isOpenCat _ = False - -noun :: Forms -> (Case, Number) -> T.Text -noun forms (c, n) = findForm matchNoun forms - where matchNoun (N c' n' _ _ _ _ _) = c == c' && n == n' - matchNoun _ = False - -adj :: Forms -> Degree -> T.Text -adj forms d = findForm matchAdj forms - where matchAdj (A _ _ _ _ _ d' _ _) = d == d - matchAdj _ = False - -verbPres :: Forms -> (Number, Person) -> T.Text -verbPres forms (n, p) = findForm matchPres forms - where matchPres (V Ind n' _ Pres p' _ Act _ _ _) = n == n' && p == p' - matchPres _ = False - -verbPast :: Forms -> (Number, Gender) -> T.Text -verbPast forms (n, g) = findForm matchPast forms - where matchPast (V Ind n' g' Past _ _ Act _ _ _) = n == n' && g == g' - matchPast _ = False - -verbImp :: Forms -> T.Text -verbImp forms = findForm matchImp forms - where matchImp (V Imp _ _ _ _ _ _ _ _ _) = True - matchImp _ = False - -verbInf :: Forms -> T.Text -verbInf forms = findForm matchInf forms - where matchInf (V Inf _ _ _ _ _ _ _ _ _) = True - matchInf _ = False - -adv :: Forms -> T.Text -adv forms = findForm matchAdv forms - where matchAdv (Adv d _ _) = d == Pos - matchAdv _ = False - -findForm match forms = case find match (M.keys forms) of - Just tag -> forms M.! tag - Nothing -> findForm (\ _ -> True) forms
\ No newline at end of file diff --git a/contrib/eaglesconv/README b/contrib/eaglesconv/README deleted file mode 100644 index e3c84c61d..000000000 --- a/contrib/eaglesconv/README +++ /dev/null @@ -1,24 +0,0 @@ -How to use: - -1) Sort the wordlist so it can be split into sublists. It is necessary because -the converter is quite memory-hungry, and you might not have enough RAM to -process the whole wordlist at once. - -./CollectLemmas dicc.src | sort > lemmas.src - -2) Split the sorted wordlist. - -split -l 500000 lemmas.src - -3) Splitting has probably left forms of some lemmas spread across two -sublists. Manually edit sublists so all forms for a lemma are present in just -one sublist. - -4) Run the converter. - -./run_conv.sh xa* - -5) The converter has produced abstract and concrete syntaxes for the -dictionary. You can try them out with GF: - -gf DictRus.gf
\ No newline at end of file diff --git a/contrib/eaglesconv/mkAbstract.sh b/contrib/eaglesconv/mkAbstract.sh deleted file mode 100644 index d07da18fc..000000000 --- a/contrib/eaglesconv/mkAbstract.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -echo "abstract DictRusAbs = Cat ** { -" -cat $1 | sed 's/^lin/fun/g;s/=.*$//g;s/\_N/\_N : N\;/g;s/\_PN/\_PN : PN\;/g;s/\_A /\_A : A\;/g;s/\_V/\_V : V\;/g;s/\_Adv/\_Adv : Adv\;/g' - -echo " -}"
\ No newline at end of file diff --git a/contrib/eaglesconv/mkConcrete.sh b/contrib/eaglesconv/mkConcrete.sh deleted file mode 100644 index 170ab9c5e..000000000 --- a/contrib/eaglesconv/mkConcrete.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -echo "--# -path=.:../prelude:../abstract:../common - -concrete DictRus of DictRusAbs = CatRus ** - open ParadigmsRus, Prelude, StructuralRus, MorphoRus in { -flags - optimize=values ; - coding=utf8 ; -" -cat $1 -echo "}" diff --git a/contrib/eaglesconv/run_conv.sh b/contrib/eaglesconv/run_conv.sh deleted file mode 100644 index 5ad586834..000000000 --- a/contrib/eaglesconv/run_conv.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -./EaglesConv "$@" +RTS -K256M -RTS > convtmp -./mkConcrete.sh convtmp > DictRus.gf -./mkAbstract.sh convtmp > DictRusAbs.gf diff --git a/contrib/py-bindings/Makefile b/contrib/py-bindings/Makefile deleted file mode 100644 index aff4d909f..000000000 --- a/contrib/py-bindings/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -src=../../src -import=-i$(src)/runtime/haskell:$(src)/compiler -cbind=../c-bindings -pyversion = $(shell python -c 'import sys; print ".".join(`t` for t in sys.version_info[:2])') -pythoninc=/usr/include/python$(pyversion) -debug= #-optc '-DDEBUG=1' -exdir=../../examples/tutorial/embedded - -build: gf.so - -test: - python test.py - -gf.so: PyGF.hs gfmodule.c Query.pgf - ghc $(import) --make -fglasgow-exts -O2 -no-hs-main -c $< - ghc -O2 --make -fglasgow-exts -no-hs-main -optl '-shared' \ - -optc '-DMODULE=$(basename $<)' $(debug) -optc '-I$(pythoninc)' -o $@ \ - $(filter-out %.pgf, $^) - - - -clean: - rm -f *.hi *.o - rm -f *_stub.* - rm -f PyGF.hs - -superclean: - make clean - rm -f Query.pgf - rm -f gf.so - rm -f mtest - -PyGF.hs: PyGF.hsc - hsc2hs -I$(pythoninc) $< - -Query.pgf: - gf --make $(exdir)/QueryEng.gf $(exdir)/QuerySpa.gf diff --git a/contrib/py-bindings/PyGF.hsc b/contrib/py-bindings/PyGF.hsc deleted file mode 100644 index fc827e68f..000000000 --- a/contrib/py-bindings/PyGF.hsc +++ /dev/null @@ -1,304 +0,0 @@ -{-# LANGUAGE ForeignFunctionInterface #-} --- --- GF Python bindings --- Jordi Saludes, upc.edu 2010, 2011 --- - -module PyGF where - -import PGF -import Foreign -import CString -import Foreign.C.Types -import Control.Monad -import Data.Map (keys, (!)) -import Data.Char (isSpace) - -#include "pygf.h" - -freeSp :: String -> Ptr a -> IO () -freeSp tname p = do - --DEBUG putStrLn $ "about to free pointer " ++ tname ++ " at " ++ (show p) - sp <- (#peek PyGF, sp) p - --DEBUG putStrLn "peeked" - freeStablePtr sp - --DEBUG putStrLn $ "freeing " ++ tname ++ " at " ++ (show p) - -instance Storable PGF where - sizeOf _ = (#size PyGF) - alignment _ = alignment (undefined::CInt) - poke p o = do - sp <- newStablePtr o - (#poke PyGF, sp) p sp - peek p = do - sp <- (#peek PyGF, sp) p - deRefStablePtr sp - -instance Storable Type where - sizeOf _ = (#size PyGF) - alignment _ = alignment (undefined::CInt) - poke p o = do - sp <- newStablePtr o - (#poke PyGF, sp) p sp - peek p = do - sp <- (#peek PyGF, sp) p - deRefStablePtr sp - -instance Storable Language where - sizeOf _ = (#size PyGF) - alignment _ = alignment (undefined::CInt) - poke p o = do - sp <- newStablePtr o - (#poke PyGF, sp) p sp - peek p = do - sp <- (#peek PyGF, sp) p - deRefStablePtr sp - -instance Storable Tree where - sizeOf _ = (#size PyGF) - alignment _ = alignment (undefined::CInt) - poke p o = do - sp <- newStablePtr o - (#poke PyGF, sp) p sp - peek p = do - sp <- (#peek PyGF, sp) p - deRefStablePtr sp - --- It is CId the same as Tree? - -{- instance Storable CId where - sizeOf _ = (#size PyGF) - alignment _ = alignment (undefined::CInt) - poke p o = do - sp <- newStablePtr o - (#poke PyGF, sp) p sp - peek p = do - sp <- (#peek PyGF, sp) p - deRefStablePtr sp --} - - -foreign export ccall gf_freePGF :: Ptr PGF -> IO () -foreign export ccall gf_freeType :: Ptr Type -> IO () -foreign export ccall gf_freeLanguage :: Ptr Language -> IO () -foreign export ccall gf_freeTree :: Ptr Tree -> IO () -foreign export ccall gf_freeExpr :: Ptr Expr -> IO () -foreign export ccall gf_freeCId :: Ptr CId -> IO () -gf_freePGF = freeSp "pgf" -gf_freeType = freeSp "type" -gf_freeLanguage = freeSp "language" -gf_freeTree = freeSp "tree" -gf_freeExpr = freeSp "expression" -gf_freeCId = freeSp "CId" - - -{-foreign export ccall gf_printCId :: Ptr CId-> IO CString -gf_printCId p = do - c <- peek p - newCString (showCId c) --} - -foreign export ccall gf_readPGF :: CString -> IO (Ptr PGF) -gf_readPGF path = do - ppgf <- pyPGF - p <- peekCString path - readPGF p >>= poke ppgf - return ppgf - -foreign export ccall gf_readLanguage :: Ptr Language -> CString -> IO Bool -gf_readLanguage pt str = do - s <- (peekCString str) - case (readLanguage s) of - Just x -> do - poke pt x - return True - Nothing -> return False - -foreign export ccall gf_startCat :: Ptr PGF -> IO (Ptr Type) -gf_startCat ppgf = do - pgf <- peek ppgf - pcat <- pyType - poke pcat (startCat pgf) - return pcat - -foreign export ccall gf_parse :: Ptr PGF -> Ptr Language -> Ptr Type -> CString -> IO (Ptr ()) -gf_parse ppgf plang pcat input = do - p <- peek ppgf - c <- peek pcat - i <- peekCString input - l <- peek plang - let parsed = parse p l c i - --DEBUG putStrLn $ (show $ length parsed) ++ " parsings" - listToPy pyTree parsed - -foreign export ccall gf_showExpr :: Ptr Expr -> IO CString -gf_showExpr pexpr = do - e <- peek pexpr - newCString (showExpr [] e) - -listToPy :: Storable a => IO (Ptr a) -> [a] -> IO (Ptr ()) -- opaque -- IO (Ptr (Ptr Language)) -listToPy mk ls = do - pyls <- pyList - mapM_ (mpoke pyls) ls - return pyls - where mpoke pyl l = do - pl <- mk - poke pl l - pyl << pl - - -listToPyStrings :: [String] -> IO (Ptr ()) -listToPyStrings ss = do - pyls <- pyList - mapM_ (mpoke pyls) ss - return pyls - where mpoke pyl s = do - cs <- newCString s - pcs <- pyString cs - pyl << pcs - - -foreign export ccall gf_showLanguage :: Ptr Language -> IO CString -gf_showLanguage plang = do - l <- peek plang - newCString $ showLanguage l - -foreign export ccall gf_showType :: Ptr Type -> IO CString -gf_showType ptp = do - t <- peek ptp - newCString $ showType [] t - -foreign export ccall gf_showPrintName :: Ptr PGF -> Ptr Language -> Ptr CId -> IO CString -gf_showPrintName ppgf plang pcid = do - pgf <- peek ppgf - lang <- peek plang - cid <- peek pcid - newCString (showPrintName pgf lang cid) - -foreign export ccall gf_abstractName :: Ptr PGF -> IO (Ptr Language) -gf_abstractName ppgf = do - pabs <- pyLang - pgf <- peek ppgf - poke pabs $ abstractName pgf - return pabs - -foreign export ccall gf_linearize :: Ptr PGF -> Ptr Language -> Ptr Tree -> IO CString -gf_linearize ppgf plang ptree = do - pgf <- peek ppgf - lang <- peek plang - tree <- peek ptree - newCString $ linearize pgf lang tree - -foreign export ccall gf_languageCode :: Ptr PGF -> Ptr Language -> IO CString -gf_languageCode ppgf plang = do - pgf <- peek ppgf - lang <- peek plang - case languageCode pgf lang of - Just s -> newCString s - Nothing -> return nullPtr - -foreign export ccall gf_languages :: Ptr PGF -> IO (Ptr ()) -- (Ptr (Ptr Language)) -gf_languages ppgf = do - pgf <- peek ppgf - listToPy pyLang $ languages pgf - -foreign export ccall gf_categories :: Ptr PGF -> IO (Ptr ()) -gf_categories ppgf = do - pgf <- peek ppgf - listToPy pyCId $ categories pgf - -foreign export ccall gf_showCId :: Ptr CId -> IO CString -gf_showCId pcid = do - cid <- peek pcid - newCString $ showCId cid - -foreign export ccall gf_unapp :: Ptr Expr -> IO (Ptr ()) -foreign export ccall gf_unint :: Ptr Expr -> IO CInt -foreign export ccall gf_unstr :: Ptr Expr -> IO CString - -gf_unapp pexp = do - exp <- peek pexp - case unApp exp of - Just (f,args) -> do - puexp <- pyList - pf <- pyCId - poke pf f - puexp << pf - mapM_ (\e -> do - pe <- pyExpr - poke pe e - puexp << pe) args - return puexp - Nothing -> return nullPtr -gf_unint pexp = do - exp <- peek pexp - return $ fromIntegral $ case unInt exp of - Just n -> n - _ -> (-9) -gf_unstr pexp = do - exp <- peek pexp - case unStr exp of - Just s -> newCString s - _ -> return nullPtr - -foreign export ccall gf_inferexpr :: Ptr PGF -> Ptr Expr -> IO (Ptr Type) -gf_inferexpr ppgf pexp = do - pgf <- peek ppgf - exp <- peek pexp - case inferExpr pgf exp of - Right (_,t) -> do - ptype <- pyType - poke ptype t - return ptype - Left _ -> return nullPtr - - -foreign export ccall gf_functions :: Ptr PGF -> IO (Ptr ()) -gf_functions ppgf = do - pgf <- peek ppgf - listToPy pyCId $ functions pgf - -foreign export ccall gf_functiontype :: Ptr PGF -> Ptr CId -> IO (Ptr Type) -gf_functiontype ppgf pcid = do - pgf <- peek ppgf - cid <- peek pcid - case functionType pgf cid of - Just t -> do - ptp <- pyType - poke ptp t - return ptp - _ -> return nullPtr - - -foreign export ccall gf_completions :: Ptr PGF -> Ptr Language -> Ptr Type -> CString -> IO (Ptr ()) -gf_completions ppgf plang pcat ctoks = do - pgf <- peek ppgf - lang <- peek plang - cat <- peek pcat - toks <- peekCString ctoks - let (rpre,rs) = break isSpace (reverse toks) - pre = reverse rpre - ws = words (reverse rs) - state0 = initState pgf lang cat - completions = - case loop state0 ws of - Nothing -> [] - Just state -> keys $ getCompletions state pre - listToPyStrings completions - where - loop ps [] = Just ps - loop ps (w:ws) = - case nextState ps (simpleParseInput w) of - Left _ -> Nothing - Right ps -> loop ps ws - - -foreign import ccall "newLang" pyLang :: IO (Ptr Language) -foreign import ccall "newPGF" pyPGF :: IO (Ptr PGF) -foreign import ccall "newTree" pyTree :: IO (Ptr Tree) -foreign import ccall "newgfType" pyType :: IO (Ptr Type) -foreign import ccall "newCId" pyCId :: IO (Ptr CId) -foreign import ccall "newExpr" pyExpr :: IO (Ptr Expr) -foreign import ccall "newList" pyList :: IO (Ptr ()) -foreign import ccall "newString" pyString :: CString -> IO (Ptr ()) -foreign import ccall "append" (<<) :: Ptr () -> Ptr a -> IO () diff --git a/contrib/py-bindings/example.rst b/contrib/py-bindings/example.rst deleted file mode 100644 index 770c6e862..000000000 --- a/contrib/py-bindings/example.rst +++ /dev/null @@ -1,147 +0,0 @@ -Using the GF python bindings -============================ - -This is how to use some of the functionalities of the GF shell inside Python. - -Loading a pgf file ------------------- -First you must import the library: - ->>> import gf - -then load a PGF file, like this tiny example: - ->>> pgf = gf.read_pgf("Query.pgf") - -We could ask for the supported languages: - ->>> pgf.languages() -[QueryEng, QuerySpa] - -The *start category* of the PGF module is: - ->>> pgf.startcat() -Question - -Parsing and linearizing ------------------------ - -Let's us save the languages for later: - ->>> eng,spa = pgf.languages() - -These are opaque objects, not strings: - ->>> type(eng) -<type 'gf.lang'> - -and must be used when parsing: - ->>> pgf.parse(eng, "is 42 prime") -[Prime (Number 42)] - -Yes, I know it should have a '?' at the end, but there is not support for other lexers at this time. - -Notice that parsing returns a list of gf trees. -Let's save it and linearize it in Spanish: - ->>> t = pgf.parse(eng, "is 42 prime") ->>> pgf.linearize(spa, t[0]) -'42 es primo' - -(which is not, but there is a '?' lacking at the end, remember?) - - -Getting parsing completions ---------------------------- -One of the good things of the GF shell is that it suggests you which tokens can continue the line you are composing. - -We got this also in the bindings. -Suppose we have no idea on how to start: - ->>> pgf.complete(eng, "") -['is'] - -so, there is only a sensible thing to put in. Let's continue: - ->>> pgf.complete(eng, "is ") -[] - -Is it important to note the blank space at the end, otherwise we get it again: - ->>> pgf.complete(eng, "is") -['is'] - -But, how come that nothing is suggested at "is "? -At the current point, a literal integer is expected so GF would have to present an infinite list of alternatives. I cannot blame it for refusing to do so. - ->>> pgf.complete(eng, "is 42 ") -['even', 'odd', 'prime'] - -Good. I will go for 'even', just to be in the safe side: - ->>> pgf.complete(eng, "is 42 even ") -[] - -Nothin again, but this time the phrase is complete. Let us check it by parsing: - ->>> pgf.parse(eng, "is 42 even") -[Even (Number 42)] - -Deconstructing gf trees ------------------------ -We store the last result and ask for its type: - ->>> t = pgf.parse(eng, "is 42 even")[0] ->>> type(t) -<type 'gf.tree'> - -What's inside this tree? We use ``unapply`` for that: - ->>> t.unapply() -[Even, Number 42] - -This method returns a list with the head of the **fun** judgement and its arguments: - ->>> map(type, _) -[<type 'gf.cid'>, <type 'gf.expr'>] - - -Notice the argument is again a tree (``gf.tree`` or ``gf.expr``, it is all the same here.) - ->>> t.unapply()[1] -Number 42 - - -We will repeat the trick with it now: - ->>> t.unapply()[1].unapply() -[Number, 42] - -and again, the same structure shows up: - ->>> map(type, _) -[<type 'gf.cid'>, <type 'gf.expr'>] - -One more time, just to get to the bottom of it: - ->>> t.unapply()[1].unapply()[1].unapply() -42 - -but now it is an actual number: - ->>> type(_) -<type 'int'> - -We ended with a full decomposed **fun** judgement. - - -Note ----- - -This file can be used to test the bindings: :: - - python -m doctest example.rst - - - diff --git a/contrib/py-bindings/gfmodule.c b/contrib/py-bindings/gfmodule.c deleted file mode 100644 index 99824fb77..000000000 --- a/contrib/py-bindings/gfmodule.c +++ /dev/null @@ -1,339 +0,0 @@ -// GF Python bindings -// Jordi Saludes, upc.edu 2010, 2011 -// - -#include <Python.h> -#include <sys/stat.h> -#include "pygf.h" - -/* utilities */ - -int -checkType(void* obj, PyTypeObject* tp) -{ - int isRight = PyObject_TypeCheck((PyObject*)obj, tp); - if (!isRight) - PyErr_Format(PyExc_TypeError, "Expecting a %s.", tp->tp_doc); - return isRight; -} - - -/* new types and declarations */ - -NEWGF(CId,GF_CId,CIdType,"gf.cid","identifier") -NEWGF(Lang,GF_Language,LangType,"gf.lang","language") -NEWGF(gfType,GF_Type,gfTypeType,"gf.type","gf type") -NEWGF(PGF,GF_PGF,PGFType,"gf.pgf","PGF module") -NEWGF(Expr,GF_Expr,ExprType,"gf.expr","gf expression") -NEWGF(Tree,GF_Tree,TreeType,"gf.tree","gf tree") - - -/* CId methods, constructor and destructor */ - -DEALLOCFN(CId_dealloc, CId, gf_freeCId, "freeCId") - - - -/* PGF methods, constructor and destructor */ - -DEALLOCFN(PGF_dealloc, PGF, gf_freePGF, "freePGF") - -static PyObject* -pgf_repr(PGF *self) { - Lang* lang = gf_abstractName(self); - char* abs = gf_showLanguage(lang); - Py_DECREF(lang); - PyObject* str = PyString_FromFormat("<gf.pgf with abstract %s>", abs); - free(abs); -return str; -} - -static PyObject* -languageCode(PGF *self, PyObject *args) -{ - Lang *lang; - if (!PyArg_ParseTuple(args, "O", &lang)) - return NULL; - if (!checkType(lang, &LangType)) return NULL; - char* scode = gf_languageCode(self, lang); - if (scode) { - PyObject* result = PyString_FromString(scode); - free(scode); - return result; - } else { - Py_INCREF(Py_None); - return Py_None; - } -} - -static PyObject* -linearize(PGF *self, PyObject *args) -{ - Lang *lang; - Tree *tree; - if (!PyArg_ParseTuple(args, "OO", &lang, &tree)) - return NULL; - if (!checkType(lang,&LangType)) return NULL; - if (!checkType(tree,&TreeType)) return NULL; - char* c_lin = gf_linearize(self, lang, tree); - PyObject* lin = PyString_FromString(c_lin); - free(c_lin); - return lin; -} - -static Lang* -abstractName(PGF *self) -{ - if (!checkType(self,&PGFType)) return NULL; - return gf_abstractName(self); -} - -static PyObject* -printName(PGF *self, PyObject *args) -{ - Lang* lang; - CId* id; - if (!PyArg_ParseTuple(args, "OO", &lang, &id)) - return NULL; - if (!checkType(lang,&LangType)) return NULL; - if (!checkType(id,&CIdType)) return NULL; - char *pname = gf_showPrintName(self, lang, id); - PyObject* result = PyString_FromString(pname); - free(pname); - return result; -} - -static gfType* -functiontype(PGF *self, PyObject* args) -{ - CId* cid; - gfType* gftp; - if (!PyArg_ParseTuple(args, "O", &cid)) - return NULL; - if (!checkType(cid,&CIdType)) { - PyErr_Format(PyExc_TypeError, "Must be a gf identifier."); - return NULL; - } - return gf_functiontype(self, cid); -} - - -static PyObject* -parse(PGF *self, PyObject *args, PyObject *kws) -{ - Lang *lang; - gfType *cat = NULL; - char *lexed; - static char *kwlist[] = {"lang", "lexed", "cat", NULL}; - if (!PyArg_ParseTupleAndKeywords(args, kws, "Os|O", kwlist, &lang, &lexed, &cat)) - return NULL; - if (!checkType(self, &PGFType)) return NULL; - if (!checkType(lang, &LangType)) return NULL; - if (cat) { - if (!checkType(cat, &gfTypeType)) return NULL; - } else { - cat = gf_startCat(self); - } - return gf_parse(self, lang, cat, lexed); -} - -static PGF* -readPGF(PyObject *self, PyObject *args) -{ - char *path; - struct stat info; - if (!PyArg_ParseTuple(args, "s", &path)) - return NULL; - if (stat(path, &info) == 0) { - PGF* pgf = gf_readPGF(path); - return pgf; - } else { - PyErr_Format(PyExc_IOError, "No such file: %s", path); - return NULL; - } -} - - -static PyObject* -completions(PGF *self, PyObject *args, PyObject *kws) -{ char *tokens; - Lang *lang; - gfType *cat = NULL; - static char *kwlist[] = {"lang", "tokens", "category", NULL}; - if (!PyArg_ParseTupleAndKeywords(args, kws, "Os|O", kwlist, &lang, &tokens, &cat)) - return NULL; - if (!checkType(self, &PGFType)) return NULL; - if (!checkType(lang, &LangType)) return NULL; - if (cat) { - if (!checkType(cat, &gfTypeType)) return NULL; - } else { - cat = gf_startCat(self); - } - return gf_completions(self, lang, cat, tokens); -} - - -static PyMethodDef pgf_methods[] = { - {"parse", (PyCFunction)parse, METH_VARARGS|METH_KEYWORDS, "Parse a string."}, - {"linearize", (PyCFunction)linearize, METH_VARARGS,"Linearize tree."}, - {"lang_code", (PyCFunction)languageCode, METH_VARARGS,"Get the language code."}, - {"print_name", (PyCFunction)printName, METH_VARARGS,"Get the print name for a id."}, - {"fun_type", (PyCFunction)functiontype, METH_VARARGS,"Get the type of a fun expression."}, - {"startcat", (PyCFunction)gf_startCat, METH_NOARGS,"Get the start category."}, - {"categories", (PyCFunction)gf_categories, METH_NOARGS,"Get all categories."}, - {"functions", (PyCFunction)gf_functions, METH_NOARGS,"Get all functions."}, - {"abstract", (PyCFunction)abstractName, METH_NOARGS,"Get the module abstract name."}, - {"languages", (PyCFunction)gf_languages, METH_NOARGS,"Get the module languages."}, - {"complete", (PyCFunction)completions, METH_VARARGS|METH_KEYWORDS, "Get completions for tokens."}, - {NULL, NULL, 0, NULL} /* Sentinel */ -}; - -REPRCB(CId_repr, CId, gf_showCId) - - -/* Language methods, constructor and destructor */ - -REPRCB(lang_repr, Lang, gf_showLanguage) -DEALLOCFN(Lang_dealloc, Lang, gf_freeLanguage, "freeLanguage") - -static Lang* -readLang(PyObject *self, PyObject *args) -{ - char *langName; - Lang *l; - if (!PyArg_ParseTuple(args,"s",&langName)) - return NULL; - l = (Lang*)LangType.tp_new(&LangType,NULL,NULL); - if(!l) return NULL; - gf_readLanguage(l,langName); - return l; -} - - - -/* gf types: methods, constructor and destructor */ - -DEALLOCFN(gfType_dealloc, gfType, gf_freeType, "freeType") -REPRCB(gfType_repr, gfType, gf_showType) - - -/* expression type: methods, destructor */ - -DEALLOCFN(expr_dealloc, Expr, gf_freeExpr, "freeExpr") -REPRCB(expr_repr, Expr, gf_showExpr) - - -static PyObject* -unapp(Expr *self) { - PyObject* obj = gf_unapp(self); - if (!obj) { - char* s = gf_unstr(self); - if (s) { - obj = PyString_FromString(s); - free(s); - } else { - long n = gf_unint(self); - if (n != -9) { - obj = PyInt_FromLong(n); - } else { - PyErr_Format(PyExc_TypeError, "Cannot unapply expr."); - } - } - } - return obj; -} - -static PyObject* -infer_expr(Expr *self, PyObject* args) { - PGF* pgf; - if (!PyArg_ParseTuple(args, "O", &pgf)) - return NULL; - if (!checkType(pgf, &PGFType)) { - PyErr_Format(PyExc_ValueError, "Must be a pgf module."); - return NULL; - } - return gf_inferexpr(pgf, self); -} - - - -/* todo: Is Tree == Expr ? */ - -static PyMethodDef expr_methods[] = { - {"unapply", (PyCFunction)unapp, METH_NOARGS, "Unapply an expression."}, - {"infer", (PyCFunction)infer_expr, METH_VARARGS, "Infer the type of an expression."}, - {NULL, NULL, 0, NULL} /* Sentinel */ -}; - - - -/* tree type: methods, constructor and destructor */ -// Are Expr and Tree equivalent ? - -REPRCB(tree_repr, Tree, gf_showExpr) -DEALLOCFN(Tree_dealloc, Tree, gf_freeTree, "freeTree") - - - - - -/* gf module methods */ - -static PyMethodDef gf_methods[] = { - {"read_pgf", (PyCFunction)readPGF, METH_VARARGS,"Read pgf file."}, - {"read_language", (PyCFunction)readLang, METH_VARARGS,"Get the language."}, - {NULL, NULL, 0, NULL} /* Sentinel */ -}; - - -#ifndef PyMODINIT_FUNC/* declarations for DLL import/export */ -#define PyMODINIT_FUNC void -#endif - -PyMODINIT_FUNC -initgf(void) -{ - PyObject* m; -#define READYTYPE(t,trepr,tdealloc) t.tp_new = PyType_GenericNew; \ - t.tp_repr = (reprfunc)trepr; \ - t.tp_dealloc = (destructor)tdealloc; \ - if (PyType_Ready(&t) < 0) return; - - READYTYPE(CIdType, CId_repr, CId_dealloc) - - PGFType.tp_methods = pgf_methods; - READYTYPE(PGFType, pgf_repr, PGF_dealloc) - - READYTYPE(LangType, lang_repr, Lang_dealloc) - - READYTYPE(gfTypeType, gfType_repr, gfType_dealloc) - - ExprType.tp_methods = expr_methods; - READYTYPE(ExprType, expr_repr, expr_dealloc) - - TreeType.tp_methods = expr_methods; // Tree == Expr ? - READYTYPE(TreeType, tree_repr, Tree_dealloc) - - m = Py_InitModule3("gf", gf_methods, - "Grammatical Framework."); - static char *argv[] = {"gf.so", 0}, **argv_ = argv; - static int argc = 1; - gf_init (&argc, &argv_); - hs_add_root (__stginit_PyGF); - -#define ADDTYPE(t) Py_INCREF(&t);\ -PyModule_AddObject(m, "gf", (PyObject *)&t); - - ADDTYPE(PGFType) - ADDTYPE(LangType) - ADDTYPE(gfTypeType) - ADDTYPE(TreeType) - ADDTYPE(ExprType) -} - - -/* List utilities to be imported by FFI */ - -inline PyObject* newList() { return PyList_New(0); } -inline PyObject* newString(const char *s) { return PyString_FromString(s); } -inline void append(PyObject* l, PyObject* ob) { PyList_Append(l, ob); } diff --git a/contrib/py-bindings/lgpl-3.0.txt b/contrib/py-bindings/lgpl-3.0.txt deleted file mode 100644 index cca7fc278..000000000 --- a/contrib/py-bindings/lgpl-3.0.txt +++ /dev/null @@ -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. diff --git a/contrib/py-bindings/pygf.h b/contrib/py-bindings/pygf.h deleted file mode 100644 index 04f142bcf..000000000 --- a/contrib/py-bindings/pygf.h +++ /dev/null @@ -1,96 +0,0 @@ -#include <Python.h> -#include "HsFFI.h" - -#ifdef __GLASGOW_HASKELL__ -#include "PyGF_stub.h" - -extern void __stginit_PyGF ( void ); -#endif - -static inline void gf_init(int *argc, char ***argv) -{ - hs_init(argc, argv); -#ifdef __GLASGOW_HASKELL__ - hs_add_root(__stginit_PyGF); -#endif -} - -static inline void gf_exit(void) -{ - hs_exit(); -} - -typedef HsStablePtr GF_PGF; -typedef HsStablePtr GF_CId; -typedef HsStablePtr GF_Language; -typedef HsStablePtr GF_Type; -typedef HsStablePtr GF_Tree; -typedef HsStablePtr GF_Expr; -typedef struct { - PyObject_HEAD; - HsStablePtr sp; -} PyGF; - - -#define NEWOBJECT(OBJ, GFTYPE) typedef struct {\ - PyObject_HEAD \ - GFTYPE obj; \ - } OBJ; - -#define PYTYPE(OBJ) OBJ ## Type -#define NEWCONSTRUCTOR(OBJ) inline OBJ* new ## OBJ () {\ - return (OBJ*)PYTYPE(OBJ).tp_new(&PYTYPE(OBJ),NULL,NULL); } - -#define NEWTYPE(TYPE,NAME,OBJECT,DOC) static PyTypeObject TYPE = {\ - PyObject_HEAD_INIT(NULL)\ - 0, /*ob_size*/\ - NAME, /*tp_name*/\ - sizeof(OBJECT), /*tp_basicsize*/\ - 0, /*tp_itemsize*/\ - 0, /*tp_dealloc*/\ - 0, /*tp_print*/\ - 0, /*tp_getattr*/\ - 0, /*tp_setattr*/\ - 0, /*tp_compare*/\ - 0, /*tp_repr*/\ - 0, /*tp_as_number*/\ - 0, /*tp_as_sequence*/\ - 0, /*tp_as_mapping*/\ - 0, /*tp_hash */\ - 0, /*tp_call*/\ - 0, /*tp_str*/\ - 0, /*tp_getattro*/\ - 0, /*tp_setattro*/\ - 0, /*tp_as_buffer*/\ - Py_TPFLAGS_DEFAULT, /*tp_flags*/\ - DOC, /* tp_doc */\ - }; -#define NEWGF(OBJ,GFTYPE,TYPE,NAME,DOC) NEWOBJECT(OBJ,GFTYPE) \ - NEWTYPE(TYPE,NAME,OBJ,DOC)\ - NEWCONSTRUCTOR(OBJ) - - -// NEWOBJECT(CID, GF_CId) - -#ifdef DEBUG -#define DEALLOCFN(delname,t,cb,cbname) static void \ -delname(t *self){ cb(self);\ - printf("gf_%s has been called for stable pointer 0x%x\n", cbname, self->obj);\ - self->ob_type->tp_free((PyObject*)self); } -#else -#define DEALLOCFN(delname,t,cb,cbname) static void \ -delname(t *self){ cb(self);\ - self->ob_type->tp_free((PyObject*)self); } -#endif - -#ifdef DEBUG -#define REPRCB(cbid,t,gfcb) static PyObject* \ -cbid(t *self) { \ - const char *str = gfcb(self); \ - return PyString_FromFormat("0x%x: %s", self->obj, str); } -#else -#define REPRCB(cbid,t,gfcb) static PyObject* \ -cbid(t *self) { \ - const char *str = gfcb(self); \ - return PyString_FromString(str); } -#endif diff --git a/contrib/py-bindings/test.py b/contrib/py-bindings/test.py deleted file mode 100644 index 9ea6c1f45..000000000 --- a/contrib/py-bindings/test.py +++ /dev/null @@ -1,187 +0,0 @@ -#!/usr/bin/env python -# GF Python bindings -# Jordi Saludes 2010 -# - - -import gf -import unittest - -samples = [ - (['Odd', ['Number', 89]], - {'eng': "is 89 odd", - 'spa': "89 es impar"}), - (['Prime', ['Number', 21]], - {'eng': "is 21 prime", - 'spa': "21 es primo"})] - -def lang2iso(l): - s = rmprefix(l) - assert s[:5]=="Query" - return s[5:].lower() - -def exp2str(e): - def e2s(e,n): - if type(e) == type([2]): - f = e[0] - sr = ' '.join([e2s(arg,n+1) for arg in e[1:]]) - ret =f + ' ' + sr - return n and '('+ret+')' or ret - elif type(e) == type('2'): - return e - elif type(e) == type(2): - return `e` - else: - raise ValueError, "Do not know how to render " + `e` - return e2s(e,0) - - -import re -hexre = re.compile('0x[0-9a-f]+:[ ]*') -def rmprefix(obj): - return `obj` -# s = `obj` -# m = hexre.match(s) -# return m and s[m.end(0):] - -class TestPgfInfo(unittest.TestCase): - def pgf(self, path=None): - path = path or self.path - return gf.read_pgf(path) - def setUp(self): - self.path = 'Query.pgf' - def test_readPgf(self): - pgf = self.pgf() - self.assertNotEqual(pgf,None) - def test_readNonExistent(self): - nopath = 'x' + self.path - self.assertRaises(IOError, self.pgf, nopath) - def test_startcat(self): - pgf = self.pgf() - cat = pgf.startcat() - self.assertEqual(rmprefix(cat),'Question') - def test_categories(self): - pgf = self.pgf() - cats = [`c` for c in pgf.categories()] - self.failUnless('Float' in cats) - self.failUnless('Int' in cats) - self.failUnless('String' in cats) - def test_createLanguage(self): - pgf = self.pgf() - for lang in 'QueryEng QuerySpa'.split(): - l = gf.read_language(lang) - self.assertEqual(rmprefix(l),lang) - def test_functions(self): - pgf = self.pgf() - self.assertTrue('Even' in [`f` for f in pgf.functions()]) - def test_function_types(self): - pgf = self.pgf() - gftypes = dict((`f`,`pgf.fun_type(f)`) for f in pgf.functions()) - for p in "Prime : Object -> Question; Yes : Answer".split(';'): - lhs,rhs = [s.strip() for s in p.split(':')] - self.assertEqual(gftypes[lhs],rhs) - -class TestParsing(unittest.TestCase): - def setUp(self): - self.lexed = samples - self.lang = 'QueryEng' - self.pgf = "Query.pgf" - - def test_parse(self): - pgf = gf.read_pgf(self.pgf) - l = gf.read_language(self.lang) - for abs,cnc in self.lexed: - rabs = exp2str(abs) - ps = pgf.parse(l, cnc['eng']) - self.failUnless(ps) - pt = rmprefix(ps[0]) - self.assertEqual(pt,rabs) - - -class TestLinearize(unittest.TestCase): - def setUp(self): - self.samples = samples - self.pgf = gf.read_pgf('Query.pgf') - self.lang = gf.read_language('QueryEng') - - def test_Linearize(self): - l = self.lang - for abs,cnc in self.samples: - ts = self.pgf.parse(l, cnc['eng']) - self.assertEqual(cnc['eng'],self.pgf.linearize(l,ts[0])) - -class TestTranslate(unittest.TestCase): - def setUp(self): - self.samples = samples - self.pgf = gf.read_pgf('Query.pgf') - self.langs = [(lang2iso(l),l) for l in self.pgf.languages()] - - def test_translate(self): - for abs,cnc in self.samples: - for i,l in self.langs: - for j,m in self.langs: - if i==j: continue - parsed = self.pgf.parse(l, cnc[i]) - assert len(parsed) == 1 - lin = self.pgf.linearize(m,parsed[0]) - self.assertEqual(lin,cnc[j]) - -class TestUnapplyExpr(unittest.TestCase): - def setUp(self): - self.samples = samples - self.pgf = gf.read_pgf('Query.pgf') - self.langs = dict([(lang2iso(l),l) for l in self.pgf.languages()]) - - def deep_unapp(self,exp): - exp = exp.unapply() - if type(exp) == type([2]): - f = exp[0] - return [`f`] + map(self.deep_unapp,exp[1:]) - else: - return exp - - - def test_unapply(self): - lg = 'eng' - lang = self.langs[lg] - for abs,cnc in self.samples: - parsed = self.pgf.parse(lang, cnc[lg]) - uparsed = self.deep_unapp(parsed[0]) - self.assertEqual(abs,uparsed) - - def test_infer(self): - lg = 'eng' - lang = self.langs[lg] - cnc = self.samples[0][1] - parsed = self.pgf.parse(lang, cnc[lg]) - exp = parsed[0] - for t in 'Question Object Int'.split(): - self.assertEqual(`exp.infer(self.pgf)`, t) - uexp = exp.unapply() - if type(uexp) != type(2) and type(uexp) != type('2'): - exp = uexp[1] - - -class TestComplete(unittest.TestCase): - def setUp(self): - self.lexed = samples - self.pgf = gf.read_pgf('Query.pgf') - self.langs = dict([(lang2iso(l),l) for l in self.pgf.languages()]) - - def test_complete(self): - for (_,d) in self.lexed: - for l,text in d.items(): - lang = self.langs[l] - for k in range(len(text)): - if text[k].isdigit() or text[k-1].isdigit(): # No completion for integer literals - continue - comps = self.pgf.complete(lang,text[:k]) - self.assertNotEqual(comps, [], - msg="while completing '%s^%s'" % (text[:k],text[k:])) - - self.assertTrue(any(w in text for w in comps), - msg="None of %s is in '%s'" % (comps,text)) - - -if __name__ == '__main__': - unittest.main() diff --git a/contrib/summerschool/2013/bestPractices/Facebook.gf b/contrib/summerschool/2013/bestPractices/Facebook.gf deleted file mode 100644 index 859f6abff..000000000 --- a/contrib/summerschool/2013/bestPractices/Facebook.gf +++ /dev/null @@ -1,35 +0,0 @@ -abstract Facebook = { - -flags startcat = Action ; - -cat - SPerson; - Person; - Place; - Page; - Action; - Item ; - -fun - CheckIn : SPerson -> Place -> Action ; - BeFriends : SPerson -> Person -> Action ; - Like : SPerson -> Item -> Action ; - - SPersonToPerson : SPerson -> Person ; - MorePersons : SPerson -> Person -> Person ; - - PlaceToItem : Place -> Item ; - PageToItem : Page -> Item ; - ActionToItem : Action -> Item ; - - ---------- - -You : SPerson ; -John : SPerson; -Mary : SPerson; - -Frauinsel : Place; -GF : Page; - -}
\ No newline at end of file diff --git a/contrib/summerschool/2013/bestPractices/FacebookEng.gf b/contrib/summerschool/2013/bestPractices/FacebookEng.gf deleted file mode 100644 index 6f4a448d8..000000000 --- a/contrib/summerschool/2013/bestPractices/FacebookEng.gf +++ /dev/null @@ -1,14 +0,0 @@ - -concrete FacebookEng of Facebook = FacebookI with - (Syntax = SyntaxEng), - (LexFacebook = LexFacebookEng) ** - open ParadigmsEng in { - -lin -You = you_NP ; -John = mkNP (mkPN "John") ; -Mary = mkNP (mkPN "Mary") ; -Frauinsel = mkNP (mkPN "Frauinsel") ; -GF = mkNP (mkPN "GF") ; - -}
\ No newline at end of file diff --git a/contrib/summerschool/2013/bestPractices/FacebookI.gf b/contrib/summerschool/2013/bestPractices/FacebookI.gf deleted file mode 100644 index 5c798e1e3..000000000 --- a/contrib/summerschool/2013/bestPractices/FacebookI.gf +++ /dev/null @@ -1,29 +0,0 @@ -incomplete concrete FacebookI of Facebook = - open - Syntax, - Prelude, - LexFacebook - in -{ -lincat - SPerson = NP ; - Person = NP ; - Place = NP ; - Page = NP ; - Action = S ; - Item = NP ; - - -lin -SPersonToPerson sperson = sperson ; -MorePersons sperson person = mkNP and_Conj sperson person ; - -PlaceToItem place = place ; -PageToItem page = page ; -ActionToItem action = nounFromS action ; - -CheckIn sperson place = mkS pastTense (mkCl sperson (checkIn place)) ; -BeFriends sperson person = mkS pastTense (mkCl sperson (beFriends person)) ; -Like sperson item = like sperson item ; - -}
\ No newline at end of file diff --git a/contrib/summerschool/2013/bestPractices/LexFacebook.gf b/contrib/summerschool/2013/bestPractices/LexFacebook.gf deleted file mode 100644 index e6ee7b5c8..000000000 --- a/contrib/summerschool/2013/bestPractices/LexFacebook.gf +++ /dev/null @@ -1,8 +0,0 @@ -interface LexFacebook = open Syntax in -{ -oper -nounFromS : S -> NP ; -checkIn : NP -> VP ; -beFriends : NP -> VP ; -like : NP -> NP -> S ; -}
\ No newline at end of file diff --git a/contrib/summerschool/2013/bestPractices/LexFacebookEng.gf b/contrib/summerschool/2013/bestPractices/LexFacebookEng.gf deleted file mode 100644 index 1d065fdb4..000000000 --- a/contrib/summerschool/2013/bestPractices/LexFacebookEng.gf +++ /dev/null @@ -1,16 +0,0 @@ -instance LexFacebookEng of LexFacebook = - open SyntaxEng, - ParadigmsEng, - --ExtraEng, - IrregEng in -{ -oper - nounFromS s = mkNP (mkNP the_Det (mkCN (mkN "fact"))) (SyntaxEng.mkAdv that_Subj s) ; - - checkIn np = mkVP (mkV2 (partV (mkV "check") "in") (mkPrep "to")) np ; - - beFriends np = mkVP (mkVP (dirV2 become_V) (mkNP a_Art plNum (mkCN (mkN "friend")))) (SyntaxEng.mkAdv (mkPrep "with") np) ; - - like np1 np2 = mkS (mkCl np1 (mkVP (dirV2 (mkV "like")) np2)) ; - -}
\ No newline at end of file diff --git a/contrib/summerschool/2013/bestPractices/corpus.txt b/contrib/summerschool/2013/bestPractices/corpus.txt deleted file mode 100644 index 7ff207000..000000000 --- a/contrib/summerschool/2013/bestPractices/corpus.txt +++ /dev/null @@ -1,7 +0,0 @@ -You and John are now friends. You became friends with John. -You became friends with John and Mary. -You checked in to Frauinsel. -You like GF. -You like Frauinsel. -You like that John checked in to Frauinsel. -You like that you became friends with John and Mary. diff --git a/contrib/summerschool/foods/CharactersGla.gf b/contrib/summerschool/foods/CharactersGla.gf deleted file mode 100644 index 453741a52..000000000 --- a/contrib/summerschool/foods/CharactersGla.gf +++ /dev/null @@ -1,12 +0,0 @@ -resource CharactersGla = {
-
- --Character classes
- oper
- vowel : pattern Str = #("a"|"e"|"i"|"o"|"u"|""|""|""|""|"") ;
- vowelCap : pattern Str = #("A"|"E"|"I"|"O"|"U"|""|""|""|""|"") ;
- consonant : pattern Str = #("b"|"c"|"d"|"f"|"g"|"h"|"j"|"k"|"l"|"m"|"n"|"p"|"q"|"r"|"s"|"t"|"v"|"w"|"x"|"z") ;
- consonantCap : pattern Str = #("B"|"C"|"D"|"F"|"G"|"H"|"J"|"K"|"L"|"M"|"N"|"P"|"Q"|"R"|"S"|"T"|"V"|"W"|"X"|"Z") ;
- broadVowel : pattern Str = #("a"|"o"|"u"|""|""|"") ;
- slenderVowel : pattern Str = #("e"|"i"|""|"") ;
-
-}
\ No newline at end of file diff --git a/contrib/summerschool/foods/CharactersGle.gf b/contrib/summerschool/foods/CharactersGle.gf deleted file mode 100644 index 4e7f454cc..000000000 --- a/contrib/summerschool/foods/CharactersGle.gf +++ /dev/null @@ -1,12 +0,0 @@ -resource CharactersGle = {
-
- --Character classes
- oper
- vowel : pattern Str = #("a"|"e"|"i"|"o"|"u"|""|""|""|""|"") ;
- vowelCap : pattern Str = #("A"|"E"|"I"|"O"|"U"|""|""|""|""|"") ;
- consonant : pattern Str = #("b"|"c"|"d"|"f"|"g"|"h"|"j"|"k"|"l"|"m"|"n"|"p"|"q"|"r"|"s"|"t"|"v"|"w"|"x"|"z") ;
- consonantCap : pattern Str = #("B"|"C"|"D"|"F"|"G"|"H"|"J"|"K"|"L"|"M"|"N"|"P"|"Q"|"R"|"S"|"T"|"V"|"W"|"X"|"Z") ;
- broadVowel : pattern Str = #("a"|"o"|"u"|""|""|"") ;
- slenderVowel : pattern Str = #("e"|"i"|""|"") ;
-
-}
\ No newline at end of file diff --git a/contrib/summerschool/foods/Foods.gf b/contrib/summerschool/foods/Foods.gf deleted file mode 100644 index 8ea02f39d..000000000 --- a/contrib/summerschool/foods/Foods.gf +++ /dev/null @@ -1,15 +0,0 @@ --- (c) 2009 Aarne Ranta under LGPL - -abstract Foods = { - flags startcat = Comment ; - cat - Comment ; Item ; Kind ; Quality ; - fun - Pred : Item -> Quality -> Comment ; - This, That, These, Those : Kind -> Item ; - Mod : Quality -> Kind -> Kind ; - Wine, Cheese, Fish, Pizza : Kind ; - Very : Quality -> Quality ; - Fresh, Warm, Italian, - Expensive, Delicious, Boring : Quality ; -} diff --git a/contrib/summerschool/foods/FoodsAfr.gf b/contrib/summerschool/foods/FoodsAfr.gf deleted file mode 100644 index 1a251ceb3..000000000 --- a/contrib/summerschool/foods/FoodsAfr.gf +++ /dev/null @@ -1,76 +0,0 @@ --- (c) 2009 Laurette Pretorius Sr & Jr and Ansu Berg under LGPL - -concrete FoodsAfr of Foods = open Prelude, Predef in{ - lincat - Comment = {s: Str} ; - Kind = {s: Number => Str} ; - Item = {s: Str ; n: Number} ; - Quality = {s: AdjAP => Str} ; - - lin - Pred item quality = {s = item.s ++ "is" ++ (quality.s ! Predic)}; - This kind = {s = "hierdie" ++ (kind.s ! Sg); n = Sg}; - That kind = {s = "daardie" ++ (kind.s ! Sg); n = Sg}; - These kind = {s = "hierdie" ++ (kind.s ! Pl); n = Pl}; - Those kind = {s = "daardie" ++ (kind.s ! Pl); n = Pl}; - Mod quality kind = {s = table{n => (quality.s ! Attr) ++ (kind.s!n)}}; - - Wine = declNoun_e "wyn"; - Cheese = declNoun_aa "kaas"; - Fish = declNoun_ss "vis"; - Pizza = declNoun_s "pizza"; - - Very quality = veryAdj quality; - - Fresh = regAdj "vars"; - Warm = regAdj "warm"; - Italian = smartAdj_e "Italiaans"; - Expensive = regAdj "duur"; - Delicious = smartAdj_e "heerlik"; - Boring = smartAdj_e "vervelig"; - - param - AdjAP = Attr | Predic ; - Number = Sg | Pl ; - - oper - --Noun operations (wyn, kaas, vis, pizza) - - declNoun_aa: Str -> {s: Number => Str} = \x -> - let v = tk 2 x - in - {s = table{Sg => x ; Pl => v + (last x) +"e"}}; - - declNoun_e: Str -> {s: Number => Str} = \x -> {s = table{Sg => x ; Pl => x + "e"}} ; - declNoun_s: Str -> {s: Number => Str} = \x -> {s = table{Sg => x ; Pl => x + "s"}} ; - - declNoun_ss: Str -> {s: Number => Str} = \x -> {s = table{Sg => x ; Pl => x + (last x) + "e"}} ; - - - --Adjective operations - - mkAdj : Str -> Str -> {s: AdjAP => Str} = \x,y -> {s = table{Attr => x; Predic => y}}; - - declAdj_e : Str -> {s : AdjAP=> Str} = \x -> mkAdj (x + "e") x; - declAdj_g : Str -> {s : AdjAP=> Str} = \w -> - let v = init w - in mkAdj (v + "") w ; - - declAdj_oog : Str -> {s : AdjAP=> Str} = \w -> - let v = init w - in - let i = init v - in mkAdj (i + "") w ; - - regAdj : Str -> {s : AdjAP=> Str} = \x -> mkAdj x x; - - veryAdj : {s: AdjAP => Str} -> {s : AdjAP=> Str} = \x -> {s = table{a => "baie" ++ (x.s!a)}}; - - - smartAdj_e : Str -> {s : AdjAP=> Str} = \a -> case a of - { - _ + "oog" => declAdj_oog a ; - _ + ("e" | "ie" | "o" | "oe") + "g" => declAdj_g a ; - _ => declAdj_e a - }; -} diff --git a/contrib/summerschool/foods/FoodsAmh.gf b/contrib/summerschool/foods/FoodsAmh.gf deleted file mode 100644 index e8915d86f..000000000 --- a/contrib/summerschool/foods/FoodsAmh.gf +++ /dev/null @@ -1,21 +0,0 @@ -concrete FoodsAmh of Foods ={ - flags coding = utf8; - lincat - Comment,Item,Kind,Quality = Str; - lin - Pred item quality = item ++ quality++ "ነው::" ; - This kind = "ይህ" ++ kind; - That kind = "ያ" ++ kind; - Mod quality kind = quality ++ kind; - Wine = "ወይን"; - Cheese = "አይብ"; - Fish = "ዓሳ"; - Very quality = "በጣም" ++ quality; - Fresh = "አዲስ"; - Warm = "ትኩስ"; - Italian = "የጥልያን"; - Expensive = "ውድ"; - Delicious = "ጣፋጭ"; - Boring = "አስቀያሚ"; - -}
\ No newline at end of file diff --git a/contrib/summerschool/foods/FoodsBul.gf b/contrib/summerschool/foods/FoodsBul.gf deleted file mode 100644 index ac9127669..000000000 --- a/contrib/summerschool/foods/FoodsBul.gf +++ /dev/null @@ -1,43 +0,0 @@ --- (c) 2009 Krasimir Angelov under LGPL - -concrete FoodsBul of Foods = { - - flags - coding = utf8; - - param - Gender = Masc | Fem | Neutr; - Number = Sg | Pl; - Agr = ASg Gender | APl ; - - lincat - Comment = Str ; - Quality = {s : Agr => Str} ; - Item = {s : Str; a : Agr} ; - Kind = {s : Number => Str; g : Gender} ; - - lin - Pred item qual = item.s ++ case item.a of {ASg _ => "е"; APl => "са"} ++ qual.s ! item.a ; - - This kind = {s=case kind.g of {Masc=>"този"; Fem=>"тази"; Neutr=>"това" } ++ kind.s ! Sg; a=ASg kind.g} ; - That kind = {s=case kind.g of {Masc=>"онзи"; Fem=>"онази"; Neutr=>"онова"} ++ kind.s ! Sg; a=ASg kind.g} ; - These kind = {s="тези" ++ kind.s ! Pl; a=APl} ; - Those kind = {s="онези" ++ kind.s ! Pl; a=APl} ; - - Mod qual kind = {s=\\n => qual.s ! (case n of {Sg => ASg kind.g; Pl => APl}) ++ kind.s ! n; g=kind.g} ; - - Wine = {s = table {Sg => "вино"; Pl => "вина"}; g = Neutr}; - Cheese = {s = table {Sg => "сирене"; Pl => "сирена"}; g = Neutr}; - Fish = {s = table {Sg => "риба"; Pl => "риби"}; g = Fem}; - Pizza = {s = table {Sg => "пица"; Pl => "пици"}; g = Fem}; - - Very qual = {s = \\g => "много" ++ qual.s ! g}; - - Fresh = {s = table {ASg Masc => "свеж"; ASg Fem => "свежа"; ASg Neutr => "свежо"; APl => "свежи"}}; - Warm = {s = table {ASg Masc => "горещ"; ASg Fem => "гореща"; ASg Neutr => "горещо"; APl => "горещи"}}; - Italian = {s = table {ASg Masc => "италиански"; ASg Fem => "италианска"; ASg Neutr => "италианско"; APl => "италиански"}}; - Expensive = {s = table {ASg Masc => "скъп"; ASg Fem => "скъпа"; ASg Neutr => "скъпо"; APl => "скъпи"}}; - Delicious = {s = table {ASg Masc => "превъзходен"; ASg Fem => "превъзходна"; ASg Neutr => "превъзходно"; APl => "превъзходни"}}; - Boring = {s = table {ASg Masc => "еднообразен"; ASg Fem => "еднообразна"; ASg Neutr => "еднообразно"; APl => "еднообразни"}}; - -} diff --git a/contrib/summerschool/foods/FoodsCat.gf b/contrib/summerschool/foods/FoodsCat.gf deleted file mode 100644 index 5ad38d0dc..000000000 --- a/contrib/summerschool/foods/FoodsCat.gf +++ /dev/null @@ -1,7 +0,0 @@ ---# -path=.:present - --- (c) 2009 Jordi Saludes under LGPL - -concrete FoodsCat of Foods = FoodsI with - (Syntax = SyntaxCat), - (LexFoods = LexFoodsCat) ; diff --git a/contrib/summerschool/foods/FoodsChi.gf b/contrib/summerschool/foods/FoodsChi.gf deleted file mode 100644 index 163aa0eb1..000000000 --- a/contrib/summerschool/foods/FoodsChi.gf +++ /dev/null @@ -1,35 +0,0 @@ -concrete FoodsChi of Foods = { -flags coding = utf8 ; -lincat - Comment, Item = Str ; - Kind = {s,c : Str} ; - Quality = {s,p : Str} ; -lin - Pred item quality = item ++ "是" ++ quality.s ++ quality.p ; - This kind = "这" ++ kind.c ++ kind.s ; - That kind = "那" ++ kind.c ++ kind.s ; - These kind = "这" ++ "些" ++ kind.s ; - Those kind = "那" ++ "些" ++ kind.s ; - Mod quality kind = { - s = quality.s ++ quality.p ++ kind.s ; - c = kind.c - } ; - Wine = geKind "酒" ; - Pizza = geKind "比 萨 饼" ; - Cheese = geKind "奶 酪" ; - Fish = geKind "鱼" ; - Very quality = longQuality ("非 常" ++ quality.s) ; - Fresh = longQuality "新 鲜" ; - Warm = longQuality "温 热" ; - Italian = longQuality "意 大 利 式" ; - Expensive = longQuality "昂 贵" ; - Delicious = longQuality "美 味" ; - Boring = longQuality "难 吃" ; -oper - mkKind : Str -> Str -> {s,c : Str} = \s,c -> - {s = s ; c = c} ; - geKind : Str -> {s,c : Str} = \s -> - mkKind s "个" ; - longQuality : Str -> {s,p : Str} = \s -> - {s = s ; p = "的"} ; -} diff --git a/contrib/summerschool/foods/FoodsCze.gf b/contrib/summerschool/foods/FoodsCze.gf deleted file mode 100644 index 3fec68141..000000000 --- a/contrib/summerschool/foods/FoodsCze.gf +++ /dev/null @@ -1,35 +0,0 @@ --- (c) 2011 Katerina Bohmova under LGPL - -concrete FoodsCze of Foods = open ResCze in { - flags - coding = utf8 ; - lincat - Comment = {s : Str} ; - Quality = Adjective ; - Kind = Noun ; - Item = NounPhrase ; - lin - Pred item quality = - {s = item.s ++ copula ! item.n ++ - quality.s ! item.g ! item.n} ; - This = det Sg "tento" "tato" "toto" ; - That = det Sg "tamten" "tamta" "tamto" ; - These = det Pl "tyto" "tyto" "tato" ; - Those = det Pl "tamty" "tamty" "tamta" ; - Mod quality kind = { - s = \\n => quality.s ! kind.g ! n ++ kind.s ! n ; - g = kind.g - } ; - Wine = noun "víno" "vína" Neutr ; - Cheese = noun "sýr" "sýry" Masc ; - Fish = noun "ryba" "ryby" Fem ; - Pizza = noun "pizza" "pizzy" Fem ; - Very qual = {s = \\g,n => "velmi" ++ qual.s ! g ! n} ; - Fresh = regAdj "čerstv" ; - Warm = regAdj "tepl" ; - Italian = regAdj "italsk" ; - Expensive = regAdj "drah" ; - Delicious = regnfAdj "vynikající" ; - Boring = regAdj "nudn" ; -} - diff --git a/contrib/summerschool/foods/FoodsDut.gf b/contrib/summerschool/foods/FoodsDut.gf deleted file mode 100644 index d4855e5c6..000000000 --- a/contrib/summerschool/foods/FoodsDut.gf +++ /dev/null @@ -1,58 +0,0 @@ --- (c) 2009 Femke Johansson under LGPL - -concrete FoodsDut of Foods = { - - lincat - Comment = {s : Str}; - Quality = {s : AForm => Str}; - Kind = { s : Number => Str}; - Item = {s : Str ; n : Number}; - - lin - Pred item quality = - {s = item.s ++ copula ! item.n ++ quality.s ! APred}; - This = det Sg "deze"; - These = det Pl "deze"; - That = det Sg "die"; - Those = det Pl "die"; - - Mod quality kind = - {s = \\n => quality.s ! AAttr ++ kind.s ! n}; - Wine = regNoun "wijn"; - Cheese = noun "kaas" "kazen"; - Fish = noun "vis" "vissen"; - Pizza = noun "pizza" "pizza's"; - - Very a = {s = \\f => "erg" ++ a.s ! f}; - - Fresh = regadj "vers"; - Warm = regadj "warm"; - Italian = regadj "Italiaans"; - Expensive = adj "duur" "dure"; - Delicious = regadj "lekker"; - Boring = regadj "saai"; - - param - Number = Sg | Pl; - AForm = APred | AAttr; - - oper - det : Number -> Str -> - {s : Number => Str} -> {s : Str ; n: Number} = - \n,det,noun -> {s = det ++ noun.s ! n ; n=n}; - - noun : Str -> Str -> {s : Number => Str} = - \man,men -> {s = table {Sg => man; Pl => men}}; - - regNoun : Str -> {s : Number => Str} = - \wijn -> noun wijn (wijn + "en"); - - regadj : Str -> {s : AForm => Str} = - \koud -> adj koud (koud+"e"); - - adj : Str -> Str -> {s : AForm => Str} = - \duur, dure -> {s = table {APred => duur; AAttr => dure}}; - - copula : Number => Str = - table {Sg => "is" ; Pl => "zijn"}; -} diff --git a/contrib/summerschool/foods/FoodsEng.gf b/contrib/summerschool/foods/FoodsEng.gf deleted file mode 100644 index e7359a4ff..000000000 --- a/contrib/summerschool/foods/FoodsEng.gf +++ /dev/null @@ -1,43 +0,0 @@ --- (c) 2009 Aarne Ranta under LGPL - -concrete FoodsEng of Foods = { - flags language = en_US; - lincat - Comment, Quality = {s : Str} ; - Kind = {s : Number => Str} ; - Item = {s : Str ; n : Number} ; - lin - Pred item quality = - {s = item.s ++ copula ! item.n ++ quality.s} ; - This = det Sg "this" ; - That = det Sg "that" ; - These = det Pl "these" ; - Those = det Pl "those" ; - Mod quality kind = - {s = \\n => quality.s ++ kind.s ! n} ; - Wine = regNoun "wine" ; - Cheese = regNoun "cheese" ; - Fish = noun "fish" "fish" ; - Pizza = regNoun "pizza" ; - Very a = {s = "very" ++ a.s} ; - Fresh = adj "fresh" ; - Warm = adj "warm" ; - Italian = adj "Italian" ; - Expensive = adj "expensive" ; - Delicious = adj "delicious" ; - Boring = adj "boring" ; - param - Number = Sg | Pl ; - oper - det : Number -> Str -> - {s : Number => Str} -> {s : Str ; n : Number} = - \n,det,noun -> {s = det ++ noun.s ! n ; n = n} ; - noun : Str -> Str -> {s : Number => Str} = - \man,men -> {s = table {Sg => man ; Pl => men}} ; - regNoun : Str -> {s : Number => Str} = - \car -> noun car (car + "s") ; - adj : Str -> {s : Str} = - \cold -> {s = cold} ; - copula : Number => Str = - table {Sg => "is" ; Pl => "are"} ; -} diff --git a/contrib/summerschool/foods/FoodsEpo.gf b/contrib/summerschool/foods/FoodsEpo.gf deleted file mode 100644 index dd2400fe7..000000000 --- a/contrib/summerschool/foods/FoodsEpo.gf +++ /dev/null @@ -1,48 +0,0 @@ --- (c) 2009 Julia Hammar under LGPL - -concrete FoodsEpo of Foods = open Prelude in { - - flags coding =utf8 ; - - lincat - Comment = SS ; - Kind, Quality = {s : Number => Str} ; - Item = {s : Str ; n : Number} ; - - lin - Pred item quality = ss (item.s ++ copula ! item.n ++ quality.s ! item.n) ; - This = det Sg "ĉi tiu" ; - That = det Sg "tiu" ; - These = det Pl "ĉi tiuj" ; - Those = det Pl "tiuj" ; - Mod quality kind = {s = \\n => quality.s ! n ++ kind.s ! n} ; - Wine = regNoun "vino" ; - Cheese = regNoun "fromaĝo" ; - Fish = regNoun "fiŝo" ; - Pizza = regNoun "pico" ; - Very quality = {s = \\n => "tre" ++ quality.s ! n} ; - Fresh = regAdj "freŝa" ; - Warm = regAdj "varma" ; - Italian = regAdj "itala" ; - Expensive = regAdj "altekosta" ; - Delicious = regAdj "bongusta" ; - Boring = regAdj "enuiga" ; - - param - Number = Sg | Pl ; - - oper - det : Number -> Str -> {s : Number => Str} -> {s : Str ; n : Number} = - \n,d,cn -> { - s = d ++ cn.s ! n ; - n = n - } ; - regNoun : Str -> {s : Number => Str} = - \vino -> {s = table {Sg => vino ; Pl => vino + "j"} - } ; - regAdj : Str -> {s : Number => Str} = - \nova -> {s = table {Sg => nova ; Pl => nova + "j"} - } ; - copula : Number => Str = \\_ => "estas" ; -} - diff --git a/contrib/summerschool/foods/FoodsFin.gf b/contrib/summerschool/foods/FoodsFin.gf deleted file mode 100644 index 34da5764b..000000000 --- a/contrib/summerschool/foods/FoodsFin.gf +++ /dev/null @@ -1,7 +0,0 @@ ---# -path=.:present - --- (c) 2009 Aarne Ranta under LGPL - -concrete FoodsFin of Foods = FoodsI with - (Syntax = SyntaxFin), - (LexFoods = LexFoodsFin) ; diff --git a/contrib/summerschool/foods/FoodsFre.gf b/contrib/summerschool/foods/FoodsFre.gf deleted file mode 100644 index ac6c8c63c..000000000 --- a/contrib/summerschool/foods/FoodsFre.gf +++ /dev/null @@ -1,32 +0,0 @@ ---# -path=.:../foods:present - -concrete FoodsFre of Foods = open SyntaxFre, ParadigmsFre in { - - flags coding = utf8 ; - - lincat - Comment = Utt ; - Item = NP ; - Kind = CN ; - Quality = AP ; - - lin - Pred item quality = mkUtt (mkCl item quality) ; - This kind = mkNP this_QuantSg kind ; - That kind = mkNP that_QuantSg kind ; - These kind = mkNP these_QuantPl kind ; - Those kind = mkNP those_QuantPl kind ; - Mod quality kind = mkCN quality kind ; - Very quality = mkAP very_AdA quality ; - - Wine = mkCN (mkN "vin" masculine) ; - Pizza = mkCN (mkN "pizza" feminine) ; - Cheese = mkCN (mkN "fromage" masculine) ; - Fish = mkCN (mkN "poisson" masculine) ; - Fresh = mkAP (mkA "frais" "fraîche" "frais" "fraîchement") ; - Warm = mkAP (mkA "chaud") ; - Italian = mkAP (mkA "italien") ; - Expensive = mkAP (mkA "cher") ; - Delicious = mkAP (mkA "délicieux") ; - Boring = mkAP (mkA "ennuyeux") ; - }
\ No newline at end of file diff --git a/contrib/summerschool/foods/FoodsGer.gf b/contrib/summerschool/foods/FoodsGer.gf deleted file mode 100644 index 934cefb9c..000000000 --- a/contrib/summerschool/foods/FoodsGer.gf +++ /dev/null @@ -1,7 +0,0 @@ ---# -path=.:present - --- (c) 2009 Aarne Ranta under LGPL - -concrete FoodsGer of Foods = FoodsI with - (Syntax = SyntaxGer), - (LexFoods = LexFoodsGer) ; diff --git a/contrib/summerschool/foods/FoodsGla.gf b/contrib/summerschool/foods/FoodsGla.gf deleted file mode 100644 index 691b26bb8..000000000 --- a/contrib/summerschool/foods/FoodsGla.gf +++ /dev/null @@ -1,66 +0,0 @@ -concrete FoodsGla of Foods = open MutationsGla, CharactersGla, Prelude in {
- param Gender = Masc|Fem ;
- param Number = Sg|Pl ;
- param Breadth = Broad|Slender|NoBreadth ;
- param Beginning = Bcgmp|Other ;
-
- lincat Comment = Str;
- lin Pred item quality = "tha" ++ item ++ quality.s!Sg!Unmutated ;
-
- lincat Item = Str;
- lin
- This kind = (addArticleSg kind) ++ "seo" ;
- That kind = (addArticleSg kind) ++ "sin";
- These kind = (addArticlePl kind) ++ "seo" ;
- Those kind = (addArticlePl kind) ++ "sin" ;
- oper addArticleSg : {s : Number => Mutation => Str; g : Gender} -> Str =
- \kind -> case kind.g of { Masc => "an" ++ kind.s!Sg!PrefixT; Fem => "a'" ++ kind.s!Sg!Lenition1DNTLS } ;
- oper addArticlePl : {s : Number => Mutation => Str; g : Gender} -> Str =
- \kind -> "na" ++ kind.s!Pl!PrefixH ;
-
- oper Noun : Type = {s : Number => Mutation => Str; g : Gender; pe : Breadth; beginning: Beginning; };
- lincat Kind = Noun;
- lin
- Mod quality kind = {
- s = table{
- Sg => table{mutation => kind.s!Sg!mutation ++ case kind.g of {Masc => quality.s!Sg!Unmutated; Fem => quality.s!Sg!Lenition1} };
- Pl => table{mutation => kind.s!Pl!mutation ++ case kind.pe of {Slender => quality.s!Pl!Lenition1; _ => quality.s!Pl!Unmutated} }
- };
- g = kind.g;
- pe = kind.pe;
- beginning = kind.beginning
- } ;
- Wine = makeNoun "fon" "fontan" Masc ;
- Cheese = makeNoun "cise" "cisean" Masc ;
- Fish = makeNoun "iasg" "isg" Masc ;
- Pizza = makeNoun "pizza" "pizzathan" Masc ;
- oper makeNoun : Str -> Str -> Gender -> Noun = \sg,pl,g -> {
- s = table{Sg => (mutate sg); Pl => (mutate pl)};
- g = g;
- pe = pe;
- beginning = Bcgmp
- }
- where {
- pe : Breadth = case pl of {
- _ + v@(#broadVowel) + c@(#consonant*) + #consonant => Broad;
- _ + v@(#slenderVowel) + c@(#consonant*) + #consonant => Slender;
- _ => NoBreadth
- }
- };
-
- oper Adjective : Type = {s : Number => Mutation => Str; sVery : Number => Str};
- lincat Quality = Adjective;
- lin
- Very quality = {s=table{number => table{_ => quality.sVery!number}}; sVery=quality.sVery } ;
- Fresh = makeAdjective "r" "ra" ;
- Warm = makeAdjective "blth" "bltha" ;
- Italian = makeAdjective "Eadailteach" "Eadailteach" ;
- Expensive = makeAdjective "daor" "daora" ;
- Delicious = makeAdjective "blasta" "blasta" ;
- Boring = makeAdjective "leamh" "leamha" ;
- oper makeAdjective : Str -> Str -> Adjective =
- \sg,pl -> {
- s=table{Sg => (mutate sg); Pl => (mutate pl)};
- sVery=table{Sg => "gl"++(lenition1dntls sg); Pl => "gl"++(lenition1dntls pl)}
- } ;
-}
\ No newline at end of file diff --git a/contrib/summerschool/foods/FoodsGle.gf b/contrib/summerschool/foods/FoodsGle.gf deleted file mode 100644 index e48c0c21b..000000000 --- a/contrib/summerschool/foods/FoodsGle.gf +++ /dev/null @@ -1,59 +0,0 @@ -concrete FoodsGle of Foods = open MutationsGle, CharactersGle in {
- param Gender = Masc|Fem ;
- param Number = Sg|Pl ;
- param Breadth = Broad|Slender|NoBreadth ;
-
- lincat Comment = Str;
- lin Pred item quality = "t" ++ item ++ quality.s!Sg!Unmutated ;
-
- lincat Item = Str;
- lin
- This kind = (addArticleSg kind) ++ "seo" ;
- That kind = (addArticleSg kind) ++ "sin";
- These kind = (addArticlePl kind) ++ "seo" ;
- Those kind = (addArticlePl kind) ++ "sin" ;
- oper addArticleSg : {s : Number => Mutation => Str; g : Gender} -> Str =
- \kind -> "an" ++ case kind.g of { Masc => kind.s!Sg!PrefixT; Fem => kind.s!Sg!Lenition1DNTLS } ;
- oper addArticlePl : {s : Number => Mutation => Str; g : Gender} -> Str =
- \kind -> "na" ++ kind.s!Pl!PrefixH ;
-
- lincat Kind = {s : Number => Mutation => Str; g : Gender; pe : Breadth} ;
- lin
- Mod quality kind = {
- s = table{
- Sg => table{mutation => kind.s!Sg!mutation ++ case kind.g of {Masc => quality.s!Sg!Unmutated; Fem => quality.s!Sg!Lenition1} };
- Pl => table{mutation => kind.s!Pl!mutation ++ case kind.pe of {Slender => quality.s!Pl!Lenition1; _ => quality.s!Pl!Unmutated} }
- };
- g = kind.g;
- pe = kind.pe
- } ;
- Wine = makeNoun "fon" "fonta" Masc ;
- Cheese = makeNoun "cis" "ciseanna" Fem ;
- Fish = makeNoun "iasc" "isc" Masc ;
- Pizza = makeNoun "potsa" "potsa" Masc ;
- oper makeNoun : Str -> Str -> Gender -> {s : Number => Mutation => Str; g : Gender; pe : Breadth} =
- \sg,pl,g -> {
- s = table{Sg => (mutate sg); Pl => (mutate pl)};
- g = g;
- pe = case pl of {
- _ + v@(#broadVowel) + c@(#consonant*) + #consonant => Broad;
- _ + v@(#slenderVowel) + c@(#consonant*) + #consonant => Slender;
- _ => NoBreadth
- }
- } ;
-
- lincat Quality = {s : Number => Mutation => Str; sVery : Number => Str} ;
- lin
- Very quality = {s=table{number => table{_ => quality.sVery!number}}; sVery=quality.sVery } ;
- Fresh = makeAdjective "r" "ra" ;
- Warm = makeAdjective "te" "te" ;
- Italian = makeAdjective "Iodlach" "Iodlacha" ;
- Expensive = makeAdjective "daor" "daora" ;
- Delicious = makeAdjective "blasta" "blasta" ;
- Boring = makeAdjective "leamh" "leamha" ;
- oper makeAdjective : Str -> Str -> {s : Number => Mutation => Str; sVery : Number => Str} =
- \sg,pl -> {
- s=table{Sg => (mutate sg); Pl => (mutate pl)};
- sVery=table{Sg => "an-"+(lenition1dntls sg); Pl => "an-"+(lenition1dntls pl)}
- } ;
-}
\ No newline at end of file diff --git a/contrib/summerschool/foods/FoodsHeb.gf b/contrib/summerschool/foods/FoodsHeb.gf deleted file mode 100644 index 3d76b639f..000000000 --- a/contrib/summerschool/foods/FoodsHeb.gf +++ /dev/null @@ -1,108 +0,0 @@ ---# -path=alltenses - ---(c) 2009 Dana Dannells --- Licensed under LGPL - -concrete FoodsHeb of Foods = open Prelude in { - - flags coding=utf8 ; - - lincat - Comment = SS ; - Quality = {s: Number => Species => Gender => Str} ; - Kind = {s : Number => Species => Str ; g : Gender ; mod : Modified} ; - Item = {s : Str ; g : Gender ; n : Number ; sp : Species ; mod : Modified} ; - - - lin - Pred item quality = ss (item.s ++ quality.s ! item.n ! Indef ! item.g ) ; - This = det Sg Def "הזה" "הזאת"; - That = det Sg Def "ההוא" "ההיא" ; - These = det Pl Def "האלה" "האלה" ; - Those = det Pl Def "ההם" "ההן" ; - Mod quality kind = { - s = \\n,sp => kind.s ! n ! sp ++ quality.s ! n ! sp ! kind.g; - g = kind.g ; - mod = T - } ; - Wine = regNoun "יין" "יינות" Masc ; - Cheese = regNoun "גבינה" "גבינות" Fem ; - Fish = regNoun "דג" "דגים" Masc ; - Pizza = regNoun "פיצה" "פיצות" Fem ; - Very qual = {s = \\g,n,sp => "מאוד" ++ qual.s ! g ! n ! sp} ; - Fresh = regAdj "טרי" ; - Warm = regAdj "חם" ; - Italian = regAdj2 "איטלקי" ; - Expensive = regAdj "יקר" ; - Delicious = regAdj "טעים" ; - Boring = regAdj2 "משעמם"; - - param - Number = Sg | Pl ; - Gender = Masc | Fem ; - Species = Def | Indef ; - Modified = T | F ; - - oper - Noun : Type = {s : Number => Species => Str ; g : Gender ; mod : Modified } ; - Adj : Type = {s : Number => Species => Gender => Str} ; - - det : Number -> Species -> Str -> Str -> Noun -> - {s : Str ; g :Gender ; n : Number ; sp : Species ; mod : Modified} = - \n,sp,m,f,cn -> { - s = case cn.mod of { _ => cn.s ! n ! sp ++ case cn.g of {Masc => m ; Fem => f} }; - g = cn.g ; - n = n ; - sp = sp ; - mod = cn.mod - } ; - - noun : (gvina,hagvina,gvinot,hagvinot : Str) -> Gender -> Noun = - \gvina,hagvina,gvinot,hagvinot,g -> { - s = table { - Sg => table { - Indef => gvina ; - Def => hagvina - } ; - Pl => table { - Indef => gvinot ; - Def => hagvinot - } - } ; - g = g ; - mod = F - } ; - - regNoun : Str -> Str -> Gender -> Noun = - \gvina,gvinot, g -> - noun gvina (defH gvina) gvinot (defH gvinot) g ; - - defH : Str -> Str = \cn -> - case cn of {_ => "ה" + cn}; - - replaceLastLetter : Str -> Str = \c -> - case c of {"ף" => "פ" ; "ם" => "מ" ; "ן" => "נ" ; "ץ" => "צ" ; "ך" => "כ"; _ => c} ; - - adjective : (_,_,_,_ : Str) -> Adj = - \tov,tova,tovim,tovot -> { - s = table { - Sg => table { - Indef => table { Masc => tov ; Fem => tova } ; - Def => table { Masc => defH tov ; Fem => defH tova } - } ; - Pl => table { - Indef => table {Masc => tovim ; Fem => tovot } ; - Def => table { Masc => defH tovim ; Fem => defH tovot } - } - } - } ; - - regAdj : Str -> Adj = \tov -> - case tov of { to + c@? => - adjective tov (to + replaceLastLetter (c) + "ה" ) (to + replaceLastLetter (c) +"ים" ) (to + replaceLastLetter (c) + "ות" )}; - - regAdj2 : Str -> Adj = \italki -> - case italki of { italk+ c@? => - adjective italki (italk + replaceLastLetter (c) +"ת" ) (italk + replaceLastLetter (c)+ "ים" ) (italk + replaceLastLetter (c) + "ות" )}; - -} -- FoodsHeb diff --git a/contrib/summerschool/foods/FoodsHin.gf b/contrib/summerschool/foods/FoodsHin.gf deleted file mode 100644 index 67c29df8b..000000000 --- a/contrib/summerschool/foods/FoodsHin.gf +++ /dev/null @@ -1,75 +0,0 @@ --- (c) 2010 Vikash Rauniyar under LGPL - -concrete FoodsHin of Foods = { - - flags coding=utf8 ; - - param - Gender = Masc | Fem ; - Number = Sg | Pl ; - lincat - Comment = {s : Str} ; - Item = {s : Str ; g : Gender ; n : Number} ; - Kind = {s : Number => Str ; g : Gender} ; - Quality = {s : Gender => Number => Str} ; - lin - Pred item quality = { - s = item.s ++ quality.s ! item.g ! item.n ++ copula item.n - } ; - This kind = {s = "यह" ++ kind.s ! Sg ; g = kind.g ; n = Sg} ; - That kind = {s = "वह" ++ kind.s ! Sg ; g = kind.g ; n = Sg} ; - These kind = {s = "ये" ++ kind.s ! Pl ; g = kind.g ; n = Pl} ; - Those kind = {s = "वे" ++ kind.s ! Pl ; g = kind.g ; n = Pl} ; - Mod quality kind = { - s = \\n => quality.s ! kind.g ! n ++ kind.s ! n ; - g = kind.g - } ; - Wine = regN "मदिरा" ; - Cheese = regN "पनीर" ; - Fish = regN "मछली" ; - Pizza = regN "पिज़्ज़ा" ; - Very quality = {s = \\g,n => "अति" ++ quality.s ! g ! n} ; - Fresh = regAdj "ताज़ा" ; - Warm = regAdj "गरम" ; - Italian = regAdj "इटली" ; - Expensive = regAdj "बहुमूल्य" ; - Delicious = regAdj "स्वादिष्ट" ; - Boring = regAdj "अरुचिकर" ; - - oper - mkN : Str -> Str -> Gender -> {s : Number => Str ; g : Gender} = - \s,p,g -> { - s = table { - Sg => s ; - Pl => p - } ; - g = g - } ; - - regN : Str -> {s : Number => Str ; g : Gender} = \s -> case s of { - lark + "ा" => mkN s (lark + "े") Masc ; - lark + "ी" => mkN s (lark + "ीयँा") Fem ; - _ => mkN s s Masc - } ; - - mkAdj : Str -> Str -> Str -> {s : Gender => Number => Str} = \ms,mp,f -> { - s = table { - Masc => table { - Sg => ms ; - Pl => mp - } ; - Fem => \\_ => f - } - } ; - - regAdj : Str -> {s : Gender => Number => Str} = \a -> case a of { - acch + "ा" => mkAdj a (acch + "े") (acch + "ी") ; - _ => mkAdj a a a - } ; - - copula : Number -> Str = \n -> case n of { - Sg => "है" ; - Pl => "हैं" - } ; - - } diff --git a/contrib/summerschool/foods/FoodsI.gf b/contrib/summerschool/foods/FoodsI.gf deleted file mode 100644 index f4113b724..000000000 --- a/contrib/summerschool/foods/FoodsI.gf +++ /dev/null @@ -1,29 +0,0 @@ --- (c) 2009 Aarne Ranta under LGPL - -incomplete concrete FoodsI of Foods = - open Syntax, LexFoods in { - lincat - Comment = Utt ; - Item = NP ; - Kind = CN ; - Quality = AP ; - lin - Pred item quality = mkUtt (mkCl item quality) ; - This kind = mkNP this_Det kind ; - That kind = mkNP that_Det kind ; - These kind = mkNP these_Det kind ; - Those kind = mkNP those_Det kind ; - Mod quality kind = mkCN quality kind ; - Very quality = mkAP very_AdA quality ; - - Wine = mkCN wine_N ; - Pizza = mkCN pizza_N ; - Cheese = mkCN cheese_N ; - Fish = mkCN fish_N ; - Fresh = mkAP fresh_A ; - Warm = mkAP warm_A ; - Italian = mkAP italian_A ; - Expensive = mkAP expensive_A ; - Delicious = mkAP delicious_A ; - Boring = mkAP boring_A ; -} diff --git a/contrib/summerschool/foods/FoodsIce.gf b/contrib/summerschool/foods/FoodsIce.gf deleted file mode 100644 index 9889d5da7..000000000 --- a/contrib/summerschool/foods/FoodsIce.gf +++ /dev/null @@ -1,84 +0,0 @@ ---# -path=.:prelude - --- (c) 2009 Martha Dis Brandt under LGPL - -concrete FoodsIce of Foods = open Prelude in { - ---flags coding=utf8; - - lincat - Comment = SS ; - Quality = {s : Gender => Number => Defin => Str} ; - Kind = {s : Number => Str ; g : Gender} ; - Item = {s : Str ; g : Gender ; n : Number} ; - - lin - Pred item quality = ss (item.s ++ copula item.n ++ quality.s ! item.g ! item.n ! Ind) ; - This, That = det Sg "essi" "essi" "etta" ; - These, Those = det Pl "essir" "essar" "essi" ; - Mod quality kind = { s = \\n => quality.s ! kind.g ! n ! Def ++ kind.s ! n ; g = kind.g } ; - Wine = noun "vn" "vn" Neutr ; - Cheese = noun "ostur" "ostar" Masc ; - Fish = noun "fiskur" "fiskar" Masc ; - -- the word "pizza" is more commonly used in Iceland, but "flatbaka" is the Icelandic word for it - Pizza = noun "flatbaka" "flatbkur" Fem ; - Very qual = {s = \\g,n,defOrInd => "mjg" ++ qual.s ! g ! n ! defOrInd } ; - Fresh = regAdj "ferskur" ; - Warm = regAdj "heitur" ; - Boring = regAdj "leiinlegur" ; - -- the order of the given adj forms is: mSg fSg nSg mPl fPl nPl mSgDef f/nSgDef _PlDef - Italian = adjective "talskur" "tlsk" "talskt" "talskir" "talskar" "tlsk" "talski" "talska" "talsku" ; - Expensive = adjective "dr" "dr" "drt" "drir" "drar" "dr" "dri" "dra" "dru" ; - Delicious = adjective "ljffengur" "ljffeng" "ljffengt" "ljffengir" "ljffengar" "ljffeng" "ljffengi" "ljffenga" "ljffengu" ; - - param - Number = Sg | Pl ; - Gender = Masc | Fem | Neutr ; - Defin = Ind | Def ; - - oper - det : Number -> Str -> Str -> Str -> {s : Number => Str ; g : Gender} -> - {s : Str ; g : Gender ; n : Number} = - \n,masc,fem,neutr,cn -> { - s = case cn.g of {Masc => masc ; Fem => fem; Neutr => neutr } ++ cn.s ! n ; - g = cn.g ; - n = n - } ; - - noun : Str -> Str -> Gender -> {s : Number => Str ; g : Gender} = - \man,men,g -> { - s = table { - Sg => man ; - Pl => men - } ; - g = g - } ; - - adjective : (x1,_,_,_,_,_,_,_,x9 : Str) -> {s : Gender => Number => Defin => Str} = - \ferskur,fersk,ferskt,ferskir,ferskar,fersk_pl,ferski,ferska,fersku -> { - s = \\g,n,t => case <g,n,t> of { - < Masc, Sg, Ind > => ferskur ; - < Masc, Pl, Ind > => ferskir ; - < Fem, Sg, Ind > => fersk ; - < Fem, Pl, Ind > => ferskar ; - < Neutr, Sg, Ind > => ferskt ; - < Neutr, Pl, Ind > => fersk_pl; - < Masc, Sg, Def > => ferski ; - < Fem, Sg, Def > | < Neutr, Sg, Def > => ferska ; - < _ , Pl, Def > => fersku - } - } ; - - regAdj : Str -> {s : Gender => Number => Defin => Str} = \ferskur -> - let fersk = Predef.tk 2 ferskur - in adjective - ferskur fersk (fersk + "t") - (fersk + "ir") (fersk + "ar") fersk - (fersk + "i") (fersk + "a") (fersk + "u") ; - - copula : Number -> Str = - \n -> case n of { - Sg => "er" ; - Pl => "eru" - } ; -} diff --git a/contrib/summerschool/foods/FoodsIta.gf b/contrib/summerschool/foods/FoodsIta.gf deleted file mode 100644 index 51baf9d70..000000000 --- a/contrib/summerschool/foods/FoodsIta.gf +++ /dev/null @@ -1,8 +0,0 @@ ---# -path=.:present - --- (c) 2009 Aarne Ranta under LGPL - -concrete FoodsIta of Foods = FoodsI with - (Syntax = SyntaxIta), - (LexFoods = LexFoodsIta) ; - diff --git a/contrib/summerschool/foods/FoodsJpn.gf b/contrib/summerschool/foods/FoodsJpn.gf deleted file mode 100644 index 9525ff16b..000000000 --- a/contrib/summerschool/foods/FoodsJpn.gf +++ /dev/null @@ -1,72 +0,0 @@ ---# -path=.:../lib/src/prelude - --- (c) 2009 Zofia Stankiewicz under LGPL - -concrete FoodsJpn of Foods = open Prelude in { - -flags coding=utf8 ; - - lincat - Comment = {s: Style => Str}; - Quality = {s: AdjUse => Str ; t: AdjType} ; - Kind = {s : Number => Str} ; - Item = {s : Str ; n : Number} ; - - lin - Pred item quality = {s = case quality.t of { - IAdj => table {Plain => item.s ++ quality.s ! APred ; Polite => item.s ++ quality.s ! APred ++ copula ! Polite ! item.n } ; - NaAdj => \\p => item.s ++ quality.s ! APred ++ copula ! p ! item.n } - } ; - This = det Sg "この" ; - That = det Sg "その" ; - These = det Pl "この" ; - Those = det Pl "その" ; - Mod quality kind = {s = \\n => quality.s ! Attr ++ kind.s ! n} ; - Wine = regNoun "ワインは" ; - Cheese = regNoun "チーズは" ; - Fish = regNoun "魚は" ; - Pizza = regNoun "ピザは" ; - Very quality = {s = \\a => "とても" ++ quality.s ! a ; t = quality.t } ; - Fresh = adj "新鮮な" "新鮮"; - Warm = regAdj "あたたかい" ; - Italian = adj "イタリアの" "イタリアのもの"; - Expensive = regAdj "たかい" ; - Delicious = regAdj "おいしい" ; - Boring = regAdj "つまらない" ; - - param - Number = Sg | Pl ; - AdjUse = Attr | APred ; -- na-adjectives have different forms as noun attributes and predicates - Style = Plain | Polite ; -- for phrase types - AdjType = IAdj | NaAdj ; -- IAdj can form predicates without the copula, NaAdj cannot - - oper - det : Number -> Str -> {s : Number => Str} -> {s : Str ; n : Number} = - \n,d,cn -> { - s = d ++ cn.s ! n ; - n = n - } ; - noun : Str -> Str -> {s : Number => Str} = - \sakana,sakana -> {s = \\_ => sakana } ; - - regNoun : Str -> {s : Number => Str} = - \sakana -> noun sakana sakana ; - - adj : Str -> Str -> {s : AdjUse => Str ; t : AdjType} = - \chosenna, chosen -> { - s = table { - Attr => chosenna ; - APred => chosen - } ; - t = NaAdj - } ; - - regAdj : Str -> {s: AdjUse => Str ; t : AdjType} =\akai -> { - s = \\_ => akai ; t = IAdj} ; - - copula : Style => Number => Str = - table { - Plain => \\_ => "だ" ; - Polite => \\_ => "です" } ; - -} diff --git a/contrib/summerschool/foods/FoodsLav.gf b/contrib/summerschool/foods/FoodsLav.gf deleted file mode 100644 index efab63450..000000000 --- a/contrib/summerschool/foods/FoodsLav.gf +++ /dev/null @@ -1,91 +0,0 @@ ---# -path=.:prelude - --- (c) 2009 Inese Bernsone under LGPL - -concrete FoodsLav of Foods = open Prelude in { - - flags - coding=utf8 ; - - lincat - Comment = SS ; - Quality = {s : Q => Gender => Number => Defin => Str } ; - Kind = {s : Number => Str ; g : Gender} ; - Item = {s : Str ; g : Gender ; n : Number } ; - - lin - Pred item quality = ss (item.s ++ {- copula item.n -} "ir" ++ quality.s ! Q1 ! item.g ! item.n ! Ind ) ; - This = det Sg "šis" "šī" ; - That = det Sg "tas" "tā" ; - These = det Pl "šie" "šīs" ; - Those = det Pl "tie" "tās" ; - Mod quality kind = {s = \\n => quality.s ! Q1 ! kind.g ! n ! Def ++ kind.s ! n ; g = kind.g } ; - Wine = noun "vīns" "vīni" Masc ; - Cheese = noun "siers" "sieri" Masc ; - Fish = noun "zivs" "zivis" Fem ; - Pizza = noun "pica" "picas" Fem ; - Very qual = {s = \\q,g,n,spec => "ļoti" ++ qual.s ! Q2 ! g ! n ! spec }; - - Fresh = adjective "svaigs" "svaiga" "svaigi" "svaigas" "svaigais" "svaigā" "svaigie" "svaigās" ; - Warm = regAdj "silts" ; - Italian = specAdj "itāļu" (regAdj "itālisks") ; - Expensive = regAdj "dārgs" ; - Delicious = regAdj "garšīgs" ; - Boring = regAdj "garlaicīgs" ; - - param - Number = Sg | Pl ; - Gender = Masc | Fem ; - Defin = Ind | Def ; - Q = Q1 | Q2 ; - - oper - det : Number -> Str -> Str -> {s : Number => Str ; g : Gender} -> - {s : Str ; g : Gender ; n : Number} = - \n,m,f,cn -> { - s = case cn.g of {Masc => m ; Fem => f} ++ cn.s ! n ; - g = cn.g ; - n = n - } ; - noun : Str -> Str -> Gender -> {s : Number => Str ; g : Gender} = - \man,men,g -> { - s = table { - Sg => man ; - Pl => men - } ; - g = g - } ; - adjective : (_,_,_,_,_,_,_,_ : Str) -> {s : Q => Gender => Number => Defin => Str} = - \skaists,skaista,skaisti,skaistas,skaistais,skaistaa,skaistie,skaistaas -> { - s = table { - _ => table { - Masc => table { - Sg => table {Ind => skaists ; Def => skaistais} ; - Pl => table {Ind => skaisti ; Def => skaistie} - } ; - Fem => table { - Sg => table {Ind => skaista ; Def => skaistaa} ; - Pl => table {Ind => skaistas ; Def => skaistaas} - } - } - } - } ; - - {- irregAdj : Str -> {s : Gender => Number => Defin => Str} = \itaalju -> - let itaalju = itaalju - in adjective itaalju (itaalju) (itaalju) (itaalju) (itaalju) (itaalju) (itaalju) (itaalju) ; -} - - regAdj : Str -> {s : Q => Gender => Number => Defin => Str} = \skaists -> - let skaist = init skaists - in adjective skaists (skaist + "a") (skaist + "i") (skaist + "as") (skaist + "ais") (skaist + "ā") (skaist + "ie") (skaist + "ās"); - - Adjective : Type = {s : Q => Gender => Number => Defin => Str} ; - - specAdj : Str -> Adjective -> Adjective = \s,a -> { - s = table { - Q2 => a.s ! Q1 ; - Q1 => \\_,_,_ => s - } - } ; - - } diff --git a/contrib/summerschool/foods/FoodsMlt.gf b/contrib/summerschool/foods/FoodsMlt.gf deleted file mode 100644 index 5fcd4de78..000000000 --- a/contrib/summerschool/foods/FoodsMlt.gf +++ /dev/null @@ -1,105 +0,0 @@ --- (c) 2013 John J. Camilleri under LGPL - -concrete FoodsMlt of Foods = open Prelude in { - flags coding=utf8 ; - - lincat - Comment = SS ; - Quality = {s : Gender => Number => Str} ; - Kind = {s : Number => Str ; g : Gender} ; - Item = {s : Str ; g : Gender ; n : Number} ; - - lin - -- Pred item quality = ss (item.s ++ copula item.n item.g ++ quality.s ! item.g ! item.n) ; - Pred item quality = ss (item.s ++ quality.s ! item.g ! item.n) ; - - This kind = det Sg "dan" "din" kind ; - That kind = det Sg "dak" "dik" kind ; - These kind = det Pl "dawn" "" kind ; - Those kind = det Pl "dawk" "" kind ; - - Mod quality kind = { - s = \\n => kind.s ! n ++ quality.s ! kind.g ! n ; - g = kind.g - } ; - - Wine = noun "inbid" "inbejjed" Masc ; - Cheese = noun "ġobon" "ġobniet" Masc ; - Fish = noun "ħuta" "ħut" Fem ; - Pizza = noun "pizza" "pizzez" Fem ; - - Very qual = {s = \\g,n => qual.s ! g ! n ++ "ħafna"} ; - - Warm = adjective "sħun" "sħuna" "sħan" ; - Expensive = adjective "għali" "għalja" "għaljin" ; - Delicious = adjective "tajjeb" "tajba" "tajbin" ; - Boring = uniAdj "tad-dwejjaq" ; - Fresh = regAdj "frisk" ; - Italian = regAdj "Taljan" ; - - param - Number = Sg | Pl ; - Gender = Masc | Fem ; - - oper - --Create an adjective (full function) - --Params: Sing Masc, Sing Fem, Plural - adjective : (_,_,_ : Str) -> {s : Gender => Number => Str} = \iswed,sewda,suwed -> { - s = table { - Masc => table { - Sg => iswed ; - Pl => suwed - } ; - Fem => table { - Sg => sewda ; - Pl => suwed - } - } - } ; - - --Create a regular adjective - --Param: Sing Masc - regAdj : Str -> {s : Gender => Number => Str} = \frisk -> - adjective frisk (frisk + "a") (frisk + "i") ; - - --Create a "uni-adjective" eg tal-buzz - --Param: Sing Masc - uniAdj : Str -> {s : Gender => Number => Str} = \uni -> - adjective uni uni uni ; - - --Create a noun - --Params: Singular, Plural, Gender (inherent) - noun : Str -> Str -> Gender -> {s : Number => Str ; g : Gender} = \ktieb,kotba,g -> { - s = table { - Sg => ktieb ; - Pl => kotba - } ; - g = g - } ; - - --Copula is a linking verb - --Params: Number, Gender - -- copula : Number -> Gender -> Str = \n,g -> case n of { - -- Sg => case g of { Masc => "huwa" ; Fem => "hija" } ; - -- Pl => "huma" - -- } ; - - --Create an article, taking into account first letter of next word - article = pre { - "a"|"e"|"i"|"o"|"u" => "l-" ; - --cons@("ċ"|"d"|"n"|"r"|"s"|"t"|"x"|"ż") => "i" + cons + "-" ; - _ => "il-" - } ; - - --Create a determinant - --Params: Sg/Pl, Masc, Fem - det : Number -> Str -> Str -> {s : Number => Str ; g : Gender} -> {s : Str ; g : Gender ; n : Number} = \n,m,f,cn -> { - s = case n of { - Sg => case cn.g of {Masc => m ; Fem => f}; --string - Pl => m --default to masc - } ++ article ++ cn.s ! n ; - g = cn.g ; --gender - n = n --number - } ; - -} diff --git a/contrib/summerschool/foods/FoodsMon.gf b/contrib/summerschool/foods/FoodsMon.gf deleted file mode 100644 index eda2012f4..000000000 --- a/contrib/summerschool/foods/FoodsMon.gf +++ /dev/null @@ -1,49 +0,0 @@ ---# -path=.:/GF/lib/src/prelude - --- (c) 2009 Nyamsuren Erdenebadrakh under LGPL - -concrete FoodsMon of Foods = open Prelude in { - flags coding=utf8; - - lincat - Comment, Quality = SS ; - Kind = {s : Number => Str} ; - Item = {s : Str ; n : Number} ; - - lin - Pred item quality = ss (item.s ++ "бол" ++ quality.s) ; - This = det Sg "энэ" ; - That = det Sg "тэр" ; - These = det Pl "эдгээр" ; - Those = det Pl "тэдгээр" ; - Mod quality kind = {s = \\n => quality.s ++ kind.s ! n} ; - Wine = regNoun "дарс" ; - Cheese = regNoun "бяслаг" ; - Fish = regNoun "загас" ; - Pizza = regNoun "пицца" ; - Very = prefixSS "маш" ; - Fresh = ss "шинэ" ; - Warm = ss "халуун" ; - Italian = ss "итали" ; - Expensive = ss "үнэтэй" ; - Delicious = ss "амттай" ; - Boring = ss "амтгүй" ; - - param - Number = Sg | Pl ; - - oper - det : Number -> Str -> {s : Number => Str} -> {s : Str ; n : Number} = - \n,d,cn -> { - s = d ++ cn.s ! n ; - n = n - } ; - - regNoun : Str -> {s : Number => Str} = - \x -> {s = table { - Sg => x ; - Pl => x + "нууд"} - } ; - } - - diff --git a/contrib/summerschool/foods/FoodsNep.gf b/contrib/summerschool/foods/FoodsNep.gf deleted file mode 100644 index ea02e64a6..000000000 --- a/contrib/summerschool/foods/FoodsNep.gf +++ /dev/null @@ -1,60 +0,0 @@ --- (c) 2011 Dinesh Simkhada under LGPL - -concrete FoodsNep of Foods = { - - flags coding = utf8 ; - - lincat - Comment, Quality = {s : Str} ; - Kind = {s : Number => Str} ; - Item = {s : Str ; n : Number} ; - - lin - Pred item quality = - {s = item.s ++ quality.s ++ copula ! item.n} ; - - This = det Sg "यो" ; - That = det Sg "त्यो" ; - These = det Pl "यी" ; - Those = det Pl "ती" ; - Mod quality kind = - {s = \\n => quality.s ++ kind.s ! n} ; - - Wine = regNoun "रक्सी" ; - Cheese = regNoun "चिज" ; - Fish = regNoun "माछा" ; - Pizza = regNoun "पिज्जा" ; - Very a = {s = "धेरै" ++ a.s} ; - Fresh = adj "ताजा" ; - Warm = adj "तातो" ; - Italian = adj "इटालियन" ; - Expensive = adj "महँगो" | adj "बहुमूल्य" ; - Delicious = adj "स्वादिष्ट" | adj "मीठो" ; - Boring = adjPl "नमिठो" ; - - param - Number = Sg | Pl ; - - oper - det : Number -> Str -> - {s : Number => Str} -> {s : Str ; n : Number} = - \n,det,noun -> {s = det ++ noun.s ! n ; n = n} ; - - noun : Str -> Str -> {s : Number => Str} = - \man,men -> {s = table {Sg => man ; Pl => men}} ; - - regNoun : Str -> {s : Number => Str} = - \car -> noun car (car + "हरु") ; - - adjPl : Str -> {s : Str} = \a -> case a of { - bor + "ठो" => adj (bor + "ठा") ; - _ => adj a - } ; - - adj : Str -> {s : Str} = - \cold -> {s = cold} ; - - copula : Number => Str = - table {Sg => "छ" ; Pl => "छन्"} ; -} - diff --git a/contrib/summerschool/foods/FoodsOri.gf b/contrib/summerschool/foods/FoodsOri.gf deleted file mode 100644 index ad4f492f6..000000000 --- a/contrib/summerschool/foods/FoodsOri.gf +++ /dev/null @@ -1,30 +0,0 @@ -concrete FoodsOri of Foods = {
-
-flags coding = utf8 ;
-
-lincat
- Comment = Str;
- Item = Str;
- Kind = Str;
- Quality = Str;
-
-lin
- Pred item quality = item ++ quality ++ "ଅଟେ";
- This kind = "ଏଇ" ++ kind;
- That kind = "ସେଇ" ++ kind;
- These kind = "ଏଇ" ++ kind ++ "ଗୁଡିକ" ;
- Those kind = "ସେଇ" ++ kind ++ "ଗୁଡିକ" ;
- Mod quality kind = quality ++ kind;
- Wine = "ମଦ";
- Cheese = "ଛେନା";
- Fish = "ମାଛ";
- Pizza = "ପିଜଜ଼ା" ;
- Very quality = "ଅତି" ++ quality;
- Fresh = "ତାଜା";
- Warm = "ଗରମ";
- Italian = "ଇଟାଲି";
- Expensive = "ମୁଲ୍ୟବାନ୍";
- Delicious = "ସ୍ଵାଦିସ୍ଟ ";
- Boring = "ଅରୁଚିକର";
-
-}
diff --git a/contrib/summerschool/foods/FoodsPes.gf b/contrib/summerschool/foods/FoodsPes.gf deleted file mode 100644 index c2e631e81..000000000 --- a/contrib/summerschool/foods/FoodsPes.gf +++ /dev/null @@ -1,65 +0,0 @@ -concrete FoodsPes of Foods = {
-
- flags optimize=noexpand ; coding=utf8 ;
-
- lincat
- Comment = {s : Str} ;
- Quality = {s : Add => Str; prep : Str} ;
- Kind = {s : Add => Number => Str ; prep : Str};
- Item = {s : Str ; n : Number};
- lin
- Pred item quality = {s = item.s ++ quality.s ! Indep ++ copula ! item.n} ;
- This = det Sg "این" ;
- That = det Sg "آن" ;
- These = det Pl "این" ;
- Those = det Pl "آن" ;
-
- Mod quality kind = {s = \\a,n => kind.s ! Attr ! n ++ kind.prep ++ quality.s ! a ;
- prep = quality.prep
- };
- Wine = regN "شراب" ;
- Cheese = regN "پنیر" ;
- Fish = regN "ماهى" ;
- Pizza = regN "پیتزا" ;
- Very a = {s = \\at => "خیلی" ++ a.s ! at ; prep = a.prep} ;
- Fresh = adj "تازه" ;
- Warm = adj "گرم" ;
- Italian = adj "ایتالیایی" ;
- Expensive = adj "گران" ;
- Delicious = adj "لذىذ" ;
- Boring = adj "ملال آور" ; -- it must be written as ملال آور.
-
- param
- Number = Sg | Pl ;
- Add = Indep | Attr ;
- oper
- det : Number -> Str -> {s: Add => Number => Str ; prep : Str} -> {s : Str ; n: Number} =
- \n,det,noun -> {s = det ++ noun.s ! Indep ! n ; n = n };
-
- noun : (x1,_,_,x4 : Str) -> {s : Add => Number => Str ; prep : Str} = \pytzA, pytzAy, pytzAhA,pr ->
- {s = \\a,n => case <a,n> of
- {<Indep,Sg> => pytzA ; <Indep,Pl> => pytzAhA ;
- <Attr,Sg> =>pytzA ; <Attr,Pl> => pytzAhA + "ى" };
- prep = pr
- };
-
- regN : Str -> {s: Add => Number => Str ; prep : Str} = \mrd ->
- case mrd of
- { _ + ("ا"|"ه"|"ى"|"و"|"") => noun mrd (mrd+"ى") (mrd + "ها") "";
- _ => noun mrd mrd (mrd + "ها") "e"
- };
-
- adj : Str -> {s : Add => Str; prep : Str} = \tAzh ->
- case tAzh of
- { _ + ("ا"|"ه"|"ى"|"و"|"") => mkAdj tAzh (tAzh ++ "ى") "" ;
- _ => mkAdj tAzh tAzh "ه"
- };
-
- mkAdj : Str -> Str -> Str -> {s : Add => Str; prep : Str} = \tAzh, tAzhy, pr ->
- {s = table {Indep => tAzh;
- Attr => tAzhy};
- prep = pr
- };
- copula : Number => Str = table {Sg => "است"; Pl => "هستند"};
-
-}
\ No newline at end of file diff --git a/contrib/summerschool/foods/FoodsPor.gf b/contrib/summerschool/foods/FoodsPor.gf deleted file mode 100644 index 2a497f8fe..000000000 --- a/contrib/summerschool/foods/FoodsPor.gf +++ /dev/null @@ -1,77 +0,0 @@ --- (c) 2009 Rami Shashati under LGPL - -concrete FoodsPor of Foods = open Prelude in { - lincat - Comment = {s : Str} ; - Quality = {s : Gender => Number => Str} ; - Kind = {s : Number => Str ; g : Gender} ; - Item = {s : Str ; n : Number ; g : Gender } ; - - lin - Pred item quality = - {s = item.s ++ copula ! item.n ++ quality.s ! item.g ! item.n } ; - This = det Sg (table {Masc => "este" ; Fem => "esta"}) ; - That = det Sg (table {Masc => "esse" ; Fem => "essa"}) ; - These = det Pl (table {Masc => "estes" ; Fem => "estas"}) ; - Those = det Pl (table {Masc => "esses" ; Fem => "essas"}) ; - - Mod quality kind = { s = \\n => kind.s ! n ++ quality.s ! kind.g ! n ; g = kind.g } ; - - Wine = regNoun "vinho" Masc ; - Cheese = regNoun "queijo" Masc ; - Fish = regNoun "peixe" Masc ; - Pizza = regNoun "pizza" Fem ; - - Very a = { s = \\g,n => "muito" ++ a.s ! g ! n } ; - - Fresh = mkAdjReg "fresco" ; - Warm = mkAdjReg "quente" ; - Italian = mkAdjReg "Italiano" ; - Expensive = mkAdjReg "caro" ; - Delicious = mkAdjReg "delicioso" ; - Boring = mkAdjReg "chato" ; - - param - Number = Sg | Pl ; - Gender = Masc | Fem ; - - oper - QualityT : Type = {s : Gender => Number => Str} ; - - mkAdj : (_,_,_,_ : Str) -> QualityT = \bonito,bonita,bonitos,bonitas -> { - s = table { - Masc => table { Sg => bonito ; Pl => bonitos } ; - Fem => table { Sg => bonita ; Pl => bonitas } - } ; - } ; - - -- regular pattern - adjSozinho : Str -> QualityT = \sozinho -> - let sozinh = Predef.tk 1 sozinho - in mkAdj sozinho (sozinh + "a") (sozinh + "os") (sozinh + "as") ; - - -- for gender-independent adjectives - adjUtil : Str -> Str -> QualityT = \util,uteis -> - mkAdj util util uteis uteis ; - - -- smart paradigm for adjcetives - mkAdjReg : Str -> QualityT = \a -> case last a of { - "o" => adjSozinho a ; - "e" => adjUtil a (a + "s") - } ; - - ItemT : Type = {s : Str ; n : Number ; g : Gender } ; - - det : Number -> (Gender => Str) -> KindT -> ItemT = - \num,det,noun -> {s = det ! noun.g ++ noun.s ! num ; n = num ; g = noun.g } ; - - KindT : Type = {s : Number => Str ; g : Gender} ; - - noun : Str -> Str -> Gender -> KindT = - \animal,animais,gen -> {s = table {Sg => animal ; Pl => animais} ; g = gen } ; - - regNoun : Str -> Gender -> KindT = - \carro,gen -> noun carro (carro + "s") gen ; - - copula : Number => Str = table {Sg => "" ; Pl => "so"} ; -} diff --git a/contrib/summerschool/foods/FoodsRon.gf b/contrib/summerschool/foods/FoodsRon.gf deleted file mode 100644 index d7d917ffc..000000000 --- a/contrib/summerschool/foods/FoodsRon.gf +++ /dev/null @@ -1,72 +0,0 @@ --- (c) 2009 Ramona Enache under LGPL
-
-concrete FoodsRon of Foods =
-{
-flags coding=utf8 ;
-
-param Number = Sg | Pl ;
- Gender = Masc | Fem ;
- NGender = NMasc | NFem | NNeut ;
-lincat
-Comment = {s : Str};
-Quality = {s : Number => Gender => Str};
-Kind = {s : Number => Str; g : NGender};
-Item = {s : Str ; n : Number; g : Gender};
-
-lin
-
-This = det Sg (mkTab "acest" "această");
-That = det Sg (mkTab "acel" "acea");
-These = det Pl (mkTab "acești" "aceste");
-Those = det Pl (mkTab "acei" "acele");
-
-Wine = mkNoun "vin" "vinuri" NNeut ;
-Cheese = mkNoun "brânză" "brânzeturi" NFem ;
-Fish = mkNoun "peşte" "peşti" NMasc ;
-Pizza = mkNoun "pizza" "pizze" NFem;
-
-Very a = {s = \\n,g => "foarte" ++ a.s ! n ! g};
-
-Fresh = mkAdj "proaspăt" "proaspătă" "proaspeţi" "proaspete" ;
-Warm = mkAdj "cald" "caldă" "calzi" "calde" ;
-Italian = mkAdj "italian" "italiană" "italieni" "italiene" ;
-Expensive = mkAdj "scump" "scumpă" "scumpi" "scumpe" ;
-Delicious = mkAdj "delicios" "delcioasă" "delicioşi" "delicioase" ;
-Boring = mkAdj "plictisitor" "plictisitoare" "plictisitori" "plictisitoare" ;
-
-Pred item quality = {s = item.s ++ copula ! item.n ++ quality.s ! item.n ! item.g} ;
-
-Mod quality kind = {s = \\n => kind.s ! n ++ quality.s ! n ! (getAgrGender kind.g n) ; g = kind.g};
-
-oper
-
-mkTab : Str -> Str -> {s : Gender => Str} = \acesta, aceasta ->
-{s = table{Masc => acesta;
- Fem => aceasta}};
-
-det : Number -> {s : Gender => Str} -> {s : Number => Str ; g : NGender} -> {s : Str; n : Number; g : Gender} =
-\n,det,noun -> let gg = getAgrGender noun.g n
- in
- {s = det.s ! gg ++ noun.s ! n ; n = n ; g = gg};
-
-mkNoun : Str -> Str -> NGender -> {s : Number => Str; g : NGender} = \peste, pesti,g ->
-{s = table {Sg => peste;
- Pl => pesti};
- g = g
-};
-
-oper mkAdj : (x1,_,_,x4 : Str) -> {s : Number => Gender => Str} = \scump, scumpa, scumpi, scumpe ->
-{s = \\n,g => case <n,g> of
-{<Sg,Masc> => scump ; <Sg,Fem> => scumpa;
-<Pl,Masc> => scumpi ; <Pl,Fem> => scumpe
-}};
-
-copula : Number => Str = table {Sg => "este" ; Pl => "sunt"};
-
-getAgrGender : NGender -> Number -> Gender = \ng,n ->
-case <ng,n> of
-{<NMasc,_> => Masc ; <NFem,_> => Fem;
-<NNeut,Sg> => Masc ; <NNeut,Pl> => Fem
-};
-
-}
diff --git a/contrib/summerschool/foods/FoodsSpa.gf b/contrib/summerschool/foods/FoodsSpa.gf deleted file mode 100644 index 972282ae5..000000000 --- a/contrib/summerschool/foods/FoodsSpa.gf +++ /dev/null @@ -1,31 +0,0 @@ ---# -path=.:present
-
-concrete FoodsSpa of Foods = open SyntaxSpa, StructuralSpa, ParadigmsSpa in {
-
- lincat
- Comment = Utt ;
- Item = NP ;
- Kind = CN ;
- Quality = AP ;
-
- lin
- Pred item quality = mkUtt (mkCl item quality) ;
- This kind = mkNP this_QuantSg kind ;
- That kind = mkNP that_QuantSg kind ;
- These kind = mkNP these_QuantPl kind ;
- Those kind = mkNP those_QuantPl kind ;
- Mod quality kind = mkCN quality kind ;
- Very quality = mkAP very_AdA quality ;
- Wine = mkCN (mkN "vino") ;
- Pizza = mkCN (mkN "pizza") ;
- Cheese = mkCN (mkN "queso") ;
- Fish = mkCN (mkN "pescado") ;
- Fresh = mkAP (mkA "fresco") ;
- Warm = mkAP (mkA "caliente") ;
- Italian = mkAP (mkA "italiano") ;
- Expensive = mkAP (mkA "caro") ;
- Delicious = mkAP (mkA "delicioso") ;
- Boring = mkAP (mkA "aburrido") ;
-
-}
-
diff --git a/contrib/summerschool/foods/FoodsSwe.gf b/contrib/summerschool/foods/FoodsSwe.gf deleted file mode 100644 index cbb35fb98..000000000 --- a/contrib/summerschool/foods/FoodsSwe.gf +++ /dev/null @@ -1,7 +0,0 @@ ---# -path=.:present - --- (c) 2009 Aarne Ranta under LGPL - -concrete FoodsSwe of Foods = FoodsI with - (Syntax = SyntaxSwe), - (LexFoods = LexFoodsSwe) ** {flags language = sv_SE;} ; diff --git a/contrib/summerschool/foods/FoodsTha.gf b/contrib/summerschool/foods/FoodsTha.gf deleted file mode 100644 index b031a7e2f..000000000 --- a/contrib/summerschool/foods/FoodsTha.gf +++ /dev/null @@ -1,33 +0,0 @@ ---# -path=.:alltenses
-
-concrete FoodsTha of Foods = open SyntaxTha, LexiconTha,
- ParadigmsTha, (R=ResTha) in {
-
- flags coding = utf8 ;
-
- lincat
- Comment = Utt ;
- Item = NP ;
- Kind = CN ;
- Quality = AP ;
-
- lin
- Pred item quality = mkUtt (mkCl item quality) ;
- This kind = mkNP this_Det kind ;
- That kind = mkNP that_Det kind ;
- These kind = mkNP these_Det kind ;
- Those kind = mkNP those_Det kind ;
- Mod quality kind = mkCN quality kind ;
- Very quality = mkAP very_AdA quality ;
- Wine = mkCN (mkN (R.thword "เหล้าอ" "งุ่น") "ขวด") ;
- Pizza = mkCN (mkN (R.thword "พิซ" "ซา") "ถาด") ;
- Cheese = mkCN (mkN (R.thword "เนย" "แข็ง") "ก้อน") ;
- Fish = mkCN fish_N ;
- Fresh = mkAP (mkA "สด") ;
- Warm = mkAP warm_A ;
- Italian = mkAP (mkA " อิตาลี") ;
- Expensive = mkAP (mkA "แพง") ;
- Delicious = mkAP (mkA "อร่อย") ;
- Boring = mkAP (mkA (R.thword "น่า" "เบิ่อ")) ;
-
-}
diff --git a/contrib/summerschool/foods/FoodsTsn.gf b/contrib/summerschool/foods/FoodsTsn.gf deleted file mode 100644 index a7a69a1a5..000000000 --- a/contrib/summerschool/foods/FoodsTsn.gf +++ /dev/null @@ -1,178 +0,0 @@ ---# -path=alltenses - --- (c) 2009 Laurette Pretorius Sr & Jr and Ansu Berg under LGPL - -concrete FoodsTsn of Foods = open Prelude, Predef in { - flags coding = utf8; - lincat - Comment = {s:Str}; - Item = {s:Str; c:NounClass; n:Number}; - Kind = {w: Number => Str; r: Str; c: NounClass; q: Number => Str; b: Bool}; - Quality = {s: NounClass => Number => Str; p_form: Str; t: TType}; - lin - Pred item quality = {s = item.s ++ ((mkPredDescrCop quality.t) ! item.c ! item.n) ++ quality.p_form}; - - This kind = {s = (kind.w ! Sg) ++ (mkDemPron1 ! kind.c ! Sg) ++ (kind.q ! Sg); c = kind.c; n = Sg}; - That kind = {s = (kind.w ! Sg) ++ (mkDemPron2 ! kind.c ! Sg) ++ (kind.q ! Sg); c = kind.c; n = Sg}; - These kind = {s = (kind.w ! Pl) ++ (mkDemPron1 ! kind.c ! Pl) ++ (kind.q ! Pl); c = kind.c; n = Pl}; - Those kind = {s = (kind.w ! Pl) ++ (mkDemPron2 ! kind.c ! Pl) ++ (kind.q ! Pl); c = kind.c; n = Pl}; - - Mod quality kind = mkMod quality kind; - - -- Lexicon - Wine = mkNounNC14_6 "jalwa"; - Cheese = mkNounNC9_10 "kase"; - Fish = mkNounNC9_10 "thlapi"; - Pizza = mkNounNC9_10 "pizza"; - Very quality = smartVery quality; - Fresh = mkVarAdj "ntsha"; - Warm = mkOrdAdj "bothitho"; - Italian = mkPerAdj "Itali"; - Expensive = mkVerbRel "tura"; - Delicious = mkOrdAdj "monate"; - Boring = mkOrdAdj "bosula"; - - param - NounClass = NC9_10 | NC14_6; - Number = Sg | Pl; - TType = P | V | ModV | R ; - oper - mkMod : {s: NounClass => Number => Str; p_form: Str; t: TType} -> {w: Number => Str; r: Str; c: NounClass; q: Number => Str; b: Bool} -> {w: Number => Str; r: Str; c: NounClass; q: Number => Str; - b: Bool} = \x,y -> case y.b of - { - True => {w = y.w; r = y.r; c = y.c; - q = table { - Sg => ((y.q ! Sg) ++ "le" ++ ((smartQualRelPart (x.t)) ! y.c ! Sg) ++ ((smartDescrCop (x.t)) ! y.c ! Sg) ++ (x.s ! y.c ! Sg)); - Pl => ((y.q ! Pl) ++ "le" ++ ((smartQualRelPart (x.t))! y.c ! Pl) ++ ((smartDescrCop (x.t)) ! y.c ! Pl) ++(x.s ! y.c ! Pl)) - }; b = True - }; - False => {w = y.w; r = y.r; c = y.c; - q = table { - Sg => ((y.q ! Sg) ++ ((smartQualRelPart (x.t)) ! y.c ! Sg) ++ ((smartDescrCop (x.t)) ! y.c ! Sg) ++ (x.s ! y.c ! Sg)); - Pl => ((y.q ! Pl) ++ ((smartQualRelPart (x.t)) ! y.c ! Pl) ++ ((smartDescrCop (x.t)) ! y.c ! Pl) ++(x.s ! y.c ! Pl)) - }; b = True - } - }; - - mkNounNC14_6 : Str -> {w: Number => Str; r: Str; c: NounClass; q: Number => Str; b: Bool} = \x -> {w = table {Sg => "bo" + x; Pl => "ma" + x}; r = x; c = NC14_6; - q = table {Sg => ""; Pl => ""}; b = False}; - - mkNounNC9_10 : Str -> {w: Number => Str; r: Str; c: NounClass; q: Number => Str; b: Bool} = \x -> {w = table {Sg => "" + x; Pl => "di" + x}; r = x; c = NC9_10; - q = table {Sg => ""; Pl => ""}; b = False}; - - mkVarAdj : Str -> {s: NounClass => Number => Str; p_form: Str; t: TType} = \x -> - { - s = table { - NC9_10 => table {Sg => "" + x; Pl => "di" + x}; - NC14_6 => table {Sg => "bo" + x; Pl => "ma" + x} - }; - p_form = x; - t = R; - }; - - mkOrdAdj : Str -> {s: NounClass => Number => Str; p_form: Str; t: TType} = \x -> - { - s = table { - NC9_10 => table {Sg => "" + x; Pl => "" + x}; - NC14_6 => table {Sg => "" + x; Pl => "" + x} - }; - p_form = x; - t = R; - }; - - mkVerbRel : Str -> {s: NounClass => Number => Str; p_form: Str; t: TType} = \x -> - { - s = table { - NC9_10 => table {Sg => x + "ng"; Pl => x + "ng"}; - NC14_6 => table {Sg => x + "ng"; Pl => x + "ng"} - }; - p_form = x; - t = V; - }; - - mkPerAdj : Str -> {s: NounClass => Number => Str; p_form: Str; t: TType} = \x -> - { - s = table { - NC9_10 => table {Sg => "" + x; Pl => "" + x}; - NC14_6 => table {Sg => "" + x; Pl => "" + x} - }; - p_form = "mo" ++ x; - t = P; - }; - - mkVeryAdj : {s: NounClass => Number => Str; p_form: Str; t: TType} -> {s: NounClass => Number => Str; p_form: Str; t: TType} = \x -> - { - s = table{c => table{n => (x.s!c!n) ++ "thata"}}; p_form = x.p_form ++ "thata"; t = x.t - }; - - mkVeryVerb : {s: NounClass => Number => Str; p_form: Str; t: TType} -> {s: NounClass => Number => Str; p_form: Str; t: TType} = \x -> - { - s = table{c => table{n => (x.s!c!n) ++ "thata"}}; p_form = x.p_form ++ "thata"; t = ModV - }; - - smartVery : {s: NounClass => Number => Str; p_form: Str; t: TType} -> {s: NounClass => Number => Str; p_form: Str; t: TType} = -\x -> case x.t of --(x.s!c!n) - { - (V | ModV) => mkVeryVerb x; - --ModV => mkVeryVerb x; - _ => mkVeryAdj x - }; - - mkDemPron1 : NounClass => Number => Str = table - { - NC9_10 => table {Sg => "e"; Pl => "tse"}; - NC14_6 => table {Sg => "bo"; Pl => "a"} - }; - - mkDemPron2 : NounClass => Number => Str = table - { - NC9_10 => table {Sg => "eo"; Pl => "tseo"}; - NC14_6 => table {Sg => "boo"; Pl => "ao"} - }; - - smartQualRelPart : TType -> (NounClass => Number => Str) = \x -> case x of - { - P => mkQualRelPart_PName; - _ => mkQualRelPart - }; - - mkQualRelPart : NounClass => Number => Str = table - { - NC9_10 => table {Sg => "e"; Pl => "tse"}; - NC14_6 => table {Sg => "bo"; Pl => "a"} - }; - - mkQualRelPart_PName : NounClass => Number => Str = table - { - NC9_10 => table {Sg => "ya"; Pl => "tsa"}; - NC14_6 => table {Sg => "ba"; Pl => "a"} - }; - - smartDescrCop : TType -> (NounClass => Number => Str) = \x -> case x of - { - P => mkDescrCop_PName; - _ => mkDescrCop - }; - - mkDescrCop : NounClass => Number => Str = table - { - NC9_10 => table {Sg => "e"; Pl => "di"}; - NC14_6 => table {Sg => "bo"; Pl => "a"} - }; - - mkDescrCop_PName : NounClass => Number => Str = table - { - NC9_10 => table {Sg => "ga"; Pl => "ga"}; - NC14_6 => table {Sg => "ga"; Pl => "ga"} - }; - - mkPredDescrCop : TType -> (NounClass => Number => Str) = \x -> case x of - { - V => table {NC9_10 => table {Sg => "e" ++ "a"; Pl => "di" ++ "a"}; - NC14_6 => table {Sg => "bo" ++ "a"; Pl => "a" ++ "a"}}; - - _ => table {NC9_10 => table {Sg => "e"; Pl => "di"}; - NC14_6 => table {Sg => "bo"; Pl => "a"}} - }; - -} diff --git a/contrib/summerschool/foods/FoodsTur.gf b/contrib/summerschool/foods/FoodsTur.gf deleted file mode 100644 index 9d6cd0350..000000000 --- a/contrib/summerschool/foods/FoodsTur.gf +++ /dev/null @@ -1,140 +0,0 @@ -{- - File : FoodsTur.gf - Author : Server Çimen - Version : 1.0 - Created on: August 26, 2009 - - This file contains concrete grammar of Foods abstract grammar for Turkish Language. - This grammar is to be used for Fridge demo and developed in the scope of GF Resource - Grammar Summer School. - --} - -concrete FoodsTur of Foods = open Predef in { - flags - coding=utf8 ; - lincat - Comment = {s : Str} ; - Quality = {s : Str ; c : Case; softness : Softness; h : Harmony} ; - Kind = {s : Case => Number => Str} ; - Item = {s : Str; n : Number} ; - lin - This = det Sg "bu" ; - That = det Sg "şu" ; - These = det Pl "bu" ; - Those = det Pl "şu" ; - -- Reason for excluding plural form of copula: In Turkish if subject is not a human being, - -- then singular form of copula is used regardless of the number of subject. Since all - -- possible subjects are non human, copula do not need to have plural form. - Pred item quality = {s = item.s ++ quality.s ++ "&+" ++ copula ! quality.softness ! quality.h} ;--! item.n} ; - Mod quality kind = {s = case quality.c of { - Nom => \\t,n => quality.s ++ kind.s ! t ! n ; - Gen => \\t,n => quality.s ++ kind.s ! Gen ! n - } - } ; - Wine = mkN "şarap" "şaraplar" "şarabı" "şarapları" ; - Cheese = mkN "peynir" "peynirler" "peyniri" "peynirleri" ; - Fish = mkN "balık" "balıklar" "balığı" "balıkları" ; - Pizza = mkN "pizza" "pizzalar" "pizzası" "pizzaları" ; - Very a = {s = "çok" ++ a.s ; c = a.c; softness = a.softness; h = a.h} ; - Fresh = adj "taze" Nom; - Warm = adj "ılık" Nom; - Italian = adj "İtalyan" Gen ; - Expensive = adj "pahalı" Nom; - Delicious = adj "lezzetli" Nom; - Boring = adj "sıkıcı" Nom; - param - Number = Sg | Pl ; - Case = Nom | Gen ; - Harmony = I_Har | Ih_Har | U_Har | Uh_Har ; --Ih = İ; Uh = Ü - Softness = Soft | Hard ; - oper - det : Number -> Str -> {s : Case => Number => Str} -> {s : Str; n : Number} = - \num,det,noun -> {s = det ++ noun.s ! Nom ! num; n = num} ; - mkN = overload { - mkN : Str -> Str -> {s : Case => Number => Str} = regNoun ; - mkn : Str -> Str -> Str -> Str-> {s : Case => Number => Str} = noun ; - } ; - regNoun : Str -> Str -> {s : Case => Number => Str} = - \peynir,peynirler -> noun peynir peynirler [] [] ; - noun : Str -> Str -> Str -> Str-> {s : Case => Number => Str} = - \sarap,saraplar,sarabi,saraplari -> { - s = table { - Nom => table { - Sg => sarap ; - Pl => saraplar - } ; - Gen => table { - Sg => sarabi ; - Pl => saraplari - } - } - }; - {- - Since there is a bug in overloading, this overload is useless. - - mkA = overload { - mkA : Str -> {s : Str; c : Case; softness : Softness; h : Harmony} = \base -> adj base Nom ; - mkA : Str -> Case -> {s : Str; c : Case; softness : Softness; h : Harmony} = adj ; - } ; - -} - adj : Str -> Case -> {s : Str; c : Case; softness : Softness; h : Harmony} = - \italyan,ca -> {s = italyan ; c = ca; softness = (getSoftness italyan); h = (getHarmony italyan)} ; - -- See the comment at lines 26 and 27 for excluded plural form of copula. - copula : Softness => Harmony {-=> Number-} => Str = - table { - Soft => table { - I_Har => "dır" ;--table { - -- Sg => "dır" ; - -- Pl => "dırlar" - --} ; - Ih_Har => "dir" ;--table { - --Sg => "dir" ; - --Pl => "dirler" - --} ; - U_Har => "dur" ;--table { - -- Sg => "dur" ; - -- Pl => "durlar" - --} ; - Uh_Har => "dür" --table { - --Sg => "dür" ; - --Pl => "dürler" - --} - } ; - Hard => table { - I_Har => "tır" ;--table { - --Sg => "tır" ; - --Pl => "tırlar" - --} ; - Ih_Har => "tir" ;--table { - --Sg => "tir" ; - --Pl => "tirler" - --} ; - U_Har => "tur" ;--table { - -- Sg => "tur" ; - -- Pl => "turlar" - --} ; - Uh_Har => "tür"--table { - --Sg => "tür" ; - --Pl => "türler" - --} - } - } ; - - getHarmony : Str -> Harmony - = \base -> case base of { - _+c@("ı"|"a"|"i"|"e"|"u"|"o"|"ü"|"ö")+ - ("b"|"v"|"d"|"z"|"j"|"c"|"g"|"ğ"|"l"|"r"|"m"|"n"|"y"|"p"|"f"|"t"|"s"|"ş"|"ç"|"k"|"h")* => - case c of { - ("ı"|"a") => I_Har ; - ("i"|"e") => Ih_Har ; - ("u"|"o") => U_Har ; - ("ü"|"ö") => Uh_Har - } - } ; - getSoftness : Str -> Softness - = \base -> case base of { - _+("f"|"s"|"t"|"k"|"ç"|"ş"|"h"|"p") => Hard ; - _ => Soft - } ; -}
\ No newline at end of file diff --git a/contrib/summerschool/foods/FoodsUrd.gf b/contrib/summerschool/foods/FoodsUrd.gf deleted file mode 100644 index 186b2f929..000000000 --- a/contrib/summerschool/foods/FoodsUrd.gf +++ /dev/null @@ -1,53 +0,0 @@ --- (c) 2009 Shafqat Virk under LGPL
-
-concrete FoodsUrd of Foods = {
-
- flags coding=utf8 ;
-
-
- param Number = Sg | Pl ;
- param Gender = Masc | Fem;
-
- oper coupla : Number -> Str =\n -> case n of {Sg => "ہے" ; Pl => "ہیں"};
-
-
- lincat
- Comment = {s : Str} ;
- Item = {s: Str ; n: Number ; g:Gender};
- Kind = {s: Number => Str ; g:Gender};
- Quality = {s: Gender => Number => Str};
-
- lin
- Pred item quality = {s = item.s ++ quality.s ! item.g ! item.n ++ coupla item.n} ;
- This kind = {s = "یھ" ++ kind.s ! Sg; n= Sg ; g = kind.g } ;
- These kind = {s = "یھ" ++ kind.s ! Pl; n = Pl ; g = kind.g} ;
- That kind = {s = "وہ" ++ kind.s ! Sg; n= Sg ; g = kind.g} ;
- Those kind = {s = "وہ" ++ kind.s ! Pl; n=Pl ; g = kind.g} ;
- Mod quality kind = {s = \\n => quality.s ! kind.g ! n ++ kind.s ! n ; g = kind.g};
- Wine = {s = table { Sg => "شراب" ; Pl => "شرابیں"} ; g = Fem};
- Cheese = {s = table { Sg => "پنیر" ; Pl => "پنیریں"} ; g = Fem};
- Fish = {s = table { Sg => "مچھلی" ; Pl => "مچھلیاں"} ; g = Fem};
- Pizza = {s = table { Sg => "پیزہ" ; Pl => "پیزے"} ; g = Masc};
- Very quality = {s = \\g,n => "بہت" ++ quality.s ! g ! n} ;
- Fresh = regAdj "تازہ" ;
- Warm = regAdj "گرم" ;
- Italian = regAdj "اٹا لوی" ;
- Expensive = regAdj "مہنگا" ;
- Delicious = regAdj "مزیدار" ;
- Boring = regAdj "فضول" ;
-
- oper
- regAdj : Str -> {s: Gender => Number => Str} = \a -> case a of {
- x + "ا" => mkAdj a (x+"ے") (x+"ی");
- _ => mkAdj a a a
- };
- mkAdj : Str -> Str -> Str -> {s: Gender => Number => Str} = \s,p,f -> {
- s = table {
- Masc => table {
- Sg => s;
- Pl => p
- };
- Fem => \\_ => f
- }
- };
- }
\ No newline at end of file diff --git a/contrib/summerschool/foods/LexFoods.gf b/contrib/summerschool/foods/LexFoods.gf deleted file mode 100644 index 12ace208c..000000000 --- a/contrib/summerschool/foods/LexFoods.gf +++ /dev/null @@ -1,15 +0,0 @@ --- (c) 2009 Aarne Ranta under LGPL - -interface LexFoods = open Syntax in { - oper - wine_N : N ; - pizza_N : N ; - cheese_N : N ; - fish_N : N ; - fresh_A : A ; - warm_A : A ; - italian_A : A ; - expensive_A : A ; - delicious_A : A ; - boring_A : A ; -} diff --git a/contrib/summerschool/foods/LexFoodsCat.gf b/contrib/summerschool/foods/LexFoodsCat.gf deleted file mode 100644 index 624fc98c8..000000000 --- a/contrib/summerschool/foods/LexFoodsCat.gf +++ /dev/null @@ -1,18 +0,0 @@ --- (c) 2009 Jordi Saludes under LGPL - -instance LexFoodsCat of LexFoods = - open SyntaxCat, ParadigmsCat, (M = MorphoCat) in { - flags - coding = utf8 ; - oper - wine_N = mkN "vi" "vins" M.Masc ; - pizza_N = mkN "pizza" ; - cheese_N = mkN "formatge" ; - fish_N = mkN "peix" "peixos" M.Masc; - fresh_A = mkA "fresc" "fresca" "frescos" "fresques" "frescament"; - warm_A = mkA "calent" ; - italian_A = mkA "italià" "italiana" "italians" "italianes" "italianament" ; - expensive_A = mkA "car" ; - delicious_A = mkA "deliciós" "deliciosa" "deliciosos" "delicioses" "deliciosament"; - boring_A = mkA "aburrit" "aburrida" "aburrits" "aburrides" "aburridament" ; -} diff --git a/contrib/summerschool/foods/LexFoodsFin.gf b/contrib/summerschool/foods/LexFoodsFin.gf deleted file mode 100644 index 4cf26511a..000000000 --- a/contrib/summerschool/foods/LexFoodsFin.gf +++ /dev/null @@ -1,20 +0,0 @@ --- (c) 2009 Aarne Ranta under LGPL - -instance LexFoodsFin of LexFoods = - open SyntaxFin, ParadigmsFin in { - oper - wine_N = mkN "viini" ; - pizza_N = mkN "pizza" ; - cheese_N = mkN "juusto" ; - fish_N = mkN "kala" ; - fresh_A = mkA "tuore" ; - warm_A = mkA - (mkN "lmmin" "lmpimn" "lmmint" "lmpimn" "lmpimn" - "lmpimin" "lmpimi" "lmpimien" "lmpimiss" "lmpimiin" - ) - "lmpimmpi" "lmpimin" ; - italian_A = mkA "italialainen" ; - expensive_A = mkA "kallis" ; - delicious_A = mkA "herkullinen" ; - boring_A = mkA "tyls" ; -} diff --git a/contrib/summerschool/foods/LexFoodsGer.gf b/contrib/summerschool/foods/LexFoodsGer.gf deleted file mode 100644 index a420e22d3..000000000 --- a/contrib/summerschool/foods/LexFoodsGer.gf +++ /dev/null @@ -1,16 +0,0 @@ --- (c) 2009 Aarne Ranta under LGPL - -instance LexFoodsGer of LexFoods = - open SyntaxGer, ParadigmsGer in { - oper - wine_N = mkN "Wein" ; - pizza_N = mkN "Pizza" "Pizzen" feminine ; - cheese_N = mkN "Kse" "Kse" masculine ; - fish_N = mkN "Fisch" ; - fresh_A = mkA "frisch" ; - warm_A = mkA "warm" "wrmer" "wrmste" ; - italian_A = mkA "italienisch" ; - expensive_A = mkA "teuer" ; - delicious_A = mkA "kstlich" ; - boring_A = mkA "langweilig" ; -} diff --git a/contrib/summerschool/foods/LexFoodsIta.gf b/contrib/summerschool/foods/LexFoodsIta.gf deleted file mode 100644 index 11de5fcda..000000000 --- a/contrib/summerschool/foods/LexFoodsIta.gf +++ /dev/null @@ -1,16 +0,0 @@ --- (c) 2009 Aarne Ranta under LGPL - -instance LexFoodsIta of LexFoods = - open SyntaxIta, ParadigmsIta in { - oper - wine_N = mkN "vino" ; - pizza_N = mkN "pizza" ; - cheese_N = mkN "formaggio" ; - fish_N = mkN "pesce" ; - fresh_A = mkA "fresco" ; - warm_A = mkA "caldo" ; - italian_A = mkA "italiano" ; - expensive_A = mkA "caro" ; - delicious_A = mkA "delizioso" ; - boring_A = mkA "noioso" ; -} diff --git a/contrib/summerschool/foods/LexFoodsSwe.gf b/contrib/summerschool/foods/LexFoodsSwe.gf deleted file mode 100644 index 72e7e3e86..000000000 --- a/contrib/summerschool/foods/LexFoodsSwe.gf +++ /dev/null @@ -1,16 +0,0 @@ --- (c) 2009 Aarne Ranta under LGPL - -instance LexFoodsSwe of LexFoods = - open SyntaxSwe, ParadigmsSwe in { - oper - wine_N = mkN "vin" "vinet" "viner" "vinerna" ; - pizza_N = mkN "pizza" ; - cheese_N = mkN "ost" ; - fish_N = mkN "fisk" ; - fresh_A = mkA "frsk" ; - warm_A = mkA "varm" ; - italian_A = mkA "italiensk" ; - expensive_A = mkA "dyr" ; - delicious_A = mkA "lcker" ; - boring_A = mkA "trkig" ; -} diff --git a/contrib/summerschool/foods/Makefile b/contrib/summerschool/foods/Makefile deleted file mode 100644 index 5738bc281..000000000 --- a/contrib/summerschool/foods/Makefile +++ /dev/null @@ -1,8 +0,0 @@ - -all:: Foods.pgf - -Foods.pgf: Foods???.gf - gf -make -s -optimize-pgf Foods???.gf - -clean: - rm -rf *.gfo Foods.pgf diff --git a/contrib/summerschool/foods/MutationsGla.gf b/contrib/summerschool/foods/MutationsGla.gf deleted file mode 100644 index 41eb11006..000000000 --- a/contrib/summerschool/foods/MutationsGla.gf +++ /dev/null @@ -1,53 +0,0 @@ -resource MutationsGla = open CharactersGla in {
- param Mutation = Unmutated|Lenition1|Lenition1DNTLS|Lenition2|PrefixT|PrefixH;
-
- --Turns a string into a mutation table
- oper mutate : (_ : Str) -> (Mutation => Str) = \str -> table {
- Unmutated => str ;
- Lenition1 => lenition1 str ;
- Lenition1DNTLS => lenition1dntls str ;
- Lenition2 => lenition2 str ;
- PrefixT => prefixT str ;
- PrefixH => prefixH str
- };
-
- --Performs lenition 1: inserts "h" if the word begins with a lenitable character
- oper lenition1 : Str -> Str = \str -> case str of {
- start@("p"|"b"|"m"|"f"|"t"|"d"|"c"|"g") + rest => start + "h" + rest ;
- start@("P"|"B"|"M"|"F"|"T"|"D"|"C"|"G") + rest => start + "h" + rest ;
- ("s"|"S") + ("p"|"t"|"c") + _ => str ; --the sequences "sp", "st", "sc" are never mutated
- start@("s"|"S") + rest => start + "h" + rest ;
- _ => str
- };
-
- --Performs lenition 1 with dentals: same as lenition 1 but leaves "d", "t" and "s" unmutated
- oper lenition1dntls : Str -> Str = \str -> case str of {
- start@("p"|"b"|"m"|"f"|"c"|"g") + rest => start + "h" + rest ;
- start@("P"|"B"|"M"|"F"|"C"|"G") + rest => start + "h" + rest ;
- _ => str
- };
-
- --Performs lenition 2: same as lenition 1 with dentals but also changes "s" into "ts"
- oper lenition2 : Str -> Str = \str -> case str of {
- start@("p"|"b"|"m"|"f"|"c"|"g") + rest => start + "h" + rest ;
- start@("P"|"B"|"M"|"F"|"C"|"G") + rest => start + "h" + rest ;
- ("s"|"S") + ("p"|"t"|"c") + _ => str ; --the sequences "sp", "st", "sc" are never mutated
- start@("s"|"S") + rest => "t-" + start + rest ;
- _ => str
- };
-
- --Prefixes a "t" to words beginning with a vowel
- oper prefixT : Str -> Str = \str -> case str of {
- start@(#vowel) + rest => "t-" + start + rest ;
- start@(#vowelCap) + rest => "t-" + start + rest ;
- _ => str
- };
-
- --Prefixes a "h" to words beginning with a vowel
- oper prefixH : Str -> Str = \str -> case str of {
- start@(#vowel) + rest => "h-" + start + rest ;
- start@(#vowelCap) + rest => "h-" + start + rest ;
- _ => str
- };
-
-}
\ No newline at end of file diff --git a/contrib/summerschool/foods/MutationsGle.gf b/contrib/summerschool/foods/MutationsGle.gf deleted file mode 100644 index 9ae734a90..000000000 --- a/contrib/summerschool/foods/MutationsGle.gf +++ /dev/null @@ -1,92 +0,0 @@ -resource MutationsGle = open CharactersGle in {
- param Mutation = Unmutated|Lenition1|Lenition1DNTLS|Lenition2|Eclipsis1|Eclipsis2|Eclipsis3|PrefixT|PrefixH;
-
- --Turns a string into a mutation table
- oper mutate : (_ : Str) -> (Mutation => Str) = \str -> table {
- Unmutated => str ;
- Lenition1 => lenition1 str ;
- Lenition1DNTLS => lenition1dntls str ;
- Lenition2 => lenition2 str ;
- Eclipsis1 => eclipsis1 str ;
- Eclipsis2 => eclipsis2 str ;
- Eclipsis3 => eclipsis3 str ;
- PrefixT => prefixT str ;
- PrefixH => prefixH str
- };
-
- --Performs lenition 1: inserts "h" if the word begins with a lenitable character
- oper lenition1 : Str -> Str = \str -> case str of {
- start@("p"|"b"|"m"|"f"|"t"|"d"|"c"|"g") + rest => start + "h" + rest ;
- start@("P"|"B"|"M"|"F"|"T"|"D"|"C"|"G") + rest => start + "h" + rest ;
- ("s"|"S") + ("p"|"t"|"c") + _ => str ; --the sequences "sp", "st", "sc" are never mutated
- start@("s"|"S") + rest => start + "h" + rest ;
- _ => str
- };
-
- --Performs lenition 1 with dentals: same as lenition 1 but leaves "d", "t" and "s" unmutated
- oper lenition1dntls : Str -> Str = \str -> case str of {
- start@("p"|"b"|"m"|"f"|"c"|"g") + rest => start + "h" + rest ;
- start@("P"|"B"|"M"|"F"|"C"|"G") + rest => start + "h" + rest ;
- _ => str
- };
-
- --Performs lenition 2: same as lenition 1 with dentals but also changes "s" into "ts"
- oper lenition2 : Str -> Str = \str -> case str of {
- start@("p"|"b"|"m"|"f"|"c"|"g") + rest => start + "h" + rest ;
- start@("P"|"B"|"M"|"F"|"C"|"G") + rest => start + "h" + rest ;
- ("s"|"S") + ("p"|"t"|"c") + _ => str ; --the sequences "sp", "st", "sc" are never mutated
- start@("s"|"S") + rest => "t" + start + rest ;
- _ => str
- };
-
- --Performs eclisis 1: prefixes something to every word that begins with an ecliptable character
- oper eclipsis1 : Str -> Str = \str -> case str of {
- start@("p"|"P") + rest => "b" + start + rest ;
- start@("b"|"B") + rest => "m" + start + rest ;
- start@("f"|"F") + rest => "bh" + start + rest ;
- start@("c"|"C") + rest => "g" + start + rest ;
- start@("g"|"G") + rest => "n" + start + rest ;
- start@("t"|"T") + rest => "d" + start + rest ;
- start@("d"|"D") + rest => "n" + start + rest ;
- start@(#vowel) + rest => "n-" + start + rest ;
- start@(#vowelCap) + rest => "n" + start + rest ;
- _ => str
- };
-
- --Performs eclipsis 2: same as eclipsis 1 but leaves "t", "d" and vowels unchanges
- oper eclipsis2 : Str -> Str = \str -> case str of {
- start@("p"|"P") + rest => "b" + start + rest ;
- start@("b"|"B") + rest => "m" + start + rest ;
- start@("f"|"F") + rest => "bh" + start + rest ;
- start@("c"|"C") + rest => "g" + start + rest ;
- start@("g"|"G") + rest => "n" + start + rest ;
- _ => str
- };
-
- --Performs eclipsis 3: same as eclipsis 2 but also changes "s" to "ts"
- eclipsis3 : Str -> Str = \str -> case str of {
- start@("p"|"P") + rest => "b" + start + rest ;
- start@("b"|"B") + rest => "m" + start + rest ;
- start@("f"|"F") + rest => "bh" + start + rest ;
- start@("c"|"C") + rest => "g" + start + rest ;
- start@("g"|"G") + rest => "n" + start + rest ;
- ("s"|"S") + ("p"|"t"|"c") + _ => str ; --the sequences "sp", "st", "sc" are never mutated
- start@("s"|"S") + rest => "t" + start + rest ;
- _ => str
- };
-
- --Prefixes a "t" to words beginning with a vowel
- oper prefixT : Str -> Str = \str -> case str of {
- start@(#vowel) + rest => "t-" + start + rest ;
- start@(#vowelCap) + rest => "t" + start + rest ;
- _ => str
- };
-
- --Prefixes a "h" to words beginning with a vowel
- oper prefixH : Str -> Str = \str -> case str of {
- start@(#vowel) + rest => "h" + start + rest ;
- start@(#vowelCap) + rest => "h" + start + rest ;
- _ => str
- };
-
-}
\ No newline at end of file diff --git a/contrib/summerschool/foods/README b/contrib/summerschool/foods/README deleted file mode 100644 index 64bc4ed5b..000000000 --- a/contrib/summerschool/foods/README +++ /dev/null @@ -1,8 +0,0 @@ -Foods grammars from GF Summer School 2009. To build: - - $ gf -make -s Foods???.gf -- to create Foods.pgf - - $ mv Foods.pgf ~/GF/src/server/gwt/www/grammars/ -- to use in web applications - - - diff --git a/contrib/summerschool/foods/ResCze.gf b/contrib/summerschool/foods/ResCze.gf deleted file mode 100644 index 56b4aa6ee..000000000 --- a/contrib/summerschool/foods/ResCze.gf +++ /dev/null @@ -1,46 +0,0 @@ --- (c) 2011 Katerina Bohmova under LGPL - -resource ResCze = open Prelude in { - flags - coding = utf8 ; - param - Number = Sg | Pl ; - Gender = Masc | Fem | Neutr; - oper - NounPhrase : Type = - {s : Str ; g : Gender ; n : Number} ; - Noun : Type = {s : Number => Str ; g : Gender} ; - Adjective : Type = {s : Gender => Number => Str} ; - - det : Number -> Str -> Str -> Str -> Noun -> NounPhrase = - \n,m,f,ne,cn -> { - s = table {Masc => m ; Fem => f; Neutr => ne} ! cn.g ++ - cn.s ! n ; - g = cn.g ; - n = n - } ; - noun : Str -> Str -> Gender -> Noun = - \muz,muzi,g -> { - s = table {Sg => muz ; Pl => muzi} ; - g = g - } ; - adjective : (msg,fsg,nsg,mpl,fpl,npl : Str) -> Adjective = - \msg,fsg,nsg,mpl,fpl,npl -> { - s = table { - Masc => table {Sg => msg ; Pl => mpl} ; - Fem => table {Sg => fsg ; Pl => fpl} ; - Neutr => table {Sg => nsg ; Pl => npl} - } - } ; - regAdj : Str -> Adjective = - \mlad -> - adjective (mlad+"ý") (mlad+"á") (mlad+"é") - (mlad+"é") (mlad+"é") (mlad+"á") ; - regnfAdj : Str -> Adjective = - \vynikajici -> - adjective vynikajici vynikajici vynikajici - vynikajici vynikajici vynikajici; - copula : Number => Str = - table {Sg => "je" ; Pl => "jsou"} ; -} - diff --git a/contrib/summerschool/foods/transFoodsHin.gf b/contrib/summerschool/foods/transFoodsHin.gf deleted file mode 100644 index 21d1d2ac1..000000000 --- a/contrib/summerschool/foods/transFoodsHin.gf +++ /dev/null @@ -1,75 +0,0 @@ --- (c) 2009 Aarne Ranta under LGPL - -concrete FoodsHin of Foods = { - - flags coding=utf8 ; - - param - Gender = Masc | Fem ; - Number = Sg | Pl ; - lincat - Comment = {s : Str} ; - Item = {s : Str ; g : Gender ; n : Number} ; - Kind = {s : Number => Str ; g : Gender} ; - Quality = {s : Gender => Number => Str} ; - lin - Pred item quality = { - s = item.s ++ quality.s ! item.g ! item.n ++ copula item.n - } ; - This kind = {s = "yah" ++ kind.s ! Sg ; g = kind.g ; n = Sg} ; - That kind = {s = "vah" ++ kind.s ! Sg ; g = kind.g ; n = Sg} ; - These kind = {s = "ye" ++ kind.s ! Pl ; g = kind.g ; n = Pl} ; - Those kind = {s = "ve" ++ kind.s ! Pl ; g = kind.g ; n = Pl} ; - Mod quality kind = { - s = \\n => quality.s ! kind.g ! n ++ kind.s ! n ; - g = kind.g - } ; - Wine = regN "madirA" ; - Cheese = regN "panIr" ; - Fish = regN "maClI" ; - Pizza = regN "pijjA" ; - Very quality = {s = \\g,n => "bahut" ++ quality.s ! g ! n} ; - Fresh = regAdj "tAzA" ; - Warm = regAdj "garam" ; - Italian = regAdj "i-t.alI" ; - Expensive = regAdj "mahaNgA" ; - Delicious = regAdj "rucikar" ; - Boring = regAdj "pEriyA" ; - - oper - mkN : Str -> Str -> Gender -> {s : Number => Str ; g : Gender} = - \s,p,g -> { - s = table { - Sg => s ; - Pl => p - } ; - g = g - } ; - - regN : Str -> {s : Number => Str ; g : Gender} = \s -> case s of { - lark + "A" => mkN s (lark + "e") Masc ; - lark + "I" => mkN s (lark + "iyaM") Fem ; - _ => mkN s s Masc - } ; - - mkAdj : Str -> Str -> Str -> {s : Gender => Number => Str} = \ms,mp,f -> { - s = table { - Masc => table { - Sg => ms ; - Pl => mp - } ; - Fem => \\_ => f - } - } ; - - regAdj : Str -> {s : Gender => Number => Str} = \a -> case a of { - acch + "A" => mkAdj a (acch + "e") (acch + "I") ; - _ => mkAdj a a a - } ; - - copula : Number -> Str = \n -> case n of { - Sg => "hE" ; - Pl => "hEN" - } ; - - } diff --git a/contrib/summerschool/mini/Grammar.gf b/contrib/summerschool/mini/Grammar.gf deleted file mode 100644 index ba2db75a2..000000000 --- a/contrib/summerschool/mini/Grammar.gf +++ /dev/null @@ -1,36 +0,0 @@ -abstract Grammar = { - - flags startcat = S ; - - cat - S ; Cl ; NP ; VP ; AP ; CN ; - Det ; N ; A ; V ; V2 ; AdA ; - Tense ; Pol ; - Conj ; - fun - UseCl : Tense -> Pol -> Cl -> S ; - PredVP : NP -> VP -> Cl ; - ComplV2 : V2 -> NP -> VP ; - DetCN : Det -> CN -> NP ; - ModCN : AP -> CN -> CN ; - - CompAP : AP -> VP ; - AdAP : AdA -> AP -> AP ; - - ConjNP : Conj -> NP -> NP -> NP ; - - UseV : V -> VP ; - UseN : N -> CN ; - UseA : A -> AP ; - - a_Det, the_Det : Det ; - this_Det, these_Det : Det ; - that_Det, those_Det : Det ; - i_NP, she_NP, we_NP : NP ; - very_AdA : AdA ; - - Pos, Neg : Pol ; - Pres, Perf : Tense ; - - and_Conj, or_Conj : Conj ; -} diff --git a/contrib/summerschool/mini/GrammarIta.gf b/contrib/summerschool/mini/GrammarIta.gf deleted file mode 100644 index 0663180b8..000000000 --- a/contrib/summerschool/mini/GrammarIta.gf +++ /dev/null @@ -1,137 +0,0 @@ -concrete GrammarIta of Grammar = open ResIta, Prelude in { - lincat - S = {s : Str} ; - Cl = {s : ResIta.Tense => Bool => Str} ; - NP = ResIta.NP ; - -- {s : Case => {clit,obj : Str ; isClit : Bool} ; a : Agr} ; - VP = ResIta.VP ; - -- {v : Verb ; clit : Str ; clitAgr : ClitAgr ; obj : Agr => Str} ; - AP = {s : Gender => Number => Str ; isPre : Bool} ; - CN = Noun ; -- {s : Number => Str ; g : Gender} ; - Det = {s : Gender => Case => Str ; n : Number} ; - N = Noun ; -- {s : Number => Str ; g : Gender} ; - A = Adj ; -- {s : Gender => Number => Str ; isPre : Bool} ; - V = Verb ; -- {s : VForm => Str ; aux : Aux} ; - V2 = Verb ** {c : Case} ; - AdA = {s : Str} ; - Pol = {s : Str ; b : Bool} ; - Tense = {s : Str ; t : ResIta.Tense} ; - Conj = {s : Str ; n : Number} ; - lin - UseCl t p cl = {s = t.s ++ p.s ++ cl.s ! t.t ! p.b} ; - PredVP np vp = - let - subj = (np.s ! Nom).obj ; - obj = vp.obj ! np.a ; - clit = vp.clit ; - verb = table { - Pres => agrV vp.v np.a ; - Perf => agrV (auxVerb vp.v.aux) np.a ++ agrPart vp.v np.a vp.clitAgr - } - in { - s = \\t,b => subj ++ neg b ++ clit ++ verb ! t ++ obj - } ; - - ComplV2 v2 np = - let - nps = np.s ! v2.c - in { - v = {s = v2.s ; aux = v2.aux} ; - clit = nps.clit ; - clitAgr = case <nps.isClit,v2.c> of { - <True,Acc> => CAgr np.a ; - _ => CAgrNo - } ; - obj = \\_ => nps.obj - } ; - - UseV v = { - v = v ; - clit = [] ; - clitAgr = CAgrNo ; - obj = \\_ => [] - } ; - - DetCN det cn = { - s = \\c => { - obj = det.s ! cn.g ! c ++ cn.s ! det.n ; - clit = [] ; - isClit = False - } ; - a = Ag cn.g det.n Per3 - } ; - - ModCN ap cn = { - s = \\n => preOrPost ap.isPre (ap.s ! cn.g ! n) (cn.s ! n) ; - g = cn.g - } ; - - CompAP ap = { - v = essere_V ; - clit = [] ; - clitAgr = CAgrNo ; - obj = \\ag => case ag of { - Ag g n _ => ap.s ! g ! n - } - } ; - - AdAP ada ap = { - s = \\g,n => ada.s ++ ap.s ! g ! n ; - isPre = ap.isPre ; - } ; - - ConjNP co nx ny = { - s = \\c => { - obj = (nx.s ! c).obj ++ co.s ++ (ny.s ! c).obj ; - clit = [] ; - isClit = False - } ; - a = ny.a ; ---- should be conjAgr co.n nx.a ny.a - } ; - - UseN n = n ; - - UseA adj = adj ; - - a_Det = adjDet (mkAdj "un" "una" [] [] True) Sg ; - - the_Det = { - s = table { - Masc => table { - Nom | Acc => elisForms "lo" "l'" "il" ; - Dat => elisForms "allo" "all'" "al" - } ; - Fem => table { - Nom | Acc => elisForms "la" "'l" "la" ; - Dat => elisForms "alla" "all'" "alla" - } - } ; - n = Sg - } ; - - this_Det = adjDet (regAdj "questo") Sg ; - these_Det = adjDet (regAdj "questo") Pl ; - that_Det = adjDet quello_A Sg ; - those_Det = adjDet quello_A Pl ; - - i_NP = pronNP "io" "mi" "mi" Masc Sg Per1 ; - she_NP = pronNP "lei" "la" "le" Fem Sg Per3 ; - we_NP = pronNP "noi" "ci" "ci" Masc Pl Per1 ; - - very_AdA = ss "molto" ; - - Pos = {s = [] ; b = True} ; - Neg = {s = [] ; b = False} ; - Pres = {s = [] ; t = ResIta.Pres} ; - Perf = {s = [] ; t = ResIta.Perf} ; - - and_Conj = {s = "e" ; n = Pl} ; - or_Conj = {s = "o" ; n = Sg} ; - - oper - quello_A : Adj = mkAdj - (elisForms "quello" "quell'" "quel") "quella" - (elisForms "quegli" "quegli" "quei") "quelle" - True ; - -} diff --git a/contrib/summerschool/mini/ParadigmsIta.gf b/contrib/summerschool/mini/ParadigmsIta.gf deleted file mode 100644 index 010140a62..000000000 --- a/contrib/summerschool/mini/ParadigmsIta.gf +++ /dev/null @@ -1,47 +0,0 @@ -resource ParadigmsIta = GrammarIta [N,A,V] ** - open ResIta, GrammarIta, Prelude in { - -oper - masculine : Gender = Masc ; - feminine : Gender = Fem ; - - accusative : Case = Acc ; - dative : Case = Dat ; - - mkN = overload { - mkN : (vino : Str) -> N - = \n -> lin N (regNoun n) ; - mkN : (uomo, uomini : Str) -> Gender -> N - = \s,p,g -> lin N (mkNoun s p g) ; - } ; - - mkA = overload { - mkA : (nero : Str) -> A - = \a -> lin A (regAdj a) ; - mkA : (buono,buona,buoni,buone : Str) -> Bool -> A - = \sm,sf,pm,pf,p -> lin A (mkAdj sm sf pm pf False) ; - } ; - - preA : A -> A - = \a -> lin A {s = a.s ; isPre = True} ; - - mkV = overload { - mkV : (finire : Str) -> V - = \v -> lin V (regVerb v) ; - mkV : (andare,vado,vadi,va,andiamo,andate,vanno,andato : Str) -> V - = \i,p1,p2,p3,p4,p5,p6,p -> lin V (mkVerb i p1 p2 p3 p4 p5 p6 p Avere) ; - } ; - - essereV : V -> V - = \v -> lin V {s = v.s ; aux = Essere} ; - - mkV2 = overload { - mkV2 : Str -> V2 - = \s -> lin V2 (regVerb s ** {c = accusative}) ; - mkV2 : V -> V2 - = \v -> lin V2 (v ** {c = accusative}) ; - mkV2 : V -> Case -> V2 - = \v,c -> lin V2 (v ** {c = c}) ; - } ; - -} diff --git a/contrib/summerschool/mini/ResIta.gf b/contrib/summerschool/mini/ResIta.gf deleted file mode 100644 index f39db69f9..000000000 --- a/contrib/summerschool/mini/ResIta.gf +++ /dev/null @@ -1,178 +0,0 @@ -resource ResIta = open Prelude in { - --- parameters - -param - Number = Sg | Pl ; - Gender = Masc | Fem ; - Case = Nom | Acc | Dat ; - Agr = Ag Gender Number Person ; - Aux = Avere | Essere ; - Tense = Pres | Perf ; - Person = Per1 | Per2 | Per3 ; - - VForm = VInf | VPres Number Person | VPart Gender Number ; - - ClitAgr = CAgrNo | CAgr Agr ; - --- parts of speech - -oper - VP = { - v : Verb ; - clit : Str ; - clitAgr : ClitAgr ; - obj : Agr => Str - } ; - NP = { - s : Case => {clit,obj : Str ; isClit : Bool} ; - a : Agr - } ; - --- the preposition word of an abstract case - - prepCase : Case -> Str = \c -> case c of { - Dat => "a" ; - _ => [] - } ; - --- for predication - - agrV : Verb -> Agr -> Str = \v,a -> case a of { - Ag _ n p => v.s ! VPres n p - } ; - - auxVerb : Aux -> Verb = \a -> case a of { - Avere => - mkVerb "avere" "ho" "hai" "ha" "abbiamo" "avete" "hanno" "avuto" Avere ; - Essere => - mkVerb "essere" "sono" "sei" "" "siamo" "siete" "sono" "stato" Essere - } ; - - agrPart : Verb -> Agr -> ClitAgr -> Str = \v,a,c -> case v.aux of { - Avere => case c of { - CAgr (Ag g n _) => v.s ! VPart g n ; - _ => v.s ! VPart Masc Sg - } ; - Essere => case a of { - Ag g n _ => v.s ! VPart g n - } - } ; - - neg : Bool -> Str = \b -> case b of {True => [] ; False => "non"} ; - - essere_V = auxVerb Essere ; - --- for coordination - - conjAgr : Number -> Agr -> Agr -> Agr = \n,xa,ya -> - let - x = agrFeatures xa ; y = agrFeatures ya - in Ag - (conjGender x.g y.g) - (conjNumber (conjNumber x.n y.n) n) - (conjPerson x.p y.p) ; - - agrFeatures : Agr -> {g : Gender ; n : Number ; p : Person} = \a -> - case a of {Ag g n p => {g = g ; n = n ; p = p}} ; - - conjGender : Gender -> Gender -> Gender = \g,h -> - case g of {Masc => Masc ; _ => h} ; - - conjNumber : Number -> Number -> Number = \m,n -> - case m of {Pl => Pl ; _ => n} ; - - conjPerson : Person -> Person -> Person = \p,q -> - case <p,q> of { - <Per1,_> | <_,Per1> => Per1 ; - <Per2,_> | <_,Per2> => Per2 ; - _ => Per3 - } ; - - - --- for morphology - - Noun : Type = {s : Number => Str ; g : Gender} ; - Adj : Type = {s : Gender => Number => Str ; isPre : Bool} ; - Verb : Type = {s : VForm => Str ; aux : Aux} ; - - mkNoun : Str -> Str -> Gender -> Noun = \vino,vini,g -> { - s = table {Sg => vino ; Pl => vini} ; - g = g - } ; - - regNoun : Str -> Noun = \vino -> case vino of { - fuo + c@("c"|"g") + "o" => mkNoun vino (fuo + c + "hi") Masc ; - ol + "io" => mkNoun vino (ol + "i") Masc ; - vin + "o" => mkNoun vino (vin + "i") Masc ; - cas + "a" => mkNoun vino (cas + "e") Fem ; - pan + "e" => mkNoun vino (pan + "i") Masc ; - _ => mkNoun vino vino Masc - } ; - - mkAdj : (_,_,_,_ : Str) -> Bool -> Adj = \buono,buona,buoni,buone,p -> { - s = table { - Masc => table {Sg => buono ; Pl => buoni} ; - Fem => table {Sg => buona ; Pl => buone} - } ; - isPre = p - } ; - - regAdj : Str -> Adj = \nero -> case nero of { - ner + "o" => mkAdj nero (ner + "a") (ner + "i") (ner + "e") False ; - verd + "e" => mkAdj nero nero (verd + "i") (verd + "i") False ; - _ => mkAdj nero nero nero nero False - } ; - - mkVerb : (_,_,_,_,_,_,_,_ : Str) -> Aux -> Verb = - \amare,amo,ami,ama,amiamo,amate,amano,amato,aux -> { - s = table { - VInf => amare ; - VPres Sg Per1 => amo ; - VPres Sg Per2 => ami ; - VPres Sg Per3 => ama ; - VPres Pl Per1 => amiamo ; - VPres Pl Per2 => amate ; - VPres Pl Per3 => amano ; - VPart g n => (regAdj amato).s ! g ! n - } ; - aux = aux - } ; - - regVerb : Str -> Verb = \amare -> case amare of { - am + "are" => mkVerb amare (am+"o") (am+"i") (am+"a") - (am+"iamo") (am+"ate") (am+"ano") (am+"ato") Avere ; - tem + "ere" => mkVerb amare (tem+"o") (tem+"i") (tem+"e") - (tem+"iamo") (tem+"ete") (tem+"ono") (tem+"uto") Avere ; - fin + "ire" => mkVerb amare (fin+"isco") (fin+"isci") (fin+"isce") - (fin+"iamo") (fin+"ite") (fin+"iscono") (fin+"ito") Avere - } ; - --- for structural words - - adjDet : Adj -> Number -> {s : Gender => Case => Str ; n : Number} = - \adj,n -> { - s = \\g,c => prepCase c ++ adj.s ! g ! n ; - n = n - } ; - - pronNP : (s,a,d : Str) -> Gender -> Number -> Person -> NP = - \s,a,d,g,n,p -> { - s = table { - Nom => {clit = [] ; obj = s ; isClit = False} ; - Acc => {clit = a ; obj = [] ; isClit = True} ; - Dat => {clit = d ; obj = [] ; isClit = True} - } ; - a = Ag g n p - } ; - --- phonological auxiliaries - - vowel : pattern Str = #("a" | "e" | "i" | "o" | "u" | "h") ; - s_impuro : pattern Str = #("z" | "s" + ("b"|"c"|"d"|"f"|"m"|"p"|"q"|"t")) ; - - elisForms : (_,_,_ : Str) -> Str = \lo,l',il -> - pre {#s_impuro => lo ; #vowel => l' ; _ => il} ; - -} diff --git a/contrib/summerschool/mini/Syntax.gf b/contrib/summerschool/mini/Syntax.gf deleted file mode 100644 index 0941f9600..000000000 --- a/contrib/summerschool/mini/Syntax.gf +++ /dev/null @@ -1,45 +0,0 @@ -interface Syntax = Grammar - - [UseCl,PredVP,ComplV2,UseV,DetCN,ModCN,CompAP,AdAP, - UseN,UseA,Pres,Perf,Pos,Neg] ** - open Grammar in { - -oper - mkS = overload { - mkS : Cl -> S = UseCl Pres Pos ; - mkS : Tense -> Cl -> S = \t -> UseCl t Pos ; - mkS : Pol -> Cl -> S = UseCl Pres ; - mkS : Tense -> Pol -> Cl -> S = UseCl ; - } ; - - mkCl = overload { - mkCl : NP -> V -> Cl = \np,v -> PredVP np (UseV v) ; - mkCl : NP -> V2 -> NP -> Cl = \np,v,o -> PredVP np (ComplV2 v o) ; - mkCl : NP -> A -> Cl = \np,a -> PredVP np (CompAP (UseA a)) ; - mkCl : NP -> AP -> Cl = \np,ap -> PredVP np (CompAP ap) ; - mkCl : NP -> VP -> Cl = PredVP ; - } ; - - mkAP = overload { - mkAP : A -> AP = UseA ; - mkAP : AdA -> AP -> AP = AdAP ; - } ; - - mkNP = overload { - mkNP : Det -> N -> NP = \d,n -> DetCN d (UseN n) ; - mkNP : Det -> CN -> NP = \d,n -> DetCN d n ; - } ; - - mkCN = overload { - mkCN : N -> CN = UseN ; - mkCN : A -> N -> CN = \a,n -> ModCN (UseA a) (UseN n) ; - mkCN : A -> CN -> CN = \a,n -> ModCN (UseA a) n ; - mkCN : AP -> N -> CN = \a,n -> ModCN a (UseN n) ; - mkCN : AP -> CN -> CN = \a,n -> ModCN a n ; - } ; - - presTense : Tense = Pres ; - perfTense : Tense = Perf ; - posPol : Pol = Pos ; - negPol : Pol = Neg ; - -} diff --git a/contrib/summerschool/mini/SyntaxIta.gf b/contrib/summerschool/mini/SyntaxIta.gf deleted file mode 100644 index b4562b0de..000000000 --- a/contrib/summerschool/mini/SyntaxIta.gf +++ /dev/null @@ -1,3 +0,0 @@ -instance SyntaxIta of Syntax = GrammarIta - - [PredVP,ComplV2,UseV,DetCN,ModCN,CompAP,AdAP,UseN,UseA] ** - open GrammarIta in {} ; diff --git a/contrib/summerschool/mini/Test.gf b/contrib/summerschool/mini/Test.gf deleted file mode 100644 index ebe55e7e0..000000000 --- a/contrib/summerschool/mini/Test.gf +++ /dev/null @@ -1,9 +0,0 @@ -abstract Test = Grammar ** { - -fun - man_N, woman_N, house_N, tree_N : N ; - big_A, small_A, green_A : A ; - walk_V, arrive_V : V ; - love_V2, please_V2 : V2 ; - -} ; diff --git a/contrib/summerschool/mini/TestIta.gf b/contrib/summerschool/mini/TestIta.gf deleted file mode 100644 index 8ae524371..000000000 --- a/contrib/summerschool/mini/TestIta.gf +++ /dev/null @@ -1,17 +0,0 @@ -concrete TestIta of Test = GrammarIta ** open ParadigmsIta in { - -lin - man_N = mkN "uomo" "uomini" masculine ; - woman_N = mkN "donna" ; - house_N = mkN "casa" ; - tree_N = mkN "albero" ; - big_A = preA (mkA "grande") ; - small_A = preA (mkA "piccolo") ; - green_A = mkA "verde" ; - walk_V = mkV "camminare" ; - arrive_V = essereV (mkV "arrivare") ; - love_V2 = mkV2 "amare" ; - please_V2 = mkV2 (essereV (mkV "piacere" "piaccio" "piaci" "piace" - "piacciamo" "piacete" "piacciono" "piaciuto")) dative ; - -} ; |
