diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..94e6cb952 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +dist/ +*.gfo +*.hi +*.o +*.pgf diff --git a/Make.bat b/Make.bat new file mode 100644 index 000000000..63c6a410f --- /dev/null +++ b/Make.bat @@ -0,0 +1,8 @@ +REM Non-Haskell RGL build script for Windows machines +@ECHO OFF + +REM Prelude + +REM Present + +REM All tenses diff --git a/Make.hs b/Make.hs new file mode 100644 index 000000000..fba736c30 --- /dev/null +++ b/Make.hs @@ -0,0 +1,434 @@ +import Data.List (find,intersect,isPrefixOf) +import Data.Maybe (fromJust,isJust,catMaybes) +import System.IO (hPutStrLn,stderr) +import System.IO.Error (catchIOError) +import System.Exit (ExitCode(..),die) +import System.Environment (getArgs,lookupEnv) +import System.Process (rawSystem,readProcess) +import System.FilePath ((),(<.>)) +import System.Directory (createDirectoryIfMissing,copyFile,getDirectoryContents,removeDirectoryRecursive) +import Control.Monad (unless,when) + +main :: IO () +main = do + aargs <- getArgs + case aargs of + [] -> putStrLn $ "Must specify command, one of: " ++ unwords commands + a:_ | a `notElem` commands -> putStrLn $ "Unknown command: " ++ a ++ " (valid commands: " ++ unwords commands ++ ")" + "build":args -> buildRGL args + "copy":args -> copyRGL args + "install":args -> buildRGL args >> copyRGL args + "clean":_ -> clean + where + commands = ["build","copy","install","clean"] + +-- | Build grammars into dist +buildRGL :: [String] -> IO () +buildRGL args = do + checkArgs args + let cmds = getRGLCommands args + let modes = getOptMode args + info <- mkInfo + mapM_ (\cmd -> cmdAction cmd modes args info) cmds + +-- | Copy from dist to install location +copyRGL :: [String] -> IO () +copyRGL args = do + let modes = getOptMode args + info <- mkInfo + gf_lib_dir <- maybe (die errLocation) return (infoInstallDir info) + copyAll "prelude" (infoBuildDir info "prelude") (gf_lib_dir "prelude") + sequence_ [copyAll (show mode) (getRGLBuildDir info mode) (gf_lib_dir getRGLBuildSubDir mode)|mode<-modes] + +-- | Error message when install location cannot be determined +errLocation :: String +errLocation = unlines $ + [ "Unable to determine where to install the RGL. Please do one of the following:" + , " - Pass the " ++ destination_flag ++ "... flag to this script" + , " - Set the GF_LIB_PATH environment variable" + , " - Compile & install GF from the gf-core repository (must be in same directory as gf-rgl)" + ] + +-- | Copy all files between directories +copyAll :: String -> FilePath -> FilePath -> IO () +copyAll msg from to = do + putStrLn $ "Installing [" ++ msg ++ "] " ++ to + createDirectoryIfMissing True to + mapM_ (\file -> when (file /= "." && file /= "..") $ copyFile (from file) (to file)) =<< getDirectoryContents from + +-- | Remove dist directory +clean :: IO () +clean = do + info <- mkInfo + removeDirectoryRecursive (infoBuildDir info) + +-- | Flag for specifying languages +-- '=' can optionally be followed by '+' or '-' to alter the default languages +lang_flag :: String +lang_flag = "--langs=" + +-- | Flag for specifying gf location +gf_flag :: String +gf_flag = "--gf=" + +-- | Flag for specifying RGL install location +destination_flag :: String +destination_flag = "--dest=" + +-- | Check arguments are valid +checkArgs :: [String] -> IO () +checkArgs args = do + let args' = flip filter args (\arg -> not + ( arg `elem` (map cmdName rglCommands) + || arg `elem` all_modes + || lang_flag `isPrefixOf` arg + || gf_flag `isPrefixOf` arg + || destination_flag `isPrefixOf` arg + )) + unless (null args') $ die $ "Unrecognised flags: " ++ unwords args' + return () + +-- | List of languages overriding the definitions below +getOptLangs :: [LangInfo] -> [String] -> [LangInfo] +getOptLangs defaultLangs args = + case [ls | arg <- args, + let (f,ls) = splitAt (length lang_flag) arg, + f==lang_flag] of + ('+':ls):_ -> foldr addLang defaultLangs (seps ls) + ('-':ls):_ -> foldr removeLang defaultLangs (seps ls) + ls:_ -> findLangs langs (seps ls) + _ -> defaultLangs + where + seps = words . map (\c -> if c==',' then ' ' else c) + findLangs langs ls = [lang | lang <- langs, langCode lang `elem` ls] + removeLang l ls = [lang | lang <- ls, langCode lang /= l] + addLang l ls = if null (findLangs ls [l]) + then findLangs langs [l]++ls + else ls + +-- | Get flag value from list of args +getFlag :: String -> [String] -> Maybe String +getFlag flag args = fmap (drop (length flag)) $ find (isPrefixOf flag) args + +------------------------------------------------------------------------------- +-- Paths and directories + +-- | RGL source directory +sourceDir :: FilePath +sourceDir = "src" + +-- | Information needed in build +data Info = Info + { infoBuildDir :: FilePath -- ^ where to put built RGL modules (fixed) + , infoInstallDir :: Maybe FilePath -- ^ install directory (found dynamically) + , infoGFPath :: FilePath -- ^ path to GF + } + +-- | Build info object from command line args +mkInfo :: IO Info +mkInfo = do + args <- getArgs + + -- Look for install location in a few different places + let mflag = getFlag destination_flag args + mbuilt <- catchIOError (readFile "../gf-core/DATA_DIR" >>= \d -> return (Just (d "lib"))) (\e -> return Nothing) + menvar <- lookupEnv "GF_LIB_PATH" + let + inst_dir = + case catMaybes [mflag,menvar,mbuilt] of + [] -> Nothing + p:_ -> Just p + + return $ Info + { infoBuildDir = "dist" + , infoInstallDir = inst_dir + , infoGFPath = maybe default_gf id (getFlag gf_flag args) + } + where + default_gf = "gf" + +getRGLBuildDir :: Info -> Mode -> FilePath +getRGLBuildDir info mode = infoBuildDir info getRGLBuildSubDir mode + +getRGLBuildSubDir :: Mode -> String +getRGLBuildSubDir mode = + case mode of + AllTenses -> "alltenses" + Present -> "present" + +------------------------------------------------------------------------------- +-- Build modes + +data Mode = AllTenses | Present + deriving (Show) + +all_modes :: [String] +all_modes = ["alltenses","present"] + +default_modes :: [Mode] +default_modes = [AllTenses,Present] + +-- | An RGL build command +data RGLCommand = RGLCommand + { cmdName :: String -- ^ name of command + , cmdIsDef :: Bool -- ^ is default? + , cmdAction :: [Mode] -> [String] -> Info -> IO () -- ^ action + } + +-- | Possible build commands +rglCommands :: [RGLCommand] +rglCommands = + [ RGLCommand "prelude" True $ \mode args bi -> do + putStrLn $ "Compiling [prelude]" + let prelude_src_dir = sourceDir "prelude" + prelude_dst_dir = infoBuildDir bi "prelude" + createDirectoryIfMissing True prelude_dst_dir + files <- getDirectoryContents prelude_src_dir + run_gfc bi (["-s", "--gfo-dir="++prelude_dst_dir] ++ [prelude_src_dir file | file <- files, file /= "." && file /= ".."]) + + , RGLCommand "all" True $ gfcp [l,s,c,t,sc] + , RGLCommand "lang" False $ gfcp [l,s] + , RGLCommand "api" False $ gfcp [t,sc] + , RGLCommand "compat" False $ gfcp [c] + + , RGLCommand "pgf" False $ \modes args bi -> + parallel_ [ + do let dir = getRGLBuildDir bi mode + createDirectoryIfMissing True dir + sequence_ [run_gfc bi ["-s","-make","-name=Lang"++la, + dir ++ "/Lang" ++ la ++ ".gfo"] + | l <- optl langsPGF args, let la = langCode l] + run_gfc bi (["-s","-make","-name=Lang"]++ + ["Lang" ++ langCode l ++ ".pgf"|l <- optl langsPGF args]) + | mode <- modes] + + , RGLCommand "parse" False $ \modes args bi -> + gfc bi modes (summary parse) (map parse (optl langsParse args)) + ] + where + gfcp :: [Mode -> [String] -> (LangInfo -> FilePath,[LangInfo])] -> [Mode] -> [String] -> Info -> IO () + gfcp cs modes args bi = parallel_ [gfcp' bi mode args cs | mode <- modes] + + gfcp' :: Info -> Mode -> [String] -> [Mode -> [String] -> (LangInfo -> FilePath,[LangInfo])] -> IO () + gfcp' bi mode args cs = gfcn bi mode (unwords ss) (concat fss) + where (ss,fss) = unzip [(summary f,map f as)|c<-cs,let (f,as)=c mode args] + + summary :: (LangInfo -> FilePath) -> FilePath + summary f = f (LangInfo "*" "*" Nothing Nothing) + + l mode args = (lang,optml mode langsLang args) + s mode args = (symbol,optml mode langsAPI args) + c mode args = (compat,optl langsCompat args) + t mode args = (try,optml mode langsAPI args) + sc mode args = (symbolic,optml mode langsSymbolic args) + + optl :: [LangInfo] -> [String] -> [LangInfo] + optl = optml AllTenses + + optml :: Mode -> [LangInfo] -> [String] -> [LangInfo] + optml mode ls args = getOptLangs (shrink ls) args + where + shrink = case mode of + Present -> intersect langsPresent + _ -> id + +-- | Get mode from args (may be missing) +getOptMode :: [String] -> [Mode] +getOptMode args = + if null explicit_modes + then default_modes + else explicit_modes + where + explicit_modes = + [Present|have "present"]++ + [AllTenses|have "alltenses"] + have mode = mode `elem` args + +-- | Get RGL command from args +getRGLCommands :: [String] -> [RGLCommand] +getRGLCommands args = + let cmds0 = [cmd | arg <- args, + cmd <- rglCommands, + cmdName cmd == arg] + in if null cmds0 + then [cmd | cmd <- rglCommands, cmdIsDef cmd] + else cmds0 + +------------------------------------------------------------------------------- +-- Languages of the RGL + +-- | Information about a language +data LangInfo = LangInfo + { langCode :: String -- ^ 3-letter ISO 639-2/B code + , langDir :: String -- ^ directory name + , langFunctor :: Maybe String -- ^ functor (not used) + , langUnlexer :: Maybe String -- ^ decoding for postprocessing linearizations + } deriving (Eq) + +-- | List of all languages known to RGL +langs :: [LangInfo] +langs = + [ LangInfo "Afr" "afrikaans" Nothing Nothing + , LangInfo "Amh" "amharic" Nothing Nothing + , LangInfo "Ara" "arabic" Nothing Nothing + , LangInfo "Eus" "basque" Nothing Nothing + , LangInfo "Bul" "bulgarian" Nothing Nothing + , LangInfo "Cat" "catalan" (Just "Romance") Nothing + , LangInfo "Chi" "chinese" Nothing Nothing + , LangInfo "Dan" "danish" (Just "Scand") Nothing + , LangInfo "Dut" "dutch" Nothing Nothing + , LangInfo "Eng" "english" Nothing Nothing + , LangInfo "Est" "estonian" Nothing Nothing + , LangInfo "Fin" "finnish" Nothing Nothing + , LangInfo "Fre" "french" (Just "Romance") Nothing + , LangInfo "Grc" "ancient_greek" Nothing Nothing + , LangInfo "Gre" "greek" Nothing Nothing + , LangInfo "Heb" "hebrew" Nothing Nothing + , LangInfo "Hin" "hindi" (Just "Hindustani") (Just "to_devanagari") + , LangInfo "Ger" "german" Nothing Nothing + , LangInfo "Ice" "icelandic" Nothing Nothing + , LangInfo "Ina" "interlingua" Nothing Nothing + , LangInfo "Ita" "italian" (Just "Romance") Nothing + , LangInfo "Jpn" "japanese" Nothing Nothing + , LangInfo "Lat" "latin" Nothing Nothing + , LangInfo "Lav" "latvian" Nothing Nothing + , LangInfo "Mlt" "maltese" Nothing Nothing + , LangInfo "Mon" "mongolian" Nothing Nothing + , LangInfo "Nep" "nepali" Nothing Nothing + , LangInfo "Nor" "norwegian" (Just "Scand") Nothing + , LangInfo "Nno" "nynorsk" Nothing Nothing + , LangInfo "Pes" "persian" Nothing Nothing + , LangInfo "Pol" "polish" Nothing Nothing + , LangInfo "Por" "portuguese" (Just "Romance") Nothing + , LangInfo "Pnb" "punjabi" Nothing Nothing + , LangInfo "Ron" "romanian" Nothing Nothing + , LangInfo "Rus" "russian" Nothing Nothing + , LangInfo "Snd" "sindhi" Nothing Nothing + , LangInfo "Spa" "spanish" (Just "Romance") Nothing + , LangInfo "Swe" "swedish" (Just "Scand") Nothing + , LangInfo "Tha" "thai" Nothing (Just "to_thai") + , LangInfo "Tur" "turkish" Nothing Nothing + , LangInfo "Urd" "urdu" (Just "Hindustani") Nothing + ] + +-- | Languagues for which to compile Lang +langsLang :: [LangInfo] +langsLang = langs + +-- | Languages that have notpresent marked +langsPresent :: [LangInfo] +langsPresent = langsLang `except` ["Afr","Chi","Eus","Gre","Heb","Ice","Jpn","Mlt","Mon","Nep","Pes","Snd","Tha","Thb","Est"] + +-- | Languages for which to compile Try +langsAPI :: [LangInfo] +langsAPI = langsLang `except` langsIncomplete + +-- | Languages which compile but which are incomplete +langsIncomplete :: [String] +langsIncomplete = ["Amh","Ara","Grc","Heb","Ina","Lat","Tur"] + +-- | Languages for which to compile Symbolic +langsSymbolic :: [LangInfo] +langsSymbolic = langsAPI `except` ["Afr","Ice","Mon","Nep"] + +-- | Languages for which to compile parsing grammars +langsParse :: [LangInfo] +langsParse = langs `only` ["Eng"] + +-- | Languages for which langs.pgf is built +langsPGF :: [LangInfo] +langsPGF = langsLang `except` ["Ara","Hin","Ron","Tha"] + +-- | Languages for which Compatibility exists (to be extended) +langsCompat :: [LangInfo] +langsCompat = langsLang `only` ["Cat","Eng","Fin","Fre","Ita","Lav","Spa","Swe"] + +-- | Exclude langs from list by code +except :: [LangInfo] -> [String] -> [LangInfo] +except ls es = filter (flip notElem es . langCode) ls + +-- | Only specified langs by code +only :: [LangInfo] -> [String] -> [LangInfo] +only ls es = filter (flip elem es . langCode) ls + +------------------------------------------------------------------------------- +-- Getting module paths/names + +lang :: LangInfo -> FilePath +lang l = sourceDir langDir l ("All" ++ langCode l ++ ".gf") + +compat :: LangInfo -> FilePath +compat l = sourceDir langDir l ("Compatibility" ++ langCode l ++ ".gf") + +symbol :: LangInfo -> FilePath +symbol l = sourceDir langDir l ("Symbol" ++ langCode l ++ ".gf") + +try :: LangInfo -> FilePath +try l = sourceDir "api" ("Try" ++ langCode l ++ ".gf") + +syntax :: LangInfo -> FilePath +syntax l = sourceDir "api" ("Syntax" ++ langCode l ++ ".gf") + +symbolic :: LangInfo -> FilePath +symbolic l = sourceDir "api" ("Symbolic" ++ langCode l ++ ".gf") + +parse :: LangInfo -> FilePath +parse l = sourceDir "parse" ("Parse" ++ langCode l ++ ".gf") + +-- | Get unlexer flags for languages +unlexer :: String -> [LangInfo] -> String +unlexer abstr ls = + "-unlexer=\\\"" ++ unwords + [ abstr ++ langCode lang ++ "=" ++ fromJust unl + | lang <- ls + , let unl = langUnlexer lang + , isJust unl] ++ "\\\"" + +------------------------------------------------------------------------------- +-- Executing GF + +gfc :: Info -> [Mode] -> String -> [String] -> IO () +gfc bi modes summary files = + parallel_ [gfcn bi mode summary files | mode<-modes] + +gfcn :: Info -> Mode -> String -> [String] -> IO () +gfcn bi mode summary files = do + let dir = getRGLBuildDir bi mode + preproc = case mode of + AllTenses -> "" + Present -> "-preproc=mkPresent" + createDirectoryIfMissing True dir + putStrLn $ "Compiling [" ++ show mode ++ "] " ++ summary + run_gfc bi (["-s", "-no-pmcfg", preproc, "--gfo-dir="++dir] ++ files) + +-- | Runs the gf executable in compile mode with the given arguments +run_gfc :: Info -> [String] -> IO () +run_gfc bi args = do + let + args' = ["-batch","-gf-lib-path="++sourceDir] ++ filter (not . null) args + gf = infoGFPath bi + execute gf args' + +-- | Run an arbitrary system command +execute :: String -> [String] -> IO () +execute command args = do + let cmdline = command ++ " " ++ unwords (map showArg args) + e <- rawSystem command args + case e of + ExitSuccess -> return () + ExitFailure i -> do + putStrLn $ "Ran: " ++ cmdline + die $ command ++ " exited with exit code: " ++ show i + where + showArg arg = if ' ' `elem` arg then "'" ++ arg ++ "'" else arg + +-- | For parallel RGL module compilation +-- Unfortunately, this has no effect unless compiled with -threaded +parallel_ :: (Foldable t, Monad m) => t (m a) -> m () +parallel_ ms = sequence_ ms + -- do c <- newChan + -- ts <- sequence [ forkIO (m >> writeChan c ()) | m <- ms] + -- sequence_ [readChan c | _ <- ts] + +putErrLn :: String -> IO () +putErrLn = hPutStrLn stderr diff --git a/Make.sh b/Make.sh new file mode 100755 index 000000000..c46cbdc9d --- /dev/null +++ b/Make.sh @@ -0,0 +1,70 @@ +#!/bin/sh + +# Non-Haskell RGL build script for Unix-based machines + +modules_langs="All Symbol Compatibility" +modules_api="Try Symbolic" + +# Defaults (may be overridden by options) +gf="gf" +dest="" + +# Check command line options +for arg in "$@"; do + case $arg in + --gf=*) + gf="${arg#*=}"; shift ;; + --dest=*) + dest="${arg#*=}"; shift ;; + *) echo "Unknown option: ${arg}" ; exit 1 ;; + esac +done + +# Try to determine install location +if [ -z "$dest" ]; then + dest="$GF_LIB_PATH" +fi +if [ -z "$dest" ] && [ -f "../gf-core/DATA_DIR" ]; then + dest=`cat ../gf-core/DATA_DIR` + if [ -n "$dest" ]; then dest="${dest}/lib"; fi +fi +if [ -z "$dest" ]; then + echo "Unable to determine where to install the RGL. Please do one of the following:" + echo " - Pass the --dest=... flag to this script" + echo " - Set the GF_LIB_PATH environment variable" + echo " - Compile & install GF from the gf-core repository (must be in same directory as gf-rgl)" + exit 1 +fi + +# A few more definitions before we get started +src="src" +dist="dist" +gfc="${gf} -batch -gf-lib-path=${src} -s " + +# Make directories if not present +mkdir -p "${dist}/prelude" +mkdir -p "${dist}/present" +mkdir -p "${dist}/alltenses" + +# Build: prelude +${gfc} --gfo-dir="${dist}"/prelude "${src}"/prelude/*.gf + +# Gather all language modules for building +modules="" +for mod in $modules_langs; do + res=`find "${src}"/* -type f -name "${mod}???.gf"` + modules="${modules} $res" +done +for mod in $modules_api; do + res=`find "${src}"/api -type f -name "${mod}???.gf"` + modules="${modules} $res" +done + +# Build: present +${gfc} -no-pmcfg --gfo-dir="${dist}"/present -preproc=mkPresent "${modules}" + +# Build: alltenses +${gfc} -no-pmcfg --gfo-dir="${dist}"/alltenses "${modules}" + +# Install +cp -R ${dist}/* ${dest} diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..7fbc22f5a --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +# A simple wrapper over the Haskell-based RGL build script + +RUNMAKE=runghc Make.hs + +.PHONY: build copy install clean + +default: build copy + +build: src/*/*.gf + $(RUNMAKE) build + +copy: + $(RUNMAKE) copy + +install: build copy + +clean: + $(RUNMAKE) clean diff --git a/README.md b/README.md new file mode 100644 index 000000000..4db4207fe --- /dev/null +++ b/README.md @@ -0,0 +1,67 @@ +# GF's Resource Grammar Library (RGL) + +The contents of this repository have been split from the original monolithic GF repository here: + +## Requirements + +In order to build the RGL, you will need: +- GF installed on your system +- Haskell + +A method for building the RGL without Haskell is in the works. + +## Basic usage + +If you have `make`, you can compile the RGL and install it to the default location (see note below) with: + +``` +make install +``` + +This is the same as `make build` followed by `make copy`. +There is also `make clean` available. + +### Install location + +The install script will try to determine where to copy the compiled RGL modules. +It will look for, in this order: +- the `--dest=` flag (see below) +- the `GF_LIB_PATH` environment variable +- the file `../gf-core/GF_LIB_PATH` (relative to this directory). This only works if you have the `gf-core` and `gf-rgl` repositories in the same top-level directory **and** you have already compiled GF from source. +(This is considered messy and will probably disappead in the future) + +## Advanced + +For more fine-grained control over the build process, you can run the build script directly: + +``` +runghc Make.hs ... +``` + +Where `...` is one of: +``` +build [CMD] [MODE] [--langs=[+|-]LANG,LANG,...] [--gf=...] +copy [--dest=...] +install [CMD] [MODE] [--langs=[+|-]LANG,LANG,...] [--gf=...] [--dest=...] +clean +``` + +- `CMD` is one of: +`prelude`, +`all`, +`lang`, +`api`, +`compat`, +`pgf`, +`parse` +(default is `all`) +- `MODE` is one of: +`present`, +`alltenses` +(default is both) +- You can _override_ the default language list with `--langs=...` +- You can _add_ languages to the default list with `--langs=+...` +- You can _remove_ languages from the default list with `langs=-...` +- `LANG` is a 3-letter language code, e.g. `Eng`, `Swe` etc. +- The path to GF installed on your system can be specified via the `gf` flag (default is that the `gf` executable is in the global system path). +- The `to` flag can be used to manually specify where the compiled RGL modules should be copied/installed. This is the same place as `GF_LIB_PATH`. diff --git a/src/mkPresent b/mkPresent similarity index 100% rename from src/mkPresent rename to mkPresent diff --git a/src/Makefile b/src/Makefile deleted file mode 100644 index a3fea1b98..000000000 --- a/src/Makefile +++ /dev/null @@ -1,56 +0,0 @@ -RUNGHC=runghc - -dict: DictBul DictEng DictEst DictFin DictFre DictRus DictGer DictSwe - -initdict: - @mkdir -p ../dict/ - -DictBul: initdict - gf -batch bulgarian/DictBul.gf +RTS -K100M - cp -p bulgarian/DictBul*.gfo ../dict/ - -DictEng: initdict - gf -batch english/DictEng.gf +RTS -K100M - cp -p english/DictEng*.gfo ../dict - -DictEst: initdict - gf -batch estonian/DictEst.gf +RTS -K200M - cp -p estonian/DictEst*.gfo ../dict - -DictFin: initdict - gf -batch finnish/DictFin.gf +RTS -K100M - cp -p finnish/DictFin*.gfo ../dict - -DictFre: initdict - -gf -batch french/DictFre.gf +RTS -K100M - -cp -p french/DictFre*.gfo ../dict - -DictGer: initdict - gf -batch german/DictGer.gf +RTS -K100M - cp -p german/DictGer*.gfo ../dict - -DictRus: initdict - gf -batch russian/DictRus.gf +RTS -K200M - cp -p russian/DictRus*.gfo ../dict - -DictSwe: initdict - gf -batch swedish/DictSwe.gf +RTS -K100M - cp -p swedish/DictSwe*.gfo ../dict - -GFMKD=gf -s -batch -make -literal=PN -gfo-dir ../dict -DictBul.pgf: initdict ; $(GFMKD) -name=DictBul bulgarian/DictBul.gf +RTS -K100M -DictEng.pgf: initdict ; $(GFMKD) -name=DictEng english/DictEng.gf +RTS -K100M -DictEst.pgf: initdict ; $(GFMKD) -name=DictEst estonian/DictEst.gf +RTS -K200M -DictFin.pgf: initdict ; $(GFMKD) -name=DictFin finnish/DictFin.gf +RTS -K100M -DictFre.pgf: initdict ; -$(GFMKD) -name=DictFre french/DictFre.gf +RTS -K100M -DictGer.pgf: initdict ; $(GFMKD) -name=DictGer german/DictGer.gf +RTS -K100M -DictHin.pgf: initdict ; -$(GFMKD) -name=DictHin hindi/DictHinWSJ.gf +RTS -K100M -DictMlt.pgf: initdict ; $(GFMKD) -name=DictMlt maltese/DictMlt.gf +RTS -K100M -DictRus.pgf: initdict ; $(GFMKD) -name=DictRus russian/DictRus.gf +RTS -K200M -DictSwe.pgf: initdict ; $(GFMKD) -name=DictSwe swedish/DictSwe.gf +RTS -K100M -DictTur.pgf: initdict ; $(GFMKD) -name=DictTur turkish/DictTur.gf +RTS -K100M -DictUrd.pgf: initdict ; $(GFMKD) -name=DictUrd urdu/DictUrd.gf +RTS -K100M - -# thai with pronunciation -thp: - cd thai ; runghc ThaiScript.hs ; cd .. diff --git a/src/old-demo/Demo.gf b/src/old-demo/Demo.gf deleted file mode 100644 index e8226f285..000000000 --- a/src/old-demo/Demo.gf +++ /dev/null @@ -1,30 +0,0 @@ -abstract Demo = - Lang - [ - PredetNP, PPartNP, AdvNP, RelNP, DetNP, DetQuantOrd, - NumDigits, AdNum, OrdDigits, OrdNumeral, OrdSuperl, MassNP, - ComplN2, ComplN3, UseN2, Use2N3, Use3N3, AdjCN, RelCN, - AdvCN, SentCN, ApposCN, - PassV2, CompAdv, - -- CompNP, - SlashV2V, SlashV2VNP, --- - ComparA, ComplA2, ReflA2, UseA2, UseComparA, CAdvAP, AdjOrd, SentAP, AdAP, - PredSCVP, AdvSlash, SlashPrep, SlashVS, - EmbedS, EmbedQS, EmbedVP, UseSlash, AdvS, RelS, - CompIP, - PConjConj, VocNP, UttVP, - FunRP, - nothing_NP, nobody_NP, please_Voc, otherwise_PConj, therefore_PConj, but_PConj, - language_title_Utt, whatPl_IP, whoPl_IP, if_then_Conj, either7or_DConj, - both7and_DConj, much_Det, that_Subj, no_Quant, - ImpersCl, GenericCl, CleftNP, CleftAdv, ProgrVP, ImpPl1, ImpP3, - -- ExistNP, --- - ConsNP, ConsAdv, ConsS, ConsRS, ConsAP - ] - ** { - -fun - AdjN : AP -> N -> CN ; - AdAdj : AdA -> A -> AP ; - -} - diff --git a/src/old-demo/DemoAra.gf b/src/old-demo/DemoAra.gf deleted file mode 100644 index 1bd88705a..000000000 --- a/src/old-demo/DemoAra.gf +++ /dev/null @@ -1,10 +0,0 @@ ---# -path=.:alltenses - -concrete DemoAra of Demo = LangAra ** - open LangAra in { - - lin - AdjN ap n = AdjCN ap (UseN n) ; - AdAdj ad a = AdAP ad (PositA a) ; - -} diff --git a/src/old-demo/DemoBul.gf b/src/old-demo/DemoBul.gf deleted file mode 100644 index 4b8195792..000000000 --- a/src/old-demo/DemoBul.gf +++ /dev/null @@ -1,10 +0,0 @@ ---# -path=.:alltenses - -concrete DemoBul of Demo = LangBul ** - open LangBul in { - - lin - AdjN ap n = AdjCN ap (UseN n) ; - AdAdj ad a = AdAP ad (PositA a) ; - -} diff --git a/src/old-demo/DemoCat.gf b/src/old-demo/DemoCat.gf deleted file mode 100644 index fae691702..000000000 --- a/src/old-demo/DemoCat.gf +++ /dev/null @@ -1,10 +0,0 @@ ---# -path=.:alltenses - -concrete DemoCat of Demo = LangCat ** - open LangCat in { - - lin - AdjN ap n = AdjCN ap (UseN n) ; - AdAdj ad a = AdAP ad (PositA a) ; - -} diff --git a/src/old-demo/DemoDan.gf b/src/old-demo/DemoDan.gf deleted file mode 100644 index b46a5bcaf..000000000 --- a/src/old-demo/DemoDan.gf +++ /dev/null @@ -1,10 +0,0 @@ ---# -path=.:alltenses - -concrete DemoDan of Demo = LangDan ** - open LangDan in { - - lin - AdjN ap n = AdjCN ap (UseN n) ; - AdAdj ad a = AdAP ad (PositA a) ; - -} diff --git a/src/old-demo/DemoDut.gf b/src/old-demo/DemoDut.gf deleted file mode 100644 index a58839c31..000000000 --- a/src/old-demo/DemoDut.gf +++ /dev/null @@ -1,10 +0,0 @@ ---# -path=.:alltenses - -concrete DemoDut of Demo = LangDut ** - open LangDut in { - - lin - AdjN ap n = AdjCN ap (UseN n) ; - AdAdj ad a = AdAP ad (PositA a) ; - -} diff --git a/src/old-demo/DemoEng.gf b/src/old-demo/DemoEng.gf deleted file mode 100644 index 27415a92c..000000000 --- a/src/old-demo/DemoEng.gf +++ /dev/null @@ -1,30 +0,0 @@ ---# -path=.:alltenses - -concrete DemoEng of Demo = LangEng - [ - PredetNP, PPartNP, AdvNP, RelNP, DetNP, DetQuantOrd, - NumDigits, AdNum, OrdDigits, OrdNumeral, OrdSuperl, MassNP, - ComplN2, ComplN3, UseN2, Use2N3, Use3N3, AdjCN, RelCN, - AdvCN, SentCN, ApposCN, - PassV2, CompAdv, - -- CompNP, - SlashV2V, SlashV2VNP, --- - ComparA, ComplA2, ReflA2, UseA2, UseComparA, CAdvAP, AdjOrd, SentAP, AdAP, - PredSCVP, AdvSlash, SlashPrep, SlashVS, - EmbedS, EmbedQS, EmbedVP, UseSlash, AdvS, RelS, - CompIP, - PConjConj, VocNP, UttVP, - FunRP, - nothing_NP, nobody_NP, please_Voc, otherwise_PConj, therefore_PConj, but_PConj, - language_title_Utt, whatPl_IP, whoPl_IP, if_then_Conj, either7or_DConj, - both7and_DConj, much_Det, that_Subj, no_Quant, - ImpersCl, GenericCl, CleftNP, CleftAdv, ProgrVP, ImpPl1, ImpP3, - -- ExistNP, --- - ConsNP, ConsAdv, ConsS, ConsRS, ConsAP - ] ** - open LangEng in { - - lin - AdjN ap n = AdjCN ap (UseN n) ; - AdAdj ad a = AdAP ad (PositA a) ; - -} diff --git a/src/old-demo/DemoFin.gf b/src/old-demo/DemoFin.gf deleted file mode 100644 index 6d5f230be..000000000 --- a/src/old-demo/DemoFin.gf +++ /dev/null @@ -1,30 +0,0 @@ ---# -path=.:alltenses - -concrete DemoFin of Demo = LangFin - [ - PredetNP, PPartNP, AdvNP, RelNP, DetNP, DetQuantOrd, - NumDigits, AdNum, OrdDigits, OrdNumeral, OrdSuperl, MassNP, - ComplN2, ComplN3, UseN2, Use2N3, Use3N3, AdjCN, RelCN, - AdvCN, SentCN, ApposCN, - PassV2, CompAdv, - -- CompNP, - SlashV2V, SlashV2VNP, --- - ComparA, ComplA2, ReflA2, UseA2, UseComparA, CAdvAP, AdjOrd, SentAP, AdAP, - PredSCVP, AdvSlash, SlashPrep, SlashVS, - EmbedS, EmbedQS, EmbedVP, UseSlash, AdvS, RelS, - CompIP, - PConjConj, VocNP, UttVP, - FunRP, - nothing_NP, nobody_NP, please_Voc, otherwise_PConj, therefore_PConj, but_PConj, - language_title_Utt, whatPl_IP, whoPl_IP, if_then_Conj, either7or_DConj, - both7and_DConj, much_Det, that_Subj, no_Quant, - ImpersCl, GenericCl, CleftNP, CleftAdv, ProgrVP, ImpPl1, ImpP3, - -- ExistNP, --- - ConsNP, ConsAdv, ConsS, ConsRS, ConsAP - ] ** - open LangFin in { - - lin - AdjN ap n = AdjCN ap (UseN n) ; - AdAdj ad a = AdAP ad (PositA a) ; - -} diff --git a/src/old-demo/DemoFre.gf b/src/old-demo/DemoFre.gf deleted file mode 100644 index 8155ad4b7..000000000 --- a/src/old-demo/DemoFre.gf +++ /dev/null @@ -1,10 +0,0 @@ ---# -path=.:alltenses - -concrete DemoFre of Demo = LangFre ** - open LangFre in { - - lin - AdjN ap n = AdjCN ap (UseN n) ; - AdAdj ad a = AdAP ad (PositA a) ; - -} diff --git a/src/old-demo/DemoGer.gf b/src/old-demo/DemoGer.gf deleted file mode 100644 index e37387910..000000000 --- a/src/old-demo/DemoGer.gf +++ /dev/null @@ -1,30 +0,0 @@ ---# -path=.:alltenses - -concrete DemoGer of Demo = LangGer - [ - PredetNP, PPartNP, AdvNP, RelNP, DetNP, DetQuantOrd, - NumDigits, AdNum, OrdDigits, OrdNumeral, OrdSuperl, MassNP, - ComplN2, ComplN3, UseN2, Use2N3, Use3N3, AdjCN, RelCN, - AdvCN, SentCN, ApposCN, - PassV2, CompAdv, - -- CompNP, - SlashV2V, SlashV2VNP, --- - ComparA, ComplA2, ReflA2, UseA2, UseComparA, CAdvAP, AdjOrd, SentAP, AdAP, - PredSCVP, AdvSlash, SlashPrep, SlashVS, - EmbedS, EmbedQS, EmbedVP, UseSlash, AdvS, RelS, - CompIP, - PConjConj, VocNP, UttVP, - FunRP, - nothing_NP, nobody_NP, please_Voc, otherwise_PConj, therefore_PConj, but_PConj, - language_title_Utt, whatPl_IP, whoPl_IP, if_then_Conj, either7or_DConj, - both7and_DConj, much_Det, that_Subj, no_Quant, - ImpersCl, GenericCl, CleftNP, CleftAdv, ProgrVP, ImpPl1, ImpP3, - -- ExistNP, --- - ConsNP, ConsAdv, ConsS, ConsRS, ConsAP - ] ** - open LangGer in { - - lin - AdjN ap n = AdjCN ap (UseN n) ; - AdAdj ad a = AdAP ad (PositA a) ; - -} diff --git a/src/old-demo/DemoHin.gf b/src/old-demo/DemoHin.gf deleted file mode 100644 index ba72b0b8c..000000000 --- a/src/old-demo/DemoHin.gf +++ /dev/null @@ -1,10 +0,0 @@ ---# -path=.:alltenses - -concrete DemoHin of Demo = LangHin ** - open LangHin in { - - lin - AdjN ap n = AdjCN ap (UseN n) ; - AdAdj ad a = AdAP ad (PositA a) ; - -} diff --git a/src/old-demo/DemoIna.gf b/src/old-demo/DemoIna.gf deleted file mode 100644 index 7acc90cda..000000000 --- a/src/old-demo/DemoIna.gf +++ /dev/null @@ -1,10 +0,0 @@ ---# -path=.:alltenses - -concrete DemoIna of Demo = LangIna ** - open LangIna in { - - lin - AdjN ap n = AdjCN ap (UseN n) ; - AdAdj ad a = AdAP ad (PositA a) ; - -} diff --git a/src/old-demo/DemoIta.gf b/src/old-demo/DemoIta.gf deleted file mode 100644 index c142d8648..000000000 --- a/src/old-demo/DemoIta.gf +++ /dev/null @@ -1,10 +0,0 @@ ---# -path=.:alltenses - -concrete DemoIta of Demo = LangIta ** - open LangIta in { - - lin - AdjN ap n = AdjCN ap (UseN n) ; - AdAdj ad a = AdAP ad (PositA a) ; - -} diff --git a/src/old-demo/DemoLat.gf b/src/old-demo/DemoLat.gf deleted file mode 100644 index 64651767a..000000000 --- a/src/old-demo/DemoLat.gf +++ /dev/null @@ -1,10 +0,0 @@ ---# -path=.:alltenses - -concrete DemoLat of Demo = LangLat ** - open LangLat in { - - lin - AdjN ap n = AdjCN ap (UseN n) ; - AdAdj ad a = AdAP ad (PositA a) ; - -} diff --git a/src/old-demo/DemoNor.gf b/src/old-demo/DemoNor.gf deleted file mode 100644 index ce549612b..000000000 --- a/src/old-demo/DemoNor.gf +++ /dev/null @@ -1,10 +0,0 @@ ---# -path=.:alltenses - -concrete DemoNor of Demo = LangNor ** - open LangNor in { - - lin - AdjN ap n = AdjCN ap (UseN n) ; - AdAdj ad a = AdAP ad (PositA a) ; - -} diff --git a/src/old-demo/DemoPol.gf b/src/old-demo/DemoPol.gf deleted file mode 100644 index b4294a3d3..000000000 --- a/src/old-demo/DemoPol.gf +++ /dev/null @@ -1,10 +0,0 @@ ---# -path=.:alltenses - -concrete DemoPol of Demo = LangPol ** - open LangPol in { - - lin - AdjN ap n = AdjCN ap (UseN n) ; - AdAdj ad a = AdAP ad (PositA a) ; - -} diff --git a/src/old-demo/DemoRon.gf b/src/old-demo/DemoRon.gf deleted file mode 100644 index dccbccd12..000000000 --- a/src/old-demo/DemoRon.gf +++ /dev/null @@ -1,10 +0,0 @@ ---# -path=.:alltenses - -concrete DemoRon of Demo = LangRon - [SlashVP] ** - open LangRon in { - - lin - AdjN ap n = AdjCN ap (UseN n) ; - AdAdj ad a = AdAP ad (PositA a) ; - -} diff --git a/src/old-demo/DemoRus.gf b/src/old-demo/DemoRus.gf deleted file mode 100644 index 2b96f3de7..000000000 --- a/src/old-demo/DemoRus.gf +++ /dev/null @@ -1,10 +0,0 @@ ---# -path=.:alltenses - -concrete DemoRus of Demo = LangRus ** - open LangRus in { - - lin - AdjN ap n = AdjCN ap (UseN n) ; - AdAdj ad a = AdAP ad (PositA a) ; - -} diff --git a/src/old-demo/DemoSpa.gf b/src/old-demo/DemoSpa.gf deleted file mode 100644 index 2c0b9e0f1..000000000 --- a/src/old-demo/DemoSpa.gf +++ /dev/null @@ -1,30 +0,0 @@ ---# -path=.:alltenses - -concrete DemoSpa of Demo = LangSpa - [ - PredetNP, PPartNP, AdvNP, RelNP, DetNP, DetQuantOrd, - NumDigits, AdNum, OrdDigits, OrdNumeral, OrdSuperl, MassNP, - ComplN2, ComplN3, UseN2, Use2N3, Use3N3, AdjCN, RelCN, - AdvCN, SentCN, ApposCN, - PassV2, CompAdv, - -- CompNP, - SlashV2V, SlashV2VNP, --- - ComparA, ComplA2, ReflA2, UseA2, UseComparA, CAdvAP, AdjOrd, SentAP, AdAP, - PredSCVP, AdvSlash, SlashPrep, SlashVS, - EmbedS, EmbedQS, EmbedVP, UseSlash, AdvS, RelS, - CompIP, - PConjConj, VocNP, UttVP, - FunRP, - nothing_NP, nobody_NP, please_Voc, otherwise_PConj, therefore_PConj, but_PConj, - language_title_Utt, whatPl_IP, whoPl_IP, if_then_Conj, either7or_DConj, - both7and_DConj, much_Det, that_Subj, no_Quant, - ImpersCl, GenericCl, CleftNP, CleftAdv, ProgrVP, ImpPl1, ImpP3, - -- ExistNP, --- - ConsNP, ConsAdv, ConsS, ConsRS, ConsAP - ] ** - open LangSpa in { - - lin - AdjN ap n = AdjCN ap (UseN n) ; - AdAdj ad a = AdAP ad (PositA a) ; - -} diff --git a/src/old-demo/DemoSwe.gf b/src/old-demo/DemoSwe.gf deleted file mode 100644 index af48e5384..000000000 --- a/src/old-demo/DemoSwe.gf +++ /dev/null @@ -1,30 +0,0 @@ ---# -path=.:alltenses - -concrete DemoSwe of Demo = LangSwe - [ - PredetNP, PPartNP, AdvNP, RelNP, DetNP, DetQuantOrd, - NumDigits, AdNum, OrdDigits, OrdNumeral, OrdSuperl, MassNP, - ComplN2, ComplN3, UseN2, Use2N3, Use3N3, AdjCN, RelCN, - AdvCN, SentCN, ApposCN, - PassV2, CompAdv, - -- CompNP, - SlashV2V, SlashV2VNP, --- - ComparA, ComplA2, ReflA2, UseA2, UseComparA, CAdvAP, AdjOrd, SentAP, AdAP, - PredSCVP, AdvSlash, SlashPrep, SlashVS, - EmbedS, EmbedQS, EmbedVP, UseSlash, AdvS, RelS, - CompIP, - PConjConj, VocNP, UttVP, - FunRP, - nothing_NP, nobody_NP, please_Voc, otherwise_PConj, therefore_PConj, but_PConj, - language_title_Utt, whatPl_IP, whoPl_IP, if_then_Conj, either7or_DConj, - both7and_DConj, much_Det, that_Subj, no_Quant, - ImpersCl, GenericCl, CleftNP, CleftAdv, ProgrVP, ImpPl1, ImpP3, - -- ExistNP, --- - ConsNP, ConsAdv, ConsS, ConsRS, ConsAP - ] ** - open LangSwe in { - - lin - AdjN ap n = AdjCN ap (UseN n) ; - AdAdj ad a = AdAP ad (PositA a) ; - -} diff --git a/src/old-demo/DemoTha.gf b/src/old-demo/DemoTha.gf deleted file mode 100644 index 86d4f0d0a..000000000 --- a/src/old-demo/DemoTha.gf +++ /dev/null @@ -1,10 +0,0 @@ ---# -path=.:alltenses - -concrete DemoTha of Demo = LangTha ** - open LangTha in { - - lin - AdjN ap n = AdjCN ap (UseN n) ; - AdAdj ad a = AdAP ad (PositA a) ; - -} diff --git a/src/old-demo/DemoTur.gf b/src/old-demo/DemoTur.gf deleted file mode 100644 index 57b10319c..000000000 --- a/src/old-demo/DemoTur.gf +++ /dev/null @@ -1,10 +0,0 @@ ---# -path=.:alltenses - -concrete DemoTur of Demo = LangTur ** - open LangTur in { - - lin - AdjN ap n = AdjCN ap (UseN n) ; - AdAdj ad a = AdAP ad (PositA a) ; - -} diff --git a/src/old-demo/DemoUrd.gf b/src/old-demo/DemoUrd.gf deleted file mode 100644 index cbed27294..000000000 --- a/src/old-demo/DemoUrd.gf +++ /dev/null @@ -1,10 +0,0 @@ ---# -path=.:alltenses - -concrete DemoUrd of Demo = LangUrd ** - open LangUrd in { - - lin - AdjN ap n = AdjCN ap (UseN n) ; - AdAdj ad a = AdAP ad (PositA a) ; - -}