1
0
forked from GitHub/gf-rgl

Merge branch 'master' into master

This commit is contained in:
kitukb
2018-11-29 16:47:13 +03:00
committed by GitHub
153 changed files with 7454 additions and 194712 deletions

View File

@@ -1,14 +1,27 @@
sudo: required
language: c
services:
- docker
os:
- linux
- osx
- windows
addons:
apt:
packages:
- ghc
before_install:
- docker pull odanoburu/haskell-gf:3.9
- mkdir rgl
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update && brew install ghc@8.2 && export PATH="/usr/local/opt/ghc@8.2/bin:$PATH" ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl http://www.grammaticalframework.org/download/gf-3.9-bin-intel-mac.tar.gz > gf.tar.gz && sudo tar --no-same-owner --no-same-permissions -C /usr/local -zxf gf.tar.gz && rm gf.tar.gz; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then curl http://www.grammaticalframework.org/download/gf_3.9.1-1_amd64-trusty.deb > gf.deb && sudo dpkg -i gf.deb && rm gf.deb ; fi
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then choco install ghc --version=8.4.4 && export PATH="/c/ProgramData/chocolatey/lib/ghc/tools/ghc-8.4.4/bin:$PATH"; fi
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then curl http://www.grammaticalframework.org/download/gf-3.9-bin-windows.zip > gf.zip && unzip gf.zip && rm gf.zip && export PATH="$TRAVIS_BUILD_DIR/gf-3.9/bin:$PATH"; fi
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then alias gf='gf.exe' && alias runghc='runghc.exe' ; fi
script:
- docker run --mount src="$(pwd)",target=/home,type=bind odanoburu/haskell-gf:3.9 /bin/bash -c "cd /home/; export GF_LIB_PATH=/home/rgl ; runghc Make.hs build prelude all --verbose ;"
- docker run --mount src="$(pwd)",target=/home,type=bind odanoburu/haskell-gf:3.9 /bin/bash -c "cd /home/; export GF_LIB_PATH=/home/rgl; bash Make.sh --dest=rgl --verbose ;"
- runghc Setup.hs build prelude all --verbose
- rm -rf dist
- mkdir dist-bash ; bash Setup.sh --dest=dist-bash --verbose
- rm -rf dist ; mkdir dist-bat
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then cmd //c Setup.bat --dest=dist-bat --verbose ; fi

70
Config.hs Normal file
View File

@@ -0,0 +1,70 @@
-- | Reading language config file
module Config (
LangInfo (..),
loadLangs, loadLangsFrom, configFile
) where
import Data.List (unfoldr)
import System.IO (hPutStrLn,stderr)
import System.Exit (exitFailure)
-- | Path to language config file
configFile :: FilePath
configFile = "languages.csv"
-- | Information about a language
data LangInfo = LangInfo
{ langCode :: String -- ^ 3-letter ISO 639-2/B code
, langName :: String -- ^ language name
, langDir :: String -- ^ directory name
, langFunctor :: Maybe String -- ^ functor (not used)
, langUnlexer :: Maybe String -- ^ decoding for postprocessing linearizations
, langPresent :: Bool
, langAll :: Bool
, langTry :: Bool
, langSymbolic :: Bool
, langCompatibility :: Bool
, langSynopsis :: Bool -- ^ include in RGL synopsis
} deriving (Show,Eq)
-- | Load language information from default config file
loadLangs :: IO [LangInfo]
loadLangs = loadLangsFrom configFile
-- | Load language information from specified config file
loadLangsFrom:: FilePath -> IO [LangInfo]
loadLangsFrom configFile = do
lns <- readFile configFile >>= return . lines
mapM mkLangInfo (tail lns)
where
maybeBit bits n = if length bits >= (n+1) && length (bits !! n) > 0 then Just (bits !! n) else Nothing
boolBit bits n def = if length bits >= (n+1) && length (bits !! n) > 0 then (if def then bits !! n /= "n" else bits !! n == "y") else def
mkLangInfo s =
let bits = separateBy ',' s in
if length bits < 2
then die $ "Invalid entry in " ++ configFile ++ ": " ++ s
else return $ LangInfo
{ langCode = bits !! 0
, langName = bits !! 1
, langDir = bits !! 2
, langFunctor = maybeBit bits 3
, langUnlexer = maybeBit bits 4
, langPresent = boolBit bits 5 False
, langAll = boolBit bits 6 True
, langTry = boolBit bits 7 True
, langSymbolic = boolBit bits 8 True
, langCompatibility = boolBit bits 9 False
, langSynopsis = boolBit bits 10 False
}
-- | Separate a string on a character
-- Source: https://stackoverflow.com/a/4978733/98600
separateBy :: Eq a => a -> [a] -> [[a]]
separateBy chr = unfoldr sep where
sep [] = Nothing
sep l = Just . fmap (drop 1) . break (== chr) $ l
die :: String -> IO a
die s = do
hPutStrLn stderr s
exitFailure

206
LICENSE Normal file
View File

@@ -0,0 +1,206 @@
The GF Resource Grammar Library is under GNU LESSER GENERAL PUBLIC LICENSE and BSD.
However the user has the right to choose any license for any application grammar derived from the resource grammar by using the grammar API.
The Resource Grammar Library also includes large coverage lexicons for some languages.
Since these lexicons are derived from external sources they might be under different licenses.
Look at the source file for every lexicon for details.
The rest of this document contains copies of the LGPL and BSD licenses
which are applicable to the different components of the Resource Grammar Library as described above.
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.
BSD LICENSE
Copyright (c) 1998, Grammatical Framework
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the <organization> nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -1,8 +1,8 @@
# A simple wrapper over the Haskell-based RGL build script
RUNMAKE=runghc Make.hs
RUNMAKE=runghc Setup.hs
.PHONY: build copy install clean
.PHONY: build copy install doc clean
default: build copy
@@ -14,5 +14,8 @@ copy:
install: build copy
doc: build
make -C doc GF_LIB_PATH=../dist
clean:
$(RUNMAKE) clean

View File

@@ -12,9 +12,9 @@ For more about the RGL, see the [synopsis page](http://www.grammaticalframework.
There are 3 ways to build and install the RGL:
- Haskell script `Make.hs`
- Shell script `Make.sh` (does not require Haskell)
- Windows batch file `Make.bat` (does not require Haskell)
- Haskell script `Setup.hs`
- Shell script `Setup.sh` (does not require Haskell)
- Windows batch file `Setup.bat` (does not require Haskell)
## Install locations
@@ -27,24 +27,27 @@ It will look for, in this order:
## Language config
A list of all languages and their properties is maintained centrally in `languages.csv`.
A list of all languages and their properties is maintained centrally in [`languages.csv`](languages.csv).
This file should be kept up-to-date and all build methods should read this config file.
**If you see something wrong, please report/fix it.**
Description of columns:
- Code, e,g, `Eng`
- Directory, e.g. `english`
- Functor (not used)
- Unlexer (not used)
- Present: languages that have `--# notpresent` marked
- All: languages for which to compile `All`
- Try: languages for which to compile `Try`
- Symbolic: languages for which to compile `Symbolic`
- Compatibility: languages for which to complile `Compatibility`
| # | Column | Description | Default |
|:---|:--------------|:-----------------------------------------|:-------:|
| 1 | Code | 3-letter language code, e.g. `Eng` | - |
| 2 | Name | language name in English, e.g. `English` | - |
| 3 | Directory | folder name under `src`, e.g. `english` | - |
| 4 | Functor | functor name (not used) | - |
| 5 | Unlexer | unlexer (not used) | - |
| 6 | Present | language is marked with `--# notpresent` | n |
| 7 | All | compile `All` module | y |
| 8 | Try | compile `Try` module | y |
| 9 | Symbolic | compile `Symbolic` module | y |
| 10 | Compatibility | complile `Compatibility` module | n |
| 11 | Synopsis | include language in the RGL synopsis | n |
Columns can be a string, just `y`'s (where nothing means `n`) or just (`n`'s where nothing means `y`).
If default is `y` then anything other than `n`, including the empty string, is treated as true (and vice versa when default is `n`).
## Haskell script: `Make.hs`
## Haskell script: `Setup.hs`
This build method gives you most options.
You will need Haskell installed on your system.
@@ -66,7 +69,7 @@ There is also `make clean` available.
For more fine-grained control over the build process, you can run the build script directly:
```
runghc Make ...
runghc Setup.hs ...
```
Where `...` is one of:
@@ -96,7 +99,7 @@ If ommitted, the default command is `prelude all`.
- 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 `--dest` 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`.
## Shell script: `Make.sh`
## Shell script: `Setup.sh`
This method is provided as an alternative for those who don't have Haskell installed.
Simply run the script to build the entire RGL and install in the default location.
@@ -106,13 +109,11 @@ You can pass the following flags:
- `--gf=...` to specify the path to the `gf` executable, if not available on the system path
- `--verbose` or `-v` to show a list of files being built (errors will always be shown)
## Windows batch file: `Make.bat`
## Windows batch file: `Setup.bat`
**This script is still untested.**
This method is provided as an alternative for Windows users who don't have Haskell or Bash installed.
This method is provided as an alternative for Windows users who don't have Haskell installed.
It is supposed to be a port of Make.sh and works in largely the same way.
It is supposed to be a port of `Setup.sh` and works in largely the same way.
In particular, it accepts the same flags (in the same format) as described above.
However it currently tries to build all modules for all languages and doesn't consider the details of which modules should be compiled for each language (specified in `languages.csv`)

View File

@@ -12,35 +12,45 @@ set modules_langs=All Symbol Compatibility
set modules_api=Try Symbolic
REM Defaults (may be overridden by options)
set gf=gf-default
set gf=gf
set dest=
set verbose=false
REM Check command line options
set arg_gf_next=false
set arg_dest_next=false
for %%i in (%*) do (
if !arg_gf_next!==true (
set gf=%%i
set arg_gf_next=false
)
if !arg_dest_next!==true (
set dest=%%i
set arg_dest_next=false
)
if %%i==-v set verbose=true
if %%i==--verbose set verbose=true
if %%i==--gf set arg_gf_next=true
if %%i==--dest set arg_dest_next=true
)
:Loop
if '%1'=='' goto Continue
if %1==-v set verbose=true
if %1==--verbose set verbose=true
if %1==--gf set gf=%2
if %1==--dest set dest=%2
shift
goto Loop
:Continue
REM Try to determine install location
if "%dest%"=="" (
set dest=%GF_LIB_PATH%
REM Separate paths with search path separator ; and pick first one
for %%p in ("%GF_LIB_PATH:;=";"%") do (
set dest=%%~p
goto BreakLibPath
)
)
:BreakLibPath
set DATA_DIR=..\gf-core\DATA_DIR
if "%dest%"=="" (
REM TODO Look in ../gf-core/DATA=DIR
REM Look in already compiled GF folder
if exist %DATA_DIR% (
for /f "delims=" %%x in (%DATA_DIR%) do (
if not "%%x"=="" (
set dest=%%x\lib
goto BreakDataDir
)
)
)
)
:BreakDataDir
if "%dest%"=="" (
echo Unable to determine where to install the RGL. Please do one of the following:
echo - Pass the --dest=... flag to this script
@@ -52,17 +62,17 @@ if "%dest%"=="" (
REM A few more definitions before we get started
set src=src
set dist=dist
set gfc=gf --batch --gf-lib-path=%src% --quiet
set gfc=%gf% --batch --gf-lib-path=%src%
REM Redirect stderr if not verbose
REM Add quiet flag if not verbose
if %verbose%==false (
set gfc=2>NUL !gfc!
set gfc=%gfc% --quiet
)
REM Make directories if not present
mkdir %dist%\prelude
mkdir %dist%\present
mkdir %dist%\alltenses
if not exist %dist%\prelude mkdir %dist%\prelude
if not exist %dist%\present mkdir %dist%\present
if not exist %dist%\alltenses mkdir %dist%\alltenses
REM Build: prelude
echo Building [prelude]
@@ -74,13 +84,17 @@ REM Gather all language modules for building
set modules=
for %%l in (%langs%) do (
for %%m in (%modules_langs%) do (
for /r %src% %%m in (*%%m%%l.gf) do (
set modules=!modules! %%m
set patt=%%m%%l.gf
for /r %src% %%n in (!patt!) do (
if exist %%n set modules=!modules! %%n
)
)
)
for %%l in (%langs%) do (
for %%m in (%modules_api%) do (
for /r %src%\api %%m in (*%%m%%l.gf) do (
set modules=!modules! %%m
set patt=%%m%%l.gf
for /r %src%\api %%n in (!patt!) do (
if exist %%n set modules=!modules! %%n
)
)
)
@@ -88,15 +102,25 @@ for %%l in (%langs%) do (
REM Build: present
echo Building [present]
for %%m in (%modules%) do (
if %verbose%==true echo %%m
%gfc% --no-pmcfg --gfo-dir=%dist%\present --preproc=mkPresent %%m
)
REM Build: alltenses
echo Building [alltenses]
for %%m in (%modules%) do (
if %verbose%==true echo %%m
%gfc% --no-pmcfg --gfo-dir=%dist%\alltenses %%m
)
REM Make destination directories if not present
if not exist %dest% mkdir %dest%
if not exist %dest%\prelude mkdir %dest%\prelude
if not exist %dest%\present mkdir %dest%\present
if not exist %dest%\alltenses mkdir %dest%\alltenses
REM Copy
echo Copying to %dest%
copy %dist% %dest%
copy %dist%\prelude\*.gfo %dest%\prelude\
copy %dist%\present\*.gfo %dest%\present\
copy %dist%\alltenses\*.gfo %dest%\alltenses\

View File

@@ -1,13 +1,21 @@
import Data.List (find,isPrefixOf,isSuffixOf,(\\),unfoldr)
{-# LANGUAGE CPP #-}
-- | Main build script for RGL
import Data.List (find,isPrefixOf,isSuffixOf,(\\))
import Data.Maybe (catMaybes)
import System.IO (hPutStrLn,stderr)
import System.IO.Error (catchIOError)
import System.Exit (ExitCode(..),die)
import System.Exit (ExitCode(..),exitFailure)
import System.Environment (getArgs,lookupEnv)
import System.Process (rawSystem)
import System.FilePath ((</>)) -- ,takeFileName,addExtension,dropExtension)
import System.FilePath ((</>),splitSearchPath) -- ,takeFileName,addExtension,dropExtension)
import System.Directory (createDirectoryIfMissing,copyFile,getDirectoryContents,removeDirectoryRecursive,findFile)
#if __GLASGOW_HASKELL__>=800
import System.Directory (getModificationTime,setModificationTime)
#endif
import Control.Monad (when,unless)
import Config
main :: IO ()
main = do
@@ -61,14 +69,22 @@ copyOne :: String -> FilePath -> FilePath -> IO ()
copyOne file from to = do
putStrLn $ "Copying [" ++ file ++ "] " ++ to
createDirectoryIfMissing True to
copyFile (from </> file) (to </> file)
copyFileWithModificationTime (from </> file) (to </> file)
-- | Copy all files between directories
copyAll :: String -> FilePath -> FilePath -> IO ()
copyAll msg from to = do
putStrLn $ "Copying [" ++ msg ++ "] " ++ to
createDirectoryIfMissing True to
mapM_ (\file -> when (file /= "." && file /= "..") $ copyFile (from </> file) (to </> file)) =<< getDirectoryContents from
mapM_ (\file -> when (file /= "." && file /= "..") $ copyFileWithModificationTime (from </> file) (to </> file)) =<< getDirectoryContents from
-- | Copy a file together with its modification time but no other meta data
copyFileWithModificationTime :: FilePath -> FilePath -> IO ()
copyFileWithModificationTime source destination = do
copyFile source destination
#if __GLASGOW_HASKELL__>=800
getModificationTime source >>= setModificationTime destination
#endif
-- | Remove dist directory
clean :: IO ()
@@ -103,7 +119,7 @@ mkInfo = do
-- 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"
menvar <- lookupEnv "GF_LIB_PATH" >>= return . fmap (head . splitSearchPath)
let
inst_dir =
case catMaybes [mflag,menvar,mbuilt] of
@@ -332,57 +348,6 @@ verbose_switch_short = "-v"
getFlag :: String -> [String] -> Maybe String
getFlag flag args = fmap (drop (length flag)) $ find (isPrefixOf flag) args
-------------------------------------------------------------------------------
-- Languages of the RGL
-- | Path to language config file
configFile :: FilePath
configFile = "languages.csv"
-- | 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
, langPresent :: Bool
, langAll :: Bool
, langTry :: Bool
, langSymbolic :: Bool
, langCompatibility :: Bool
} deriving (Show,Eq)
-- | Load language information from config file
loadLangs :: IO [LangInfo]
loadLangs = do
lns <- readFile configFile >>= return . lines
mapM mkLangInfo (tail lns)
where
maybeBit bits n = if length bits >= (n+1) && length (bits !! n) > 0 then Just (bits !! n) else Nothing
boolBit bits n def = if length bits >= (n+1) && length (bits !! n) > 0 then (if def then bits !! n /= "n" else bits !! n == "y") else def
mkLangInfo s =
let bits = separateBy ',' s in
if length bits < 2
then die $ "Invalid entry in " ++ configFile ++ ": " ++ s
else return $ LangInfo
{ langCode = bits !! 0
, langDir = bits !! 1
, langFunctor = maybeBit bits 2
, langUnlexer = maybeBit bits 3
, langPresent = boolBit bits 4 False
, langAll = boolBit bits 5 True
, langTry = boolBit bits 6 True
, langSymbolic = boolBit bits 7 True
, langCompatibility = boolBit bits 8 False
}
-- | Separate a string on a character
-- Source: https://stackoverflow.com/a/4978733/98600
separateBy :: Eq a => a -> [a] -> [[a]]
separateBy chr = unfoldr sep where
sep [] = Nothing
sep l = Just . fmap (drop 1) . break (== chr) $ l
-------------------------------------------------------------------------------
-- Executing GF
@@ -429,7 +394,7 @@ execute command args = do
-- | For parallel RGL module compilation
-- Unfortunately, this has no effect unless compiled with -threaded
parallel_ :: (Foldable t, Monad m) => t (m a) -> m ()
--parallel_ :: (Foldable t, Monad m) => t (m a) -> m ()
parallel_ ms = sequence_ ms
-- do c <- newChan
-- ts <- sequence [ forkIO (m >> writeChan c ()) | m <- ms]
@@ -437,3 +402,8 @@ parallel_ ms = sequence_ ms
putErrLn :: String -> IO ()
putErrLn = hPutStrLn stderr
die :: String -> IO a
die s = do
hPutStrLn stderr s
exitFailure

View File

@@ -6,11 +6,11 @@
set -e
# Get languages from config
langs=$(tail -n +2 languages.csv | awk -F ',' '{ if ($6 != "n") { print $1 } }')
langs_present=$(tail -n +2 languages.csv | awk -F ',' '{ if ($5 == "y") { print $1 } }')
langs_try=$(tail -n +2 languages.csv | awk -F ',' '{ if ($7 != "n") { print $1 } }')
langs_symbolic=$(tail -n +2 languages.csv | awk -F ',' '{ if ($8 != "n") { print $1 } }')
langs_compat=$(tail -n +2 languages.csv | awk -F ',' '{ if ($9 == "y") { print $1 } }')
langs=$(tail -n +2 languages.csv | awk -F ',' '{ if ($7 != "n") { print $1 } }')
langs_present=$(tail -n +2 languages.csv | awk -F ',' '{ if ($6 == "y") { print $1 } }')
langs_try=$(tail -n +2 languages.csv | awk -F ',' '{ if ($8 != "n") { print $1 } }')
langs_symbolic=$(tail -n +2 languages.csv | awk -F ',' '{ if ($9 != "n") { print $1 } }')
langs_compat=$(tail -n +2 languages.csv | awk -F ',' '{ if ($10 == "y") { print $1 } }')
# Modules to compile for each language
modules_langs="All Symbol Compatibility"
@@ -36,7 +36,7 @@ done
# Try to determine install location
if [ -z "$dest" ]; then
dest="$GF_LIB_PATH"
dest=$(echo "$GF_LIB_PATH" | sed 's/:.*$//')
fi
if [ -z "$dest" ] && [ -f "../gf-core/DATA_DIR" ]; then
dest=$(cat ../gf-core/DATA_DIR)
@@ -97,4 +97,4 @@ done
# Copy
echo "Copying to ${dest}"
cp -R "${dist}"/* "${dest}"
cp -R -p "${dist}"/* "${dest}"

8
doc/.gitignore vendored Normal file
View File

@@ -0,0 +1,8 @@
synopsis/index.txt
synopsis/index.html
synopsis/api-examples-*.txt
synopsis/api-examples.gfs
synopsis/categories-imagemap.html
synopsis/categories.png
gfdoc/sources.html

File diff suppressed because it is too large Load Diff

View File

@@ -21,7 +21,7 @@ interlingua = "Meaning"
languages = [
"afrikaans",
-- "አማርኛ",
-- "العربية",
"العربية",
"Български",
"català",
"中文",
@@ -45,6 +45,7 @@ languages = [
"پeرسن",
"polski",
"پنجابی",
"português",
"Русский",
"ٻولي",
"español",

View File

@@ -1,56 +1,21 @@
.PHONY: abstract synopsis
.PHONY: all status synopsis abstract sources
all: exx synopsis
GFDOC=gfdoc
S=../src
GF_alltenses=$(GF_LIB_PATH)/alltenses
all: synopsis
status: status.html
index:
txt2tags -thtml index.txt
status:
txt2tags -thtml status.txt
synopsis:
runghc MkSynopsis.hs
make -C synopsis GF_LIB_PATH=../$(GF_LIB_PATH)
categories-imagemap.html: categories.dot
dot -Tcmapx $^ > $@
sources:
make -C gfdoc sources.html
status.html:
txt2tags -thtml status.txt
abstract:
gfdoc -txthtml ../src/abstract/*.gf
mv ../src/abstract/*.html abstract
exx-script:
runghc MkExx.hs <api-examples.txt >api-examples.gfs
exx: exx-script
gf -retain -s $(GF_alltenses)/TryAfr.gfo <api-examples.gfs >api-examples-Afr.txt
gf -retain -s $(GF_alltenses)/TryBul.gfo <api-examples.gfs >api-examples-Bul.txt
gf -retain -s $(GF_alltenses)/TryCat.gfo <api-examples.gfs >api-examples-Cat.txt
gf -retain -s $(GF_alltenses)/TryChi.gfo <api-examples.gfs >api-examples-Chi.txt
gf -retain -s $(GF_alltenses)/TryDan.gfo <api-examples.gfs >api-examples-Dan.txt
gf -retain -s $(GF_alltenses)/TryDut.gfo <api-examples.gfs >api-examples-Dut.txt
gf -retain -s $(GF_alltenses)/TryEng.gfo <api-examples.gfs >api-examples-Eng.txt
gf -retain -s $(GF_alltenses)/TryEst.gfo <api-examples.gfs >api-examples-Est.txt
gf -retain -s $(GF_alltenses)/TryEus.gfo <api-examples.gfs >api-examples-Eus.txt
gf -retain -s $(GF_alltenses)/TryFin.gfo <api-examples.gfs >api-examples-Fin.txt
gf -retain -s $(GF_alltenses)/TryFre.gfo <api-examples.gfs >api-examples-Fre.txt
gf -retain -s $(GF_alltenses)/TryGer.gfo <api-examples.gfs >api-examples-Ger.txt
gf -retain -s $(GF_alltenses)/TryGre.gfo <api-examples.gfs >api-examples-Gre.txt
gf -retain -s $(GF_alltenses)/TryHin.gfo <api-examples.gfs >api-examples-Hin.txt
gf -retain -s $(GF_alltenses)/TryIce.gfo <api-examples.gfs >api-examples-Ice.txt
gf -retain -s $(GF_alltenses)/TryIta.gfo <api-examples.gfs >api-examples-Ita.txt
gf -retain -s $(GF_alltenses)/TryJpn.gfo <api-examples.gfs >api-examples-Jpn.txt
gf -retain -s $(GF_alltenses)/TryLav.gfo <api-examples.gfs >api-examples-Lav.txt
gf -retain -s $(GF_alltenses)/TryMlt.gfo <api-examples.gfs >api-examples-Mlt.txt
gf -retain -s $(GF_alltenses)/TryMon.gfo <api-examples.gfs >api-examples-Mon.txt
gf -retain -s $(GF_alltenses)/TryNep.gfo <api-examples.gfs >api-examples-Nep.txt
gf -retain -s $(GF_alltenses)/TryNor.gfo <api-examples.gfs >api-examples-Nor.txt
gf -retain -s $(GF_alltenses)/TryNno.gfo <api-examples.gfs >api-examples-Nno.txt
gf -retain -s $(GF_alltenses)/TryPes.gfo <api-examples.gfs >api-examples-Pes.txt
gf -retain -s $(GF_alltenses)/TryPnb.gfo <api-examples.gfs >api-examples-Pnb.txt
gf -retain -s $(GF_alltenses)/TryPol.gfo <api-examples.gfs >api-examples-Pol.txt
gf -retain -s $(GF_alltenses)/TryRon.gfo <api-examples.gfs >api-examples-Ron.txt
gf -retain -s $(GF_alltenses)/TryRus.gfo <api-examples.gfs >api-examples-Rus.txt
gf -retain -s $(GF_alltenses)/TrySnd.gfo <api-examples.gfs >api-examples-Snd.txt
gf -retain -s $(GF_alltenses)/TrySpa.gfo <api-examples.gfs >api-examples-Spa.txt
gf -retain -s $(GF_alltenses)/TrySwe.gfo <api-examples.gfs >api-examples-Swe.txt
gf -retain -s $(GF_alltenses)/TryTha.gfo <api-examples.gfs >api-examples-Tha.txt
gf -retain -s $(GF_alltenses)/TryUrd.gfo <api-examples.gfs >api-examples-Urd.txt
$(GFDOC) -txthtml $S/abstract/*.gf
mv $S/abstract/*.html abstract

View File

@@ -1,73 +0,0 @@
-- make a script for computing examples
-- usage: runghc MkExx.hs <koe.txt >koe.gfs
-- then: gf -retain -s ../alltenses/TryRon.gfo <koe.gfs
-- called automatically by 'make exx'
main = interact (unlines . concatMap mkScript . takeWhile (/="--.") . lines)
mkScript l = case l of
' ':_ ->
let ident = mkIdent $ unwords $ takeWhile (/="--") $ words l
in [add $ psq ident]
'-':_ -> []
_ -> [
add $ psq l,
add $ "cc -one " ++ l,
add $ psq "*"
]
add = ('\n':)
psq s = "ps \"" ++ s ++ "\""
-- makes mkUtt : QS -> Utt to mkUtt-QS-Utt
mkIdent :: String -> String
mkIdent = concatMap unspec where
unspec c = case c of
' ' -> ""
'>' -> ""
'(' -> ""
')' -> ""
':' -> "-"
_ -> [c]
langsCoding = [
(("amharic", "Amh"),""),
(("arabic", "Ara"),""),
(("basque", "Eus"),""),
(("bulgarian","Bul"),""),
(("catalan", "Cat"),"Romance"),
(("danish", "Dan"),"Scand"),
(("dutch", "Dut"),""),
(("english", "Eng"),""),
(("finnish", "Fin"),""),
(("french", "Fre"),"Romance"),
(("hindi", "Hin"),"Hindustani"),
(("german", "Ger"),""),
(("interlingua","Ina"),""),
(("italian", "Ita"),"Romance"),
(("latin", "Lat"),""),
(("norwegian","Nor"),"Scand"),
(("polish", "Pol"),""),
(("punjabi", "Pnb"),""),
(("romanian", "Ron"),""),
(("russian", "Rus"),""),
(("spanish", "Spa"),"Romance"),
(("swedish", "Swe"),"Scand"),
(("thai", "Tha"),""),
(("turkish", "Tur"),""),
(("urdu", "Urd"),"Hindustani")
]
langs = map fst langsCoding
-- languagues for which Try is normally compiled
langsLang = langs `except` langsIncomplete
-- languages for which Lang can be compiled but which are incomplete
langsIncomplete = ["Amh","Ara","Hin","Lat","Pnb","Rus","Tha","Tur","Urd"]
except ls es = filter (flip notElem es . snd) ls

View File

@@ -1,22 +0,0 @@
import qualified Data.Map as Map
import Data.Char
gold = "CC_eng_tha.txt"
tested = "api-examples-Tha.txt"
main = do
s <- readFile gold
let corrects = Map.fromList $ exx 1 5 2 (lines s)
-- mapM_ putStrLn $ concat [[t,s] | (t,s) <- Map.toList corrects]
t <- readFile tested
mapM_ (doTest corrects) (exx 18 22 1 (map (drop 4) (lines t)))
exx x y z ss = [(ss!!k,ss!!(k+z)) | k <- [x,y .. length ss - 2]]
doTest corrects (t,s) = case Map.lookup t corrects of
Just c -> if unspace s == uncomment c then return () else mapM_ putStrLn [t,unspace s,c]
_ -> return ()
unspace = filter (not . isSpace)
uncomment = unspace . takeWhile (/= '-')

View File

@@ -1,53 +0,0 @@
<map id="categories" name="categories">
<area shape="poly" href="#Text" title="Text" alt="" coords="690,23 688,17 685,12 679,8 672,5 664,4 656,5 649,8 643,12 640,17 638,23 640,29 643,34 649,38 656,41 664,42 672,41 679,38 685,34 688,29"/>
<area shape="poly" href="#Punct" title="Punct" alt="" coords="657,95 656,89 652,84 646,80 638,77 629,76 620,77 612,80 606,84 602,89 600,95 602,101 606,106 612,110 620,113 629,114 638,113 646,110 652,106 656,101"/>
<area shape="poly" href="#Phr" title="Phr" alt="" coords="726,95 725,89 721,84 715,80 708,77 700,76 692,77 685,80 679,84 676,89 675,95 676,101 679,106 685,110 692,113 700,114 708,113 715,110 721,106 725,101"/>
<area shape="poly" href="#PConj" title="PConj" alt="" coords="658,167 656,162 652,156 645,152 637,150 628,149 619,150 610,152 604,156 600,162 598,167 600,173 604,179 610,183 619,185 628,186 637,185 645,183 652,179 656,173"/>
<area shape="poly" href="#Utt" title="Utt" alt="" coords="726,167 725,162 721,156 715,152 708,150 700,149 692,150 685,152 679,156 676,162 675,167 676,173 679,179 685,183 692,185 700,186 708,185 715,183 721,179 725,173"/>
<area shape="poly" href="#Voc" title="Voc" alt="" coords="794,167 793,162 789,156 784,152 777,150 769,149 761,150 754,152 748,156 744,162 743,167 744,173 748,179 754,183 761,185 769,186 777,185 784,183 789,179 793,173"/>
<area shape="poly" href="#Imp" title="Imp" alt="" coords="657,240 656,234 652,229 647,225 640,222 632,221 624,222 617,225 611,229 607,234 606,240 607,246 611,251 617,255 624,258 632,259 640,258 647,255 652,251 656,246"/>
<area shape="poly" href="#S" title="S" alt="" coords="726,240 725,234 721,229 715,225 708,223 700,222 692,223 685,225 679,229 676,234 675,240 676,245 679,250 685,254 692,257 700,258 708,257 715,254 721,250 725,245"/>
<area shape="poly" href="#QS" title="QS" alt="" coords="870,240 868,234 865,229 859,225 852,222 844,221 836,222 829,225 823,229 819,234 818,240 819,246 823,251 829,255 836,258 844,259 852,258 859,255 865,251 868,246"/>
<area shape="poly" href="#Tense" title="Tense" alt="" coords="521,312 519,306 515,301 509,297 501,294 492,293 483,294 475,297 469,301 464,306 463,312 464,318 469,323 475,327 483,330 492,331 501,330 509,327 515,323 519,318"/>
<area shape="poly" href="#Ant" title="Ant" alt="" coords="589,312 588,306 584,301 578,297 571,294 563,293 555,294 548,297 542,301 539,306 538,312 539,318 542,323 548,327 555,330 563,331 571,330 578,327 584,323 588,318"/>
<area shape="poly" href="#Pol" title="Pol" alt="" coords="657,312 656,306 652,301 647,297 640,294 632,293 624,294 617,297 611,301 607,306 606,312 607,318 611,323 617,327 624,330 632,331 640,330 647,327 652,323 656,318"/>
<area shape="poly" href="#Cl" title="Cl" alt="" coords="726,312 725,306 721,301 715,297 708,294 700,293 692,294 685,297 679,301 676,306 675,312 676,318 679,323 685,327 692,330 700,331 708,330 715,327 721,323 725,318"/>
<area shape="poly" href="#ListS" title="ListS" alt="" coords="798,312 797,306 793,301 787,297 779,294 771,293 762,294 754,297 748,301 745,306 743,312 745,318 748,323 754,327 762,330 771,331 779,330 787,327 793,323 797,318"/>
<area shape="poly" href="#Conj" title="Conj" alt="" coords="867,312 866,306 862,301 856,297 849,294 841,293 833,294 826,297 820,301 816,306 815,312 816,318 820,323 826,327 833,330 841,331 849,330 856,327 862,323 866,318"/>
<area shape="poly" href="#QCl" title="QCl" alt="" coords="945,312 943,306 940,301 934,297 927,294 919,293 911,294 904,297 898,301 895,306 893,312 895,318 898,323 904,327 911,330 919,331 927,330 934,327 940,323 943,318"/>
<area shape="poly" href="#NP" title="NP" alt="" coords="270,384 269,379 265,373 260,369 252,366 244,366 237,366 229,369 224,373 220,379 219,384 220,390 224,395 229,400 237,402 244,403 252,402 260,400 265,395 269,390"/>
<area shape="poly" href="#VP" title="VP" alt="" coords="636,384 634,379 631,373 625,369 618,366 610,366 602,366 595,369 589,373 585,379 584,384 585,390 589,395 595,400 602,402 610,403 618,402 625,400 631,395 634,390"/>
<area shape="rect" href="#Adv" title="Adv" alt="" coords="702,367,753,401"/>
<area shape="poly" href="#Predet" title="Predet" alt="" coords="65,457 63,451 59,446 52,441 44,439 34,438 25,439 16,441 10,446 5,451 4,457 5,462 10,468 16,472 25,475 34,475 44,475 52,472 59,468 63,462"/>
<area shape="poly" href="#Pron" title="Pron" alt="" coords="133,457 132,451 129,446 123,441 116,439 108,438 99,439 92,441 86,446 83,451 82,457 83,462 86,468 92,472 99,475 108,475 116,475 123,472 129,468 132,462"/>
<area shape="rect" href="#PN" title="PN" alt="" coords="150,440,202,474"/>
<area shape="poly" href="#Det" title="Det" alt="" coords="270,457 269,451 265,446 260,441 252,439 244,438 237,439 229,441 224,446 220,451 219,457 220,462 224,468 229,472 237,475 244,475 252,475 260,472 265,468 269,462"/>
<area shape="poly" href="#CN" title="CN" alt="" coords="339,457 337,451 334,446 328,441 321,439 313,438 305,439 298,441 292,446 289,451 287,457 289,462 292,468 298,472 305,475 313,475 321,475 328,472 334,468 337,462"/>
<area shape="poly" href="#ListNP" title="ListNP" alt="" coords="420,457 419,451 414,446 407,441 398,439 388,438 378,439 369,441 362,446 358,451 356,457 358,462 362,468 369,472 378,475 388,475 398,475 407,472 414,468 419,462"/>
<area shape="poly" href="#AdV" title="AdV" alt="" coords="489,457 488,451 484,446 479,441 471,439 463,438 455,439 448,441 442,446 439,451 437,457 439,462 442,468 448,472 455,475 463,475 471,475 479,472 484,468 488,462"/>
<area shape="rect" href="#V" title="V,V2,V3,V*,V2*" alt="" coords="506,440,616,474"/>
<area shape="poly" href="#AP" title="AP" alt="" coords="685,457 684,451 680,446 674,441 667,439 659,438 651,439 644,441 639,446 635,451 634,457 635,462 639,468 644,472 651,475 659,475 667,475 674,472 680,468 684,462"/>
<area shape="poly" href="#Subj" title="Subj" alt="" coords="753,457 752,451 749,446 743,441 736,439 728,438 720,439 713,441 707,446 703,451 702,457 703,462 707,468 713,472 720,475 728,475 736,475 743,472 749,468 752,462"/>
<area shape="poly" href="#ListAdj" title="ListAdj" alt="" coords="837,457 836,451 831,446 824,441 814,439 804,438 794,439 784,441 777,446 772,451 770,457 772,462 777,468 784,472 794,475 804,475 814,475 824,472 831,468 836,462"/>
<area shape="poly" href="#Art" title="Art" alt="" coords="90,529 89,523 85,518 80,514 73,511 65,510 57,511 50,514 44,518 40,523 39,529 40,535 44,540 50,544 57,547 65,548 73,547 80,544 85,540 89,535"/>
<area shape="poly" href="#Quant" title="Quant" alt="" coords="166,529 165,523 161,518 154,514 146,511 137,510 128,511 120,514 113,518 109,523 108,529 109,535 113,540 120,544 128,547 137,548 146,547 154,544 161,540 165,535"/>
<area shape="poly" href="#Num" title="Num" alt="" coords="237,529 235,523 232,518 226,514 218,511 210,510 202,511 195,514 189,518 185,523 184,529 185,535 189,540 195,544 202,547 210,548 218,547 226,544 232,540 235,535"/>
<area shape="poly" href="#Ord" title="Ord" alt="" coords="305,529 304,523 300,518 295,514 288,511 280,510 272,511 265,514 259,518 255,523 254,529 255,535 259,540 265,544 272,547 280,548 288,547 295,544 300,540 304,535"/>
<area shape="rect" href="#N" title="N,N2,N3" alt="" coords="323,512,387,546"/>
<area shape="poly" href="#RS" title="RS" alt="" coords="456,529 454,523 451,518 445,514 438,511 430,510 422,511 415,514 409,518 406,523 404,529 406,535 409,540 415,544 422,547 430,548 438,547 445,544 451,540 454,535"/>
<area shape="poly" href="#Card" title="Card" alt="" coords="236,601 235,595 231,590 226,586 218,583 210,582 202,583 195,586 189,590 186,595 184,601 186,607 189,612 195,616 202,619 210,620 218,619 226,616 231,612 235,607"/>
<area shape="poly" href="#Numeral" title="Numeral,Digits" alt="" coords="216,674 214,668 206,662 194,658 179,656 162,655 145,656 130,658 118,662 110,668 107,674 110,679 118,685 130,689 145,691 162,692 179,691 194,689 206,685 214,679"/>
<area shape="poly" href="#AdN" title="AdN" alt="" coords="285,674 283,668 280,662 274,658 267,656 259,655 251,656 244,658 238,662 234,668 233,674 234,679 238,685 244,689 251,691 259,692 267,691 274,689 280,685 283,679"/>
<area shape="poly" href="#CAdv" title="CAdv" alt="" coords="288,746 286,740 282,735 276,731 268,728 259,727 250,728 242,731 235,735 231,740 230,746 231,752 235,757 242,761 250,764 259,765 268,764 276,761 282,757 286,752"/>
<area shape="poly" href="#RCl" title="RCl" alt="" coords="456,601 454,595 451,590 445,586 438,583 430,582 422,583 415,586 409,590 406,595 404,601 406,607 409,612 415,616 422,619 430,620 438,619 445,616 451,612 454,607"/>
<area shape="poly" href="#AdA" title="AdA" alt="" coords="617,529 615,523 612,518 606,514 599,511 591,510 583,511 576,514 570,518 566,523 565,529 566,535 570,540 576,544 583,547 591,548 599,547 606,544 612,540 615,535"/>
<area shape="rect" href="#A" title="A, A2" alt="" coords="634,512,685,546"/>
<area shape="poly" href="#ListAP" title="ListAP" alt="" coords="767,529 765,523 760,518 753,514 744,511 734,510 725,511 716,514 708,518 704,523 702,529 704,535 708,540 716,544 725,547 734,548 744,547 753,544 760,540 765,535"/>
<area shape="poly" href="#IP" title="IP" alt="" coords="895,384 894,379 890,373 885,369 877,366 870,366 862,366 854,369 849,373 845,379 844,384 845,390 849,395 854,400 862,402 870,403 877,402 885,400 890,395 894,390"/>
<area shape="poly" href="#IAdv" title="IAdv" alt="" coords="966,384 965,379 961,373 955,369 947,366 939,366 931,366 923,369 917,373 913,379 912,384 913,390 917,395 923,400 931,402 939,403 947,402 955,400 961,395 965,390"/>
<area shape="poly" href="#ClSlash" title="ClSlash" alt="" coords="1050,384 1048,379 1043,373 1036,369 1026,366 1016,366 1006,366 996,369 989,373 984,379 982,384 984,390 989,395 996,400 1006,402 1016,403 1026,402 1036,400 1043,395 1048,390"/>
<area shape="poly" href="#IDet" title="IDet" alt="" coords="906,457 904,451 901,446 895,441 888,439 880,438 872,439 865,441 859,446 856,451 854,457 856,462 859,468 865,472 872,475 880,475 888,475 895,472 901,468 904,462"/>
<area shape="poly" href="#VPSlash" title="VPSlash" alt="" coords="1052,457 1050,451 1045,446 1037,441 1027,439 1016,438 1005,439 995,441 987,446 982,451 980,457 982,462 987,468 995,472 1005,475 1016,475 1027,475 1037,472 1045,468 1050,462"/>
<area shape="poly" href="#IQuant" title="IQuant" alt="" coords="912,529 910,523 906,518 899,514 890,511 880,510 870,511 861,514 854,518 850,523 848,529 850,535 854,540 861,544 870,547 880,548 890,547 899,544 906,540 910,535"/>
<area shape="poly" href="#RP" title="RP" alt="" coords="456,674 454,668 451,662 445,658 438,656 430,655 422,656 415,658 409,662 406,668 404,674 406,679 409,685 415,689 422,691 430,692 438,691 445,689 451,685 454,679"/>
</map>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

19
doc/gfdoc/Makefile Normal file
View File

@@ -0,0 +1,19 @@
TMP=tmp.html
TEMPLATE=../synopsis/template.html
ROOT=../..
TITLE=$(shell head -n 1 sources.txt)
sources.html: sources.txt $(TEMPLATE)
txt2tags --target=html --no-headers --quiet --outfile=$@ --infile=$<
pandoc \
--from=html \
--to=html5 \
--standalone \
--template=$(TEMPLATE) \
--metadata='title:"$(TITLE)"' \
--variable='lang:en' \
--variable='rel-root:$(ROOT)/..' \
--output=$(TMP) \
$@
mv $(TMP) $@
sed -i.bak "s/<table>/<table class=\"table w-auto\">/" $@ && rm "$@.bak"

View File

@@ -1,183 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META NAME="generator" CONTENT="http://txt2tags.org">
<TITLE>More modules in the GF Resource Grammar Library</TITLE>
</HEAD><BODY BGCOLOR="white" TEXT="black">
<CENTER>
<H1>More modules in the GF Resource Grammar Library</H1>
</CENTER>
<P>
<A HREF="../synopsis.html">back to synopsis</A>
</P>
<H2>Extra syntax modules</H2>
<P>
These modules give language-specific extra constructs not available via the common API.
</P>
<P>
<A HREF="../../src/abstract/Extra.gf">common repository</A>
<A HREF="../../src/romance/ExtraRomanceAbs.gf">Romance (Cat, Fre, Ita, Spa)</A>
<A HREF="../../src/scandinavian/ExtraScandAbs.gf">Scandinavian (Dan, Nor, Swe)</A>
</P>
<P>
<A HREF="../../src/afrikaans/ExtraAfrAbs.gf">Afrikaans</A>
<A HREF="../../src/bulgarian/ExtraBulAbs.gf">Bulgarian</A>
<A HREF="../../src/catalan/ExtraCatAbs.gf">Catalan</A>
<A HREF="../../src/danish/ExtraDanAbs.gf">Danish</A>
<A HREF="../../src/dutch/ExtraDutAbs.gf">Dutch</A>
<A HREF="../../src/english/ExtraEngAbs.gf">English</A>
<A HREF="../../src/finnish/ExtraFinAbs.gf">Finnish</A>
<A HREF="../../src/french/ExtraFreAbs.gf">French</A>
<A HREF="../../src/german/ExtraGerAbs.gf">German</A>
<A HREF="../../src/italian/ExtraItaAbs.gf">Italian</A>
<A HREF="../../src/norwegian/ExtraNorAbs.gf">Norwegian</A>
<A HREF="../../src/persian/ExtraPesAbs.gf">Persian</A>
<A HREF="../../src/polish/ExtraPolAbs.gf">Polish</A>
<A HREF="../../src/punjabi/ExtraPnbAbs.gf">Punjabi</A>
<A HREF="../../src/romanian/ExtraRonAbs.gf">Romanian</A>
<A HREF="../../src/russian/ExtraRusAbs.gf">Russian</A>
<A HREF="../../src/spanish/ExtraSpaAbs.gf">Spanish</A>
<A HREF="../../src/swedish/ExtraSweAbs.gf">Swedish</A>
</P>
<H2>Irregular verbs and other words</H2>
<P>
These modules give lists of irregular words, mostly verbs. Their completeness varies.
</P>
<P>
<A HREF="../../src/catalan/IrregCatAbs.gf">Catalan</A>
<A HREF="../../src/danish/IrregDanAbs.gf">Danish</A>
<A HREF="../../src/dutch/IrregDutAbs.gf">Dutch</A>
<A HREF="../../src/english/IrregEngAbs.gf">English</A>
<A HREF="../../src/french/IrregFreAbs.gf">French</A>
<A HREF="../../src/german/IrregGerAbs.gf">German</A>
<A HREF="../../src/norwegian/IrregNorAbs.gf">Norwegian</A>
<A HREF="../../src/spanish/IrregSpaAbs.gf">Spanish</A>
<A HREF="../../src/swedish/IrregSweAbs.gf">Swedish</A>
<A HREF="../../src/turkish/IrregTurAbs.gf">Turkish</A>
</P>
<H2>Large-scale dictionaries</H2>
<P>
These morphological dictionaries are extracted from open source lexica by using the resource grammar paradigms. The figures give the approximate number of lemmas.
</P>
<P>
<A HREF="../../src/bulgarian/DictBulAbs.gf">Bulgarian</A> 53k
<A HREF="../../src/english/DictEngAbs.gf">English</A> 43k
<A HREF="../../src/finnish/DictFinAbs.gf">Finnish</A> 42k
<A HREF="../../src/french/DictFreAbs.gf">French</A> 92k
<A HREF="../../src/swedish/DictSweAbs.gf">Swedish</A> 43k
<A HREF="../../src/turkish/DictTurAbs.gf">Turkish</A> 24k
</P>
<H2>Abstract Syntax Modules</H2>
<P>
These modules are for internal use of resource grammarians, but the comments give some more linguistic explanation of the different constructs.
</P>
<TABLE BORDER="1" CELLPADDING="4">
<TR>
<TH>module</TH>
<TH>contents</TH>
</TR>
<TR>
<TD><A HREF="Adjective.html">Adjective</A></TD>
<TD>constructors for A, AP</TD>
</TR>
<TR>
<TD><A HREF="Adverb.html">Adverb</A></TD>
<TD>constructors for Adv, AdV</TD>
</TR>
<TR>
<TD><A HREF="Cat.html">Cat</A></TD>
<TD>lincats of all categories</TD>
</TR>
<TR>
<TD><A HREF="Common.html">Common</A></TD>
<TD>default lincats for string categories</TD>
</TR>
<TR>
<TD><A HREF="Conjunction.html">Conjunction</A></TD>
<TD>coordination rules</TD>
</TR>
<TR>
<TD><A HREF="Extra.html">Extra</A></TD>
<TD>constructs available in some languages only</TD>
</TR>
<TR>
<TD><A HREF="Grammar.html">Grammar</A></TD>
<TD>everything except content lexicon</TD>
</TR>
<TR>
<TD><A HREF="Idiom.html">Idiom</A></TD>
<TD>idiomatic constructions</TD>
</TR>
<TR>
<TD><A HREF="Lang.html">Lang</A></TD>
<TD>everything (Grammar and Lexicon)</TD>
</TR>
<TR>
<TD><A HREF="Lexicon.html">Lexicon</A></TD>
<TD>content word lexicon</TD>
</TR>
<TR>
<TD><A HREF="Noun.html">Noun</A></TD>
<TD>constructors for NP, CN, Det</TD>
</TR>
<TR>
<TD><A HREF="Numeral.html">Numeral</A></TD>
<TD>constructors for Numeral and Digits</TD>
</TR>
<TR>
<TD><A HREF="Phrase.html">Phrase</A></TD>
<TD>constructors for Phr, Utt</TD>
</TR>
<TR>
<TD><A HREF="Question.html">Question</A></TD>
<TD>constructors for QS, QCl, IP</TD>
</TR>
<TR>
<TD><A HREF="Relative.html">Relative</A></TD>
<TD>constructors for RS, RCl, RP</TD>
</TR>
<TR>
<TD><A HREF="Sentence.html">Sentence</A></TD>
<TD>constructors for S, Cl, SC</TD>
</TR>
<TR>
<TD><A HREF="Structural.html">Structural</A></TD>
<TD>structural word lexicon</TD>
</TR>
<TR>
<TD><A HREF="Symbol.html">Symbol</A></TD>
<TD>mixtures of verbal and symbolic expressions</TD>
</TR>
<TR>
<TD><A HREF="Tense.html">Tense</A></TD>
<TD>common API tense system</TD>
</TR>
<TR>
<TD><A HREF="Text.html">Text</A></TD>
<TD>constructors for Tex</TD>
</TR>
<TR>
<TD><A HREF="Verb.html">Verb</A></TD>
<TD>constructors for VP, VPSlash, Comp</TD>
</TR>
</TABLE>
<H2>The Module Dependency Tree</H2>
<P>
<IMG ALIGN="middle" SRC="Syntax.png" BORDER="0" ALT="">
</P>
<!-- html code generated by txt2tags 2.6 (http://txt2tags.org) -->
<!-- cmdline: txt2tags -thtml sources.txt -->
</BODY></HTML>

View File

@@ -3,7 +3,7 @@ More modules in the GF Resource Grammar Library
[back to synopsis ../synopsis.html]
[Back to synopsis ../synopsis/index.html]
==Extra syntax modules==
@@ -93,8 +93,3 @@ These modules are for internal use of resource grammarians, but the comments giv
==The Module Dependency Tree==
[Syntax.png]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 KiB

View File

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

View File

@@ -1,35 +0,0 @@
Afrikaans
Amharic
Arabic
Bulgarian
Catalan
Chinese
Danish
Dutch
English
Finnish
French
German
Greek
Hebrew
Hindi
Interlingua
Japanese
Italian
Latin
Latvian
<li>Maltese
Nepali
Norwegian
Persian
Polish
Punjabi
Romanian
Russian
Sindhi
Spanish
Swahili
Swedish
Thai
Turkish
Urdu

View File

@@ -3,7 +3,7 @@ Aarne Ranta
%!Encoding:utf8
%!style(html): ../revealpopup.css
%!style(html): revealpopup.css
%!postproc(tex) : "#BECE" "begin{center}"
%!postproc(html) : "#BECE" "<center>"
@@ -377,5 +377,3 @@ and the ``Num`` //five//. It is also common that a "structural word" in a partic
a feature of the other words it combines with, rather than as a word of its own. For instance,
the determiner //the// in Swedish just selects an inflectional form of the noun that it is applied to:
"the" + //bil// = //bilen// ("the car").

View File

@@ -24,6 +24,9 @@ table { border-collapse: collapse; }
td, th { padding: 5px; }
th { background: #9df; }
td { background: white }
h1,h2,h3,h4 { font-family: sans-serif; color: #303030;
text-shadow: rgba(0,0,0,0.25) 2px 2px 5px;
}
/* Quick links */

View File

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

View File

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

View File

@@ -1,109 +0,0 @@
// Find an element with a certain tag containing a certain text.
function findElement(tagname,text) {
var els=document.body.getElementsByTagName(tagname)
for(var i=0;i<els.length;i++)
if(els[i].innerText==text) return els[i]
return null
}
function text(s) { return document.createTextNode(s); }
function appendChildren(n,ds) {
if(Array.isArray(ds)) for(var i in ds) n.appendChild(ds[i]);
else if(typeof ds=="string")
n.appendChild(text(ds))
else
n.appendChild(ds)
}
function node(tag,cls,ds) {
var n=document.createElement(tag)
if(cls) n.className=cls
if(ds) appendChildren(n,ds)
return n
}
function a(href,txt) {
var a=node("a","",txt)
a.href=href
return a
}
function tr(ds) { return node("tr","",ds) }
function th(d) { return node("th","",d) }
function td(d) { return node("td","",d) }
function forAllLinks(list,f) {
for(var i=0;i<list.length;i++) {
var c=list[i].firstElementChild
if(c && c.tagName=="A" && c.href) f(c)
}
}
/* -------------------------------------------------------------------------- */
// Extract links to the syntax rules
function listrules(ul) {
var rules=[]
if(ul.tagName!="UL") return []
forAllLinks(ul.children,function(c) {
rules.push({href:c.href,text:c.innerText.split(" -")[0],
full:c.innerText})
})
return rules
}
// Extract the links to the paradigm sections for all the languages
function listlangs(ul) {
var langs=[]
if(ul.tagName!="UL") return []
forAllLinks(ul.children,function(c) {
if(/^Paradigms for /.test(c.innerText))
langs.push({href:c.href,text:c.innerText.substr(14),
full:c.innerText})
})
return langs
}
function linklist(links) {
var d=node("td","quicklinks")
for(var i=0;i<links.length;i++) {
var l=a(links[i].href,links[i].text)
l.title=links[i].full
d.appendChild(l)
}
return d
}
function quicklinks() {
// Find the detailed table of contents
var h1toc=findElement("h1","Table of Contents")
var ultoc=h1toc.nextElementSibling
while(ultoc && ultoc.tagName!="UL") ultoc=ultoc.nextElementSibling
var lis=ultoc.children
var syntaxrules=[],langs=[]
// Find the Syntax Rules and Lexical Paradigms sections in the toc
for(var i=0;i<lis.length;i++) {
var li=lis[i],c=li.firstElementChild
if(c.tagName=="A") {
if(/^Syntax Rules /.test(c.innerText))
syntaxrules=listrules(c.nextElementSibling)
else if(c.innerText=="Lexical Paradigms")
langs=listlangs(c.nextElementSibling)
}
}
var table=node("table","quicklinks",
[tr([th("Syntax"),th("Morphology")]),
tr([linklist(syntaxrules),linklist(langs)])])
return node("div","quicklinks",
[text("Quick links"),
node("div","expand",table)])
}
document.body.appendChild(quicklinks())

View File

@@ -1,529 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META NAME="generator" CONTENT="http://txt2tags.org">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf8">
<LINK REL="stylesheet" TYPE="text/css" HREF="../../css/style.css">
<TITLE>GF Resource Grammar Library Documentation and Publications</TITLE>
</HEAD><BODY BGCOLOR="white" TEXT="black">
<CENTER>
<H1>GF Resource Grammar Library Documentation and Publications</H1>
<FONT SIZE="4"><I>Aarne Ranta</I></FONT><BR>
<FONT SIZE="4">20170119</FONT>
</CENTER>
<P>
<I>To be completed. Contributions welcome - in particular, links to open access publications!</I>
</P>
<H3>Afrikaans</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/afrikaans">http://www.grammaticalframework.org/lib/src/afrikaans</A> (Laurette Pretorius, Laurette Marais)
</UL>
<H3>Amharic</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/amharic">http://www.grammaticalframework.org/lib/src/amharic</A> (Markos Kassa Gobena)
<P></P>
<LI><B>Publications</B>
<P></P>
Markos Kassa Gobena.
<I>Implementing and Open Source Amharic Resource Grammar in GF</I>,
MSc thesis, Chalmers University, 2010.
<A HREF="http://publications.lib.chalmers.se/records/fulltext/146295.pdf">http://publications.lib.chalmers.se/records/fulltext/146295.pdf</A>
</UL>
<H3>Arabic</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/arabic">http://www.grammaticalframework.org/lib/src/arabic</A> (Ali El Dada)
<P></P>
<LI><B>Publications</B>
<P></P>
Ali El Dada.
<I>Arabic Resource Grammar in GF</I>, MSc Thesis, Chalmers University, 2006.
<P></P>
A. El Dada and A. Ranta.
Implementing an Open Source Arabic Resource Grammar in GF.
In M. Mughazy (ed),
<I>Perspectives on Arabic Linguistics XX. Papers from the Twentieth Annual Symposium on Arabic Linguistics, Kalamazoo, March 26</I>
John Benjamins Publishing Company.
2007.
<br>
<I>An outline of the Arabic resource grammar project, focusing on linguistic aspects.</I>
<P></P>
A. El Dada.
Implementation of the Arabic Numerals and their Syntax in GF.
Computational Approaches to Semitic Languages: Common Issues and Resources,
ACL-2007 Workshop,
June 28, 2007, Prague.
2007.
<A HREF="http://acl.ldc.upenn.edu/W/W07/W07-08.pdf">http://acl.ldc.upenn.edu/W/W07/W07-08.pdf</A>
<br>
<I>A case study with the resource grammar, focusing on the morphosyntax</I>
<I>and agreement of constructions with numerals.</I>
</UL>
<H3>Bulgarian</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/bulgarian">http://www.grammaticalframework.org/lib/src/bulgarian</A> (Krasimir Angelov)
<P></P>
<LI><B>Publications</B>
<P></P>
K. Angelov.
Type-Theoretical Bulgarian Grammar.
In B. Nordström and A. Ranta (eds),
<I>Advances in Natural Language Processing (GoTAL 2008)</I>,
LNCS/LNAI 5221, Springer,
2008.
<A HREF="http://link.springer.com/chapter/10.1007%2F978-3-540-85287-2_6">http://link.springer.com/chapter/10.1007%2F978-3-540-85287-2_6</A>
<br>
<I>Explains the implementation of a Bulgarian resource grammar in GF.</I>
</UL>
<H3>Catalan</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/catalan">http://www.grammaticalframework.org/lib/src/catalan</A> <A HREF="http://www.grammaticalframework.org/lib/src/romance">http://www.grammaticalframework.org/lib/src/romance</A> (Jordi Saludes, Inari Listenmaa)
</UL>
<H3>Chinese</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/chinese">http://www.grammaticalframework.org/lib/src/chinese</A> (Aarne Ranta, Zhuo Lin Qiqige, Chen Peng, Qiao Haiyan)
<P></P>
<LI><B>Publications</B>
<P></P>
Chen Peng,
Implementation of a Chinese Resource Grammar in Grammatical Framework.
<I>International Journal of Knowledge and Language Processing</I>,
4(1),
2013,
pp. 26-34.
<A HREF="http://www.ijklp.org/archives/vol4no1/Implementation%20of%20Chinese%20Resource%20Grammar%20in%20Grammatical%20Framework.pdf">http://www.ijklp.org/archives/vol4no1/Implementation%20of%20Chinese%20Resource%20Grammar%20in%20Grammatical%20Framework.pdf</A>
<P></P>
Aarne Ranta.
Grammatical Framework and Chinese.
Appendix to the GF book (A. Ranta, <I>Grammatical Framework</I>, CSLI 2011),
2012.
<A HREF="http://www.grammaticalframework.org/gf-book/gf-chinese-appendix.pdf">http://www.grammaticalframework.org/gf-book/gf-chinese-appendix.pdf</A>
</UL>
<H3>Danish</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/danish">http://www.grammaticalframework.org/lib/src/danish</A> <A HREF="http://www.grammaticalframework.org/lib/src/scandinavian">http://www.grammaticalframework.org/lib/src/scandinavian</A> (Aarne Ranta)
</UL>
<H3>Dutch</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/dutch">http://www.grammaticalframework.org/lib/src/dutch</A> (Aarne Ranta, Femke Johansson)
</UL>
<H3>English</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/english">http://www.grammaticalframework.org/lib/src/english</A> (Aarne Ranta, Björn Bringert, Krasimir Angelov)
<P></P>
<LI><B>Publications</B>
<P></P>
A. Ranta.
The GF Resource Grammar Library.
<I>Linguistic Issues in Language Technology</I>,
2 (2),
2009.
<A HREF="http://elanguage.net/journals/index.php/lilt/article/viewFile/214/158">PDF</A>
<br>
<I>A systematic presentation of the library from the linguistic point of view.</I>
<I>Not only about English, but English examples abound.</I>
</UL>
<H3>Estonian</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/estonian">http://www.grammaticalframework.org/lib/src/estonian</A> (Kaarel Kaljurand, Inari Listenmaa)
</UL>
<H3>Finnish</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/finnish">http://www.grammaticalframework.org/lib/src/finnish</A> (Aarne Ranta, Inari Listenmaa)
<P></P>
<LI><B>Publications</B>
<P></P>
A. Ranta.
On the Syntax and Translation of Finnish Discourse Clitics.
In D. Santos, K. Lindén and W. Ng'ang'a (eds),
<I>Shall We Play the Festschrift Game?</I>
<I>Essays on the Occasion of Lauri Carlson's 60th Birthday</I>.
Springer, Heidelberg, 2012.
pp. 227-241.
<A HREF="http://link.springer.com/chapter/10.1007/978-3-642-30773-7_14">http://link.springer.com/chapter/10.1007/978-3-642-30773-7_14</A>
draft version <A HREF="http://www.cse.chalmers.se/~aarne/articles/discourse-clitics.pdf">http://www.cse.chalmers.se/~aarne/articles/discourse-clitics.pdf</A>
<P></P>
A. Ranta.
How predictable is Finnish morphology? An experiment on lexicon construction.
In J. Nivre, M. Dahllöf and B. Megyesi (eds),
<I>Resourceful Language Technology: Festschrift in Honor of Anna Sågvall Hein</I>,
University of Uppsala,
2008.
<A HREF="http://publications.uu.se/abstract.xsql?dbid=8933">http://publications.uu.se/abstract.xsql?dbid=8933</A>
<br>
<I>Presents an experiment on smart paradigms in Finnish.</I>
</UL>
<H3>French</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/french">http://www.grammaticalframework.org/lib/src/french</A> <A HREF="http://www.grammaticalframework.org/lib/src/romance">http://www.grammaticalframework.org/lib/src/romance</A> (Aarne Ranta, Ramona Enache)
</UL>
<H3>German</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/german">http://www.grammaticalframework.org/lib/src/german</A> (Aarne Ranta, Harald Hammarström, Erzsébet Galgóczy)
</UL>
<H3>Greek</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/greek">http://www.grammaticalframework.org/lib/src/greek</A> (Ioanna Papadopoulou)
<P></P>
<LI><B>Publications</B>
<P></P>
Ioanna Papadopoulou.
GF Modern Greek Resource Grammar,
MA thesis, University of Gothenburg,
2013.
<P></P>
Ioanna Papadopoulou.
GF Modern Greek Resource Grammar.
RANLP 2013.
</UL>
<H3>Hebrew</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/hebrew">http://www.grammaticalframework.org/lib/src/hebrew</A> (Dana Dannélls)
<P></P>
<LI><B>Publications</B>
<P></P>
D. Dannélls and J. Camilleri.
Verb Morphology of Hebrew and Maltese - Towards an Open Source Type Theoretical Resource Grammar in GF.
<I>Proceedings of the Language Resources (LRs) and Human Language Technologies (HLT) for Semitic Languages Status, Updates, and Prospects, LREC-2010 Workshop</I>,
Malta, pp. 57-61.
2010.
<A HREF="http://spraakdata.gu.se/svedd/pub/lrec10.pdf">http://spraakdata.gu.se/svedd/pub/lrec10.pdf</A>
</UL>
<H3>Hindi</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/hindi">http://www.grammaticalframework.org/lib/src/hindi</A> <A HREF="http://www.grammaticalframework.org/lib/src/hindustani">http://www.grammaticalframework.org/lib/src/hindustani</A> (Shafqat Virk, K.V.S. Prasad, Muhammad Humayoun, Aarne Ranta)
<P></P>
<LI><B>Publications</B>
<P></P>
Shafqat Virk.
<I>Computational Linguistics Resources for Indo-Iranian Languages</I>,
PhD Thesis, University of Gothenburg, 2013.
<A HREF="http://www.cse.chalmers.se/~virk/shafqat-phd-thesis.pdf">http://www.cse.chalmers.se/~virk/shafqat-phd-thesis.pdf</A>
<P></P>
K.V.S. Prasad and Shafqat Virk.
Computational evidence that
Hindi and Urdu share a grammar but not the lexicon.
In The 3rd Workshop
on South and Southeast Asian NLP, COLING 2012. <I>Reprinted in Shafqat's thesis</I>
</UL>
<H3>Icelandic</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/icelandic">http://www.grammaticalframework.org/lib/src/icelandic</A> (Bjarki Traustason)
<P></P>
<B>Publications</B>
<P></P>
Bjarki Traustason, MSc thesis, Chalmers
</UL>
<H3>Interlingua</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/interlingua">http://www.grammaticalframework.org/lib/src/interlingua</A> (Jean-Philippe Bernardy)
</UL>
<H3>Italian</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/italian">http://www.grammaticalframework.org/lib/src/italian</A> <A HREF="http://www.grammaticalframework.org/lib/src/romance">http://www.grammaticalframework.org/lib/src/romance</A> (Aarne Ranta, Ramona Enache, Gabriele Paganelli)
</UL>
<H3>Japanese</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/japanese">http://www.grammaticalframework.org/lib/src/japanese</A> (Liza Zimina)
<P></P>
<LI><B>Publications</B>
<P></P>
Elizaveta Zimina.
GF Japanese Resource Grammar,
MA Thesis, University of Gothenburg,
2012.
<A HREF="http://www.ling.gu.se/~lager/MLT/zimina_thesis_draft.pdf">http://www.ling.gu.se/~lager/MLT/zimina_thesis_draft.pdf</A>
<P></P>
Elizaveta Zimina.
Fitting a Round Peg in a Square Hole: Japanese Resource Grammar in GF.
<I>Advances in Natural Language Processing (JapTAL-2012)</I>
Lecture Notes in Computer Science Volume 7614, 2012, pp 156-167.
<A HREF="http://link.springer.com/chapter/10.1007%2F978-3-642-33983-7_16">http://link.springer.com/chapter/10.1007%2F978-3-642-33983-7_16</A>
</UL>
<H3>Latin</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/latin">http://www.grammaticalframework.org/lib/src/latin</A> (Aarne Ranta)
</UL>
<H3>Latvian</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/latvian">http://www.grammaticalframework.org/lib/src/latvian</A> (Normunds Gruzitis, Peter Paikens)
<P></P>
<LI><B>Publications</B>
P. Paikens and N. Gruzitis.
An implementation of a Latvian resource grammar in Grammatical Framework,
LREC 2012, pp. 1680-1685.
<A HREF="http://lrec.elra.info/proceedings/lrec2012/pdf/976_Paper.pdf">http://lrec.elra.info/proceedings/lrec2012/pdf/976_Paper.pdf</A>
</UL>
<H3>Maltese</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/maltese">http://www.grammaticalframework.org/lib/src/maltese</A> (John J. Camilleri)
<P></P>
<LI><B>Publications</B>
<P></P>
John J. Camilleri,
MSc thesis, Chalmers University of Technology, 2013.
<P></P>
John J. Camilleri.
A computational grammar for Maltese: Talk at the 4th International Conference on Maltese Linguistics (GĦILM 2013). Lyon, France, 2013.
<A HREF="http://academic.johnjcamilleri.com/presentations/2013-06%20G%C4%A6ILM%201.pdf">http://academic.johnjcamilleri.com/presentations/2013-06%20G%C4%A6ILM%201.pdf</A>
<P></P>
D. Dannélls and J. Camilleri.
Verb Morphology of Hebrew and Maltese - Towards an Open Source Type Theoretical Resource Grammar in GF.
<I>Proceedings of the Language Resources (LRs) and Human Language Technologies (HLT) for Semitic Languages Status, Updates, and Prospects, LREC-2010 Workshop</I>,
Malta, pp. 57-61.
2010.
<A HREF="http://spraakdata.gu.se/svedd/pub/lrec10.pdf">http://spraakdata.gu.se/svedd/pub/lrec10.pdf</A>
</UL>
<H3>Nepali</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/nepali">http://www.grammaticalframework.org/lib/src/nepali</A> (Dinesh Simk)
<P></P>
<LI><B>Publications</B>
<P></P>
Dinesh Simk.
Implementing the GF Resource Grammar for Nepali Language,
MSc thesis, Chalmers University of Technology,
2012.
<A HREF="http://publications.lib.chalmers.se/records/fulltext/161384.pdf">http://publications.lib.chalmers.se/records/fulltext/161384.pdf</A>
</UL>
<H3>Norwegian (bokmål)</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/norwegian">http://www.grammaticalframework.org/lib/src/norwegian</A> <A HREF="http://www.grammaticalframework.org/lib/src/scandinavian">http://www.grammaticalframework.org/lib/src/scandinavian</A> (Aarne Ranta)
</UL>
<H3>Norwegian (nynorsk)</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/nynorsk">http://www.grammaticalframework.org/lib/src/nynorsk</A> (Stian Rødven Eide) <A HREF="http://www.grammaticalframework.org/lib/src/scandinavian">http://www.grammaticalframework.org/lib/src/scandinavian</A> (Aarne Ranta)
</UL>
<H3>Persian</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/persian">http://www.grammaticalframework.org/lib/src/persian</A> (Shafqat Virk, Elnaz Abolahrar, Sofy Moradi)
<P></P>
<LI><B>Publications</B>
<P></P>
Shafqat Mumtaz Virk and Elnaz Abolahrar.
An Open Source Persian Computational Grammar,
LREC 2012, pp. 1686-1693.
<A HREF="http://www.lrec-conf.org/proceedings/lrec2012/pdf/1028_Paper.pdf">http://www.lrec-conf.org/proceedings/lrec2012/pdf/1028_Paper.pdf</A>
</UL>
<H3>Polish</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/polish">http://www.grammaticalframework.org/lib/src/polish</A> (Adam Slaski, Ilona Novak)
<P></P>
<LI><B>Publications</B>
<P></P>
Adam Slaski.
Some Interesting Features of the Polish Language in Grammatical Framework.
Slide presentation, TYPES 2010, Warsaw,
2010.
<A HREF="http://www.mimuw.edu.pl/~asl/publications/types2010-slides.pdf">http://www.mimuw.edu.pl/~asl/publications/types2010-slides.pdf</A>
</UL>
<H3>Punjabi</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/punjabi">http://www.grammaticalframework.org/lib/src/punjabi</A> (Shafqat Virk, Muhammad Humayoun)
<P></P>
<LI><B>Publications</B>
<P></P>
S. Virk, M. Humayoun, and A. Ranta.
An Open-Source Punjabi Resource Grammar.
Proceedings of RANLP-2011, Recent Advances in Natural Language Processing,
Hissar, Bulgaria, 12-14 September, 2011.
pp. 70-76.
<A HREF="http://lml.bas.bg/~iva/ranlp2011/RANLR2011_Proceedings.PDF">http://lml.bas.bg/~iva/ranlp2011/RANLR2011_Proceedings.PDF</A>
<P></P>
M. Humayoun and A. Ranta.
Developing Punjabi Morphology, Corpus and Lexicon.
<I>The 24th Pacific Asia conference on Language, Information and Computation (PACLIC24)</I>,
2010.
</UL>
<H3>Romanian</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/romanian">http://www.grammaticalframework.org/lib/src/romanian</A> (Ramona Enache)
<P></P>
<LI><B>Publications</B>
<P></P>
R. Enache, A. Ranta, and K. Angelov.
An Open-Source Computational Grammar of Romanian.
A. Gelbukh (ed.), <I>CiCLING-2010</I>,
LNCS 6008,
2010.
</UL>
<H3>Russian</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/russian">http://www.grammaticalframework.org/lib/src/russian</A> (Janna Khegai, Nikita Frolov)
<P></P>
<LI><B>Publications</B>
<P></P>
J. Khegai.
GF parallel resource grammars and Russian.
In proceedings of ACL2006
(The joint conference of the International Committee on Computational
Linguistics and the Association for Computational Linguistics) (pp. 475-482),
Sydney, Australia, July 2006.
<P></P>
J. Khegai and A. Ranta.
Building and Using a Russian Resource Grammar in GF.
In A. Gelbukh (ed),
<I>Intelligent Text Processing and Computational Linguistics (CICLing-2004)</I>,
Seoul, Korea, February 2003,
Springer LNCS 945,
pp. 38-41,
2004.
</UL>
<H3>Sindhi</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/sindhi">http://www.grammaticalframework.org/lib/src/sindhi</A> (Jherna Devi Oad)
<P></P>
<LI><B>Publications</B>
<P></P>
Jherna Devi Oad.
Implementing GF Resource Grammar for Sindhi language,
MSc Thesis, Chalmers University of Technology,
2012.
<A HREF="http://publications.lib.chalmers.se/records/fulltext/163234.pdf">http://publications.lib.chalmers.se/records/fulltext/163234.pdf</A>
</UL>
<H3>Spanish</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/spanish">http://www.grammaticalframework.org/lib/src/spanish</A> <A HREF="http://www.grammaticalframework.org/lib/src/romance">http://www.grammaticalframework.org/lib/src/romance</A>
(Aarne Ranta, Ingrid Andersson, Therese Söderberg, Inari Listenmaa)
</UL>
<H3>Swahili</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/swahili">http://www.grammaticalframework.org/lib/src/swahili</A> (Wanjiku Ng'ang'a)
</UL>
<UL>
<LI><B>Publications</B>
<P></P>
Wanjiku Ng'ng'a.
Building Swahili Resource Grammars for the Grammatical Framework,
In D. Santos, K. Lindén and W. Ng'ang'a (eds),
<I>Shall We Play the Festschrift Game?</I>
<I>Essays on the Occasion of Lauri Carlson's 60th Birthday</I>.
Springer, Heidelberg, 2012.
pp. 227-241.
<A HREF="http://link.springer.com/chapter/10.1007/978-3-642-30773-7_13">http://link.springer.com/chapter/10.1007/978-3-642-30773-7_13</A>
</UL>
<H3>Swedish</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/swedish">http://www.grammaticalframework.org/lib/src/swedish</A> <A HREF="http://www.grammaticalframework.org/lib/src/scandinavian">http://www.grammaticalframework.org/lib/src/scandinavian</A> (Aarne Ranta, Malin Ahlberg, Markus Forsberg)
<P></P>
<LI><B>Publications</B>
<P></P>
Malin Ahlberg.
<I>Towards a Wide-Coverage Grammar for Swedish Using GF</I>,
MSc thesis, University of Gothenburg,
2012.
<A HREF="https://gupea.ub.gu.se/bitstream/2077/28838/1/gupea_2077_28838_1.pdf">https://gupea.ub.gu.se/bitstream/2077/28838/1/gupea_2077_28838_1.pdf</A>
<P></P>
Malin Ahlberg and Ramona Enache.
A Type-Theoretical Wide-Coverage Computational Grammar for Swedish.
P. Sojka et al (eds), TSD 2012, LNCS 7499, pp. 183-190.
<A HREF="http://link.springer.com/content/pdf/10.1007%2F978-3-642-32790-2_22.pdf">http://link.springer.com/content/pdf/10.1007%2F978-3-642-32790-2_22.pdf</A>
</UL>
<H3>Thai</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/thai">http://www.grammaticalframework.org/lib/src/thai</A> (Aarne Ranta, Chotiros Kairoje)
</UL>
<H3>Turkish</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/turkish">http://www.grammaticalframework.org/lib/src/turkish</A> (Server Cimen)
</UL>
<H3>Urdu</H3>
<UL>
<LI><B>Source</B>: <A HREF="http://www.grammaticalframework.org/lib/src/urdu">http://www.grammaticalframework.org/lib/src/urdu</A> <A HREF="http://www.grammaticalframework.org/lib/src/hindustani">http://www.grammaticalframework.org/lib/src/hindustani</A> (Shafqat Virk, Muhamman Humayoun)
<P></P>
<LI><B>Publications</B>
<P></P>
S. Virk, M. Humayoun, and A. Ranta.
An Open Source Urdu Resource Grammar.
<I>Proceedings of the 8th Workshop on Asian Language Resources (Coling 2010 workshop)</I>,
2010.
<P></P>
M. Humayoun, H. Hammarström, and A. Ranta.
Urdu Morphology, Orthography and Lexicon Extraction.
<I>CAASL-2: The Second Workshop on Computational Approaches to Arabic Script-based Languages</I>,
July 21-22, 2007, LSA 2007 Linguistic Institute, Stanford University.
2007.
<P></P>
See also <B>Hindi</B> above.
</UL>
<!-- html code generated by txt2tags 2.6 (http://txt2tags.org) -->
<!-- cmdline: txt2tags -thtml rgl-publications.txt -->
</BODY></HTML>

View File

@@ -1,862 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META NAME="generator" CONTENT="http://txt2tags.org">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf8">
<TITLE>The Status of the GF Resource Grammar Library</TITLE>
</HEAD><BODY BGCOLOR="white" TEXT="black">
<CENTER>
<H1>The Status of the GF Resource Grammar Library</H1>
<FONT SIZE="4"><I>Aarne Ranta</I></FONT><BR>
<FONT SIZE="4">20170119</FONT>
</CENTER>
<P>
The following table gives the languages currently available in the
GF Resource Grammar Library.
</P>
<P>
For another view, see the
<A HREF="http://www.postcrashgames.com/gf_world/">The Resource Grammar Library coverage map</A> .
</P>
<P>
Corrections and additions are welcome! Notice that only those parts of implementations
that are currently available via <A HREF="http://grammaticalframework.org">http://grammaticalframework.org</A>
are marked in the table
</P>
<TABLE BORDER="1" CELLPADDING="4">
<TR>
<TH>ISO</TH>
<TH>Language</TH>
<TH>Darcs</TH>
<TH>Mini</TH>
<TH>Parad</TH>
<TH>Lex</TH>
<TH>Lang</TH>
<TH>API</TH>
<TH>Symb</TH>
<TH>Irreg</TH>
<TH>Dict</TH>
<TH>Trans</TH>
<TH>tested</TH>
<TH>publ</TH>
<TH COLSPAN="2">authors</TH>
</TR>
<TR>
<TD>Afr</TD>
<TD>Afrikaans</TD>
<TD>+</TD>
<TD>-</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>*LP,LM</TD>
</TR>
<TR>
<TD>Amh</TD>
<TD>Amharic</TD>
<TD>+</TD>
<TD>+</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>*MK</TD>
</TR>
<TR>
<TD>Ara</TD>
<TD>Arabic</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>AD</TD>
</TR>
<TR>
<TD>Bul</TD>
<TD>Bulgarian</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>++</TD>
<TD>+</TD>
<TD>*KA</TD>
</TR>
<TR>
<TD>Cat</TD>
<TD>Catalan</TD>
<TD>+</TD>
<TD>+</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>+</TD>
<TD>++</TD>
<TD>-</TD>
<TD>*JS,*IL</TD>
</TR>
<TR>
<TD>Chi</TD>
<TD>Chinese</TD>
<TD>+</TD>
<TD>-</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>+</TD>
<TD>ZL,*AR,*CP,QH</TD>
</TR>
<TR>
<TD>Dan</TD>
<TD>Danish</TD>
<TD>+</TD>
<TD>+</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>-</TD>
<TD>*AR</TD>
</TR>
<TR>
<TD>Dut</TD>
<TD>Dutch</TD>
<TD>+</TD>
<TD>+</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>*AR,FJ</TD>
</TR>
<TR>
<TD>Eng</TD>
<TD>English</TD>
<TD>+</TD>
<TD>+</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>++</TD>
<TD>+</TD>
<TD>*AR,BB,KA</TD>
</TR>
<TR>
<TD>Est</TD>
<TD>Estonian</TD>
<TD>+</TD>
<TD>-</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>+</TD>
<TD>*KK,*IL</TD>
</TR>
<TR>
<TD>Fin</TD>
<TD>Finnish</TD>
<TD>+</TD>
<TD>+</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>+</TD>
<TD>+</TD>
<TD>++</TD>
<TD>+</TD>
<TD>*AR,*IL</TD>
</TR>
<TR>
<TD>Fre</TD>
<TD>French</TD>
<TD>+</TD>
<TD>+</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>++</TD>
<TD>-</TD>
<TD>*AR,RE</TD>
</TR>
<TR>
<TD>Ger</TD>
<TD>German</TD>
<TD>+</TD>
<TD>+</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>++</TD>
<TD>-</TD>
<TD>*AR,HH,EG</TD>
</TR>
<TR>
<TD>Gre</TD>
<TD>Greek(mod)</TD>
<TD>+</TD>
<TD>-</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>*IP</TD>
</TR>
<TR>
<TD>Grc</TD>
<TD>Greek(anc)</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>*HLe</TD>
</TR>
<TR>
<TD>Heb</TD>
<TD>Hebrew</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>*DD</TD>
</TR>
<TR>
<TD>Hin</TD>
<TD>Hindi</TD>
<TD>+</TD>
<TD>+</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>*SV,*KP,MH,AR,PK</TD>
</TR>
<TR>
<TD>Ice</TD>
<TD>Icelandic</TD>
<TD>+</TD>
<TD>-</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>*BT</TD>
</TR>
<TR>
<TD>Ina</TD>
<TD>Interlingua</TD>
<TD>+</TD>
<TD>+</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>JB</TD>
</TR>
<TR>
<TD>Ita</TD>
<TD>Italian</TD>
<TD>+</TD>
<TD>+</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>++</TD>
<TD>-</TD>
<TD>*AR,*RE,GP</TD>
</TR>
<TR>
<TD>Jpn</TD>
<TD>Japanese</TD>
<TD>+</TD>
<TD>-</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>*LZ</TD>
</TR>
<TR>
<TD>Lat</TD>
<TD>Latin</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>*AR,*HLa</TD>
</TR>
<TR>
<TD>Lav</TD>
<TD>Latvian</TD>
<TD>+</TD>
<TD>-</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>+</TD>
<TD>*NG,*PP</TD>
</TR>
<TR>
<TD>Mlt</TD>
<TD>Maltese</TD>
<TD>+</TD>
<TD>+</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>*JC</TD>
</TR>
<TR>
<TD>Mon</TD>
<TD>Mongolian</TD>
<TD>+</TD>
<TD>-</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>*NE</TD>
</TR>
<TR>
<TD>Nep</TD>
<TD>Nepali</TD>
<TD>+</TD>
<TD>+</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>*DS</TD>
</TR>
<TR>
<TD>Nno</TD>
<TD>Norwegian(n)</TD>
<TD>+</TD>
<TD>+</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>*SRE</TD>
</TR>
<TR>
<TD>Nor</TD>
<TD>Norwegian(b)</TD>
<TD>+</TD>
<TD>+</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>-</TD>
<TD>*AR</TD>
</TR>
<TR>
<TD>Pes</TD>
<TD>Persian</TD>
<TD>+</TD>
<TD>-</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>+</TD>
<TD>*SV,*EA,SM</TD>
</TR>
<TR>
<TD>Pnb</TD>
<TD>Punjabi</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>*SV,MH</TD>
</TR>
<TR>
<TD>Pol</TD>
<TD>Polish</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>+</TD>
<TD>IN,*AS</TD>
</TR>
<TR>
<TD>Ron</TD>
<TD>Romanian</TD>
<TD>+</TD>
<TD>+</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>+</TD>
<TD>*RE</TD>
</TR>
<TR>
<TD>Rus</TD>
<TD>Russian</TD>
<TD>+</TD>
<TD>+</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>+</TD>
<TD>JK,*NF</TD>
</TR>
<TR>
<TD>Snd</TD>
<TD>Sindhi</TD>
<TD>+</TD>
<TD>+</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>*SV,*JD</TD>
</TR>
<TR>
<TD>Spa</TD>
<TD>Spanish</TD>
<TD>+</TD>
<TD>+</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>+</TD>
<TD>++</TD>
<TD>-</TD>
<TD>*AR,IA,TS,*IL</TD>
</TR>
<TR>
<TD>Swa</TD>
<TD>Swahili</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>*WN,JM</TD>
</TR>
<TR>
<TD>Swe</TD>
<TD>Swedish</TD>
<TD>+</TD>
<TD>+</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>++</TD>
<TD>+</TD>
<TD>*MA,*AR,MF</TD>
</TR>
<TR>
<TD>Tha</TD>
<TD>Thai</TD>
<TD>+</TD>
<TD>-</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>*AR,CK</TD>
</TR>
<TR>
<TD>Tsn</TD>
<TD>Tswana</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>*LPs,AB</TD>
</TR>
<TR>
<TD>Tur</TD>
<TD>Turkish</TD>
<TD>+</TD>
<TD>-</TD>
<TD>++</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>*SC,KA</TD>
</TR>
<TR>
<TD>Urd</TD>
<TD>Urdu</TD>
<TD>+</TD>
<TD>+</TD>
<TD>++</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>+</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>+</TD>
<TD>+</TD>
<TD>*SV,MH</TD>
</TR>
</TABLE>
<P>
ISO = 3-letter ISO language code, used in library file names
(mostly ISO 639-2 B (bibliographic))
</P>
<P>
Darcs = available in the darcs repository of <S><A HREF="http://code.haskell.org/gf">http://code.haskell.org/gf</A></S> <A HREF="http://www.grammaticalframework.org/">http://www.grammaticalframework.org/</A>
</P>
<P>
Mini = minimal resource, compiles with <CODE>make minimal</CODE> (obsolete)
</P>
<P>
Parad = <CODE>Paradigms</CODE> file complete for major POS, ++ means with smart paradigms
</P>
<P>
Lex = the resource <CODE>Lexicon</CODE> (nearly) complete
</P>
<P>
Lang = the resource <CODE>Syntax</CODE> (nearly) complete
</P>
<P>
API = the <CODE>Syntax</CODE> compiles
</P>
<P>
API = the <CODE>Symbolic</CODE> API compiles
</P>
<P>
Irreg = the <CODE>Irreg</CODE> module with irregular verbs exists
</P>
<P>
Dict = the <CODE>Dict</CODE> module, large-scale morphological lexicon, exists
</P>
<P>
Trans = large-scale translation module and dictionary exists
</P>
<P>
tested = tested in some applications, ++ means extensively tested with no major issues
</P>
<P>
publ = publications available, see <A HREF="./rgl-publications.html">RGL publication list</A>
</P>
<P>
authors = main contributors, * means still active
(ready to fix bugs, answer to questions, etc)
</P>
<H3>Author codes</H3>
<P>
AB Ansu Berg,
AD Ali El Dada,
AR Aarne Ranta,
AS Adam Slaski,
BB Björn Bringert,
BT Bjarki Traustason,
CK Chotiros Kairoje,
CP Chen Peng,
DD Dana Dannélls,
DS Dinesh Simk,
EA Elnaz Abolahrar,
EG Erzsébet Galgóczy
FJ Femke Johansson,
HH Harald Hammarström,
HLa Herbert Lange,
HLe Hans Leiss,
GP Gabriele Paganelli,
IA Ingrid Andersson,
IL Inari Listenmaa,
IN Ilona Novak,
IP Ioanna Papadopoulou,
JB Jean-Philippe Bernardy,
JC John J. Camilleri,
JD Jherna Devi,
JK Janna Khegai,
JM Juliet Mutahi,
JS Jordi Saludes,
KA Krasimir Angelov,
KK Kaarel Kaljurand,
KP Kuchi Prasad,
LM Laurette Marais,
LP Laurette Pretorius,
LZ Liza Zimina,
MA Malin Ahlberg,
MF Markus Forsberg,
MK Markos Kassa Gobena,
MH Muhammad Humayoun,
NE Nyamsuren Erdenebadrakh,
NF Nick Frolov,
NG Normunds Gruzitis,
QH Qiao Haiyan,
RE Ramona Enache,
PP Peteris Paikens,
SC Server Cimen,
SM Sofy Moradi,
SRE Stian Rødven Eide,
SV Shafqat Virk,
TH Therese Söderberg,
WN Wanjiku Ng'ang'a,
ZL Zhuo Lin Qiqige
</P>
<H2>Rules</H2>
<P>
Only components available at <A HREF="http://grammaticalframework.org">http://grammaticalframework.org</A> are indicated in the table
(exceptions: Ancient Greek, Mongolian, to appear soon).
</P>
<P>
If you want to work on a language already in the table, please be kind and contact the
active authors of it.
</P>
<P>
Feel free to start a new language that is not yet in the table - but let us know and
contribute some code as soon as you can!
</P>
<!-- html code generated by txt2tags 2.6 (http://txt2tags.org) -->
<!-- cmdline: txt2tags -thtml status.txt -->
</BODY></HTML>

File diff suppressed because it is too large Load Diff

76
doc/synopsis/Makefile Normal file
View File

@@ -0,0 +1,76 @@
# Your GF_LIB_PATH must be set in order for this build script to work
.PHONY: all index clean
GF_alltenses=$(GF_LIB_PATH)/alltenses
GF=gf
GFDOC=gfdoc
ROOT=../..
S=$(ROOT)/src
CONFIG=$(ROOT)/languages.csv
# List of languages extracted from languages.csv, with 'Synopsis' column == y
LANGS=$(shell cat $(CONFIG) | cut -d',' -f1,11 | grep ',y' | cut -d',' -f1)
# This list was constructed by observing what files MkSynopsis.hs reads
SRC_FILES=$(S)/abstract/Common.gf $(S)/abstract/Cat.gf $(S)/api/Constructors.gf $(S)/abstract/Structural.gf $(patsubst %,$S/*/Paradigms%.gf,$(LANGS))
EXAMPLES_OUT=$(patsubst %,api-examples-%.txt,$(LANGS))
INCLUDES=intro.txt categories-intro.txt categories-imagemap.html categories.png additional.txt browse.txt example.txt
TMP=tmp.html
TEMPLATE=template.html
all: index
index: index.html
index.txt: MkSynopsis.hs MkExxTable.hs $(INCLUDES) $(EXAMPLES_OUT) $(SRC_FILES)
runghc -i$(ROOT) MkSynopsis.hs
TITLE=$(shell head -n 1 index.txt)
index.html: index.txt $(TEMPLATE)
txt2tags --target=html --no-headers --quiet --toc --outfile=$@ --infile=$<
sed -i.bak "s/<A NAME=\"\(.*\)\"><\/A>/<div id=\"\1\"><\/div>/" $@
pandoc \
--from=html \
--to=html5 \
--standalone \
--template=$(TEMPLATE) \
--metadata='title:"$(TITLE)"' \
--variable='lang:en' \
--variable='rel-root:$(ROOT)/..' \
--css="synopsis.css" \
--include-after-body="quicklinks.html" \
--output=$(TMP) \
$@
mv $(TMP) $@
sed -i.bak "s/<table>/<table class=\"table w-auto\">/" $@
sed -i.bak -e '/img src="categories.png"/r categories-imagemap.html' -e '/img src="categories.png"/d' $@
rm "$@.bak"
categories.png: categories.dot
dot -Tpng $^ > $@
categories-imagemap.html: categories.dot
rm -f $@
echo '<img src="categories.png" usemap="#categories">' > $@
dot -Tcmapx $^ >> $@
api-examples.gfs: api-examples.txt MkExx.hs
runghc MkExx.hs < $< > $@
# Since .gfo files aren't self-contained, the dependencies given here are
# incomplete. But I am thinking that the Try%.gfo file will always be newer
# than any other files it depends on, so the rule will trigger when
# needed anyway. //TH 2018-10-22
api-examples-%.txt: $(GF_alltenses)/Try%.gfo api-examples.gfs
GF_LIB_PATH=$(GF_LIB_PATH) $(GF) -retain -s $< <api-examples.gfs >$@
clean:
rm -rf \
index.txt \
index.html \
api-examples.gfs \
$(EXAMPLES_OUT)

32
doc/synopsis/MkExx.hs Normal file
View File

@@ -0,0 +1,32 @@
-- make a script for computing examples
-- usage: runghc MkExx.hs <koe.txt >koe.gfs
-- then: gf -retain -s ../alltenses/TryRon.gfo <koe.gfs
-- called automatically by 'make exx'
main = interact (unlines . concatMap mkScript . takeWhile (/="--.") . lines)
mkScript l = case l of
' ':_ ->
let ident = mkIdent $ unwords $ takeWhile (/="--") $ words l
in [add $ psq ident]
'-':_ -> []
_ -> [
add $ psq l,
add $ "cc -one " ++ l,
add $ psq "*"
]
add = ('\n':)
psq s = "ps \"" ++ s ++ "\""
-- makes mkUtt : QS -> Utt to mkUtt-QS-Utt
mkIdent :: String -> String
mkIdent = concatMap unspec where
unspec c = case c of
' ' -> ""
'>' -> ""
'(' -> ""
')' -> ""
':' -> "-"
_ -> [c]

View File

@@ -1,29 +1,31 @@
module MkExxTable (getApiExx, ApiExx, prApiEx, mkEx) where
import System.Cmd
import System.Environment
--import System.Cmd
import System.Environment(getArgs)
import Control.Monad(when)
import qualified Data.Map as M
import Data.Char
main = do
xx <- getArgs
aexx <- getApiExx xx
aexx <- getApiExx' True xx
return () -- putStrLn $ prApiExx aexx
getApiExx :: [FilePath] -> IO ApiExx
getApiExx xx = do
getApiExx = getApiExx' False
getApiExx' verbose xx = do
s <- readFile (head xx)
let aet = getApiExxTrees $ filter validOutput $ mergeOutput $ lines s
aeos <- mapM readApiExxOne xx
aeos <- mapM (readApiExxOne verbose) xx
let aexx = mkApiExx $ ("API",aet) : aeos
-- putStrLn $ prApiExx aexx
return aexx
readApiExxOne file = do
readApiExxOne verbose file = do
s <- readFile file
let lang = reverse (take 3 (drop 4 (reverse file))) -- api-exx-*Eng*.txt
let api = getApiExxOne $ filter validOutput $ mergeOutput $ lines s
putStrLn $ unlines $ prApiEx api ---
when verbose $ putStrLn $ unlines $ prApiEx api ---
return (lang,api)
-- map function -> language -> example
@@ -98,6 +100,6 @@ bind ws = case ws of
"&+":ws2 -> bind ws2
"Predef.BIND":ws2 -> bind ws2
"Predef.SOFT_BIND":ws2 -> bind ws2
w : ws2 -> w : bind ws2
w : "++" : ws2 -> w : bind ws2
w : ws2 -> w : bind ws2
_ -> ws

View File

@@ -1,64 +1,62 @@
import MkExxTable
import System.Cmd
import System.Environment
import System.Process(system)
import System.FilePath((</>),(<.>))
import Data.Char
import Data.List
import qualified Data.ByteString.Char8 as BS
import qualified Data.Map as M
---import Debug.Trace ----
import Text.Printf
import Config (loadLangsFrom, LangInfo (..))
import qualified Config
type Cats = [(String,String,String)]
type Rules = [(String,String,String)]
-- the file generated
synopsis = "synopsis.txt"
outfile :: FilePath
outfile = "index.txt"
-- the languages.csv config file
configFile :: FilePath
configFile = ".." </> ".." </> Config.configFile
-- the language in which revealed examples are shown
revealedLang :: String
revealedLang = "Eng"
-- all languages shown
apiExxFiles = ["api-examples-" ++ lang ++ ".txt" | lang <- words
-- "Eng Chi"
"Afr Bul Cat Chi Dan Dut Eng Est Eus Fin Fre Ger Gre Hin Ice Ita Jpn Lav Mlt Mon Nep Nor Nno Pes Pnb Pol Ron Rus Snd Spa Swe Tha Urd"
]
-- | This function puts together a txt2tags file which is then converted to HTML by the Makefile
main :: IO ()
main = do
xx <- getArgs
let isLatex = case xx of
"-tex":_ -> True
_ -> False
langs <- loadLangsFrom configFile >>= return . filter langSynopsis
cs1 <- getCats commonAPI
cs2 <- getCats catAPI
let cs = sortCats (cs1 ++ cs2)
writeFile synopsis "GF Resource Grammar Library: Synopsis"
append "B. Bringert, T. Hallgren, and A. Ranta"
writeFile outfile "GF Resource Grammar Library: Synopsis"
space
append "%!Encoding:utf-8"
append "%!style(html): ./revealpopup.css"
space
append "%!postproc(html): '#divreveal' '<div class=reveal>'"
append "%!postproc(html): '#divpopup' '<div class=popup>'"
append "%!postproc(html): '#ediv' '</div>'"
append "%!postproc(html): '#UL' '<ul>'"
append "%!postproc(html): '#EUL' '</ul>'"
append "%!postproc(html): '#LI' '<li>'"
append "%!postproc(html): '(SRC=\"categories.png\")' '\\1 USEMAP=\"#categories\"'"
append "%!postproc(html): '#LParadigms' '<a name=\"RParadigms\"></a>'"
append "%!postproc(tex): '#LParadigms' ''"
append "%!postproc(html): '#quicklinks' '<script src=\"quicklinks.js\"></script>'"
append "%!postproc(tex): '#quicklinks' ''"
append ("%!postproc(html): '#LANGUAGE_COUNT' '" ++ show (length langs) ++ "'")
append ("%!postproc(html): '#LANGUAGES' '" ++ intercalate ", " (map langName langs) ++ ".'")
delimit $ addToolTips cs
include "synopsis-intro.txt"
include "intro.txt"
space
title "Categories"
space
link "Source 1:" commonAPI
space
link "Source 2:" catAPI
space
append "==A hierarchic view==\n"
stitle "A hierarchic view"
space
include "categories-intro.txt"
append "==Explanations==\n"
delimit $ mkCatTable isLatex cs
stitle "Explanations"
space
delimit $ mkCatTable cs
space
title "Syntax Rules and Structural Words"
space
@@ -66,42 +64,35 @@ main = do
space
link "Source 2:" structuralAPI
space
apiExx <- getApiExx apiExxFiles
apiExx <- getApiExx (apiExxFiles langs)
rs <- getRules apiExx syntaxAPI
--- putStrLn $ unlines ["p -cat=" ++ last (words t) ++
--- " \"" ++ e ++ "\"" | (_,t,e) <- rs, not (null e)] ----
rs2 <- getRules apiExx structuralAPI
let rss = rs ++ rs2
--- mapM_ putStrLn [f ++ " " ++ e | (f,_,e) <- rss]
delimit $ mkSplitTables True isLatex apiExx cs rss
delimit $ mkSplitTables True apiExx cs rss
space
-- title "Structural Words"
-- space
-- link "Source:" structuralAPI
-- space
-- rs <- rulesTable False isLatex cs structuralAPI
-- rs <- rulesTable False cs structuralAPI
-- delimit rs
space
title "Lexical Paradigms"
mapM_ (putParadigms isLatex cs) paradigmFiles
append "#LParadigms"
mapM_ (putParadigms cs) (paradigmFiles langs)
space
include "synopsis-additional.txt"
include "additional.txt"
space
include "synopsis-browse.txt"
include "browse.txt"
space
title "An Example of Usage"
space
include "synopsis-example.txt"
include "example.txt"
space
title "Table of Contents"
space
append "%%toc"
space
append "#quicklinks"
space
let format = if isLatex then "tex" else "html"
system $ "txt2tags -t" ++ format ++ " " ++ " --toc " ++ synopsis
if isLatex then (system $ "pdflatex synopsis.tex") >> return () else return ()
addToolTips :: Cats -> [String]
addToolTips = map f
@@ -122,10 +113,10 @@ getCats file = do
(expl,ex) = span (/="e.g.") exp
_ -> getrs rs ss2
rulesTable :: ApiExx -> Bool -> Bool -> Cats -> FilePath -> IO [String]
rulesTable aexx hasEx isLatex cs file = do
rulesTable :: ApiExx -> Bool -> Cats -> FilePath -> IO [String]
rulesTable aexx hasEx cs file = do
rs <- getRules aexx file
return $ mkTable hasEx isLatex aexx cs rs
return $ mkTable hasEx aexx cs rs
getRules :: ApiExx -> FilePath -> IO Rules
@@ -153,14 +144,13 @@ getRules aexx file = do
n:ws | last n == '.' && not (null (init n)) && all isDigit (init n) -> ws
_ -> e
putParadigms :: Bool -> Cats -> (String, FilePath) -> IO ()
putParadigms isLatex cs (lang,file) = do
putParadigms :: Cats -> (String, FilePath) -> IO ()
putParadigms cs (lang,file) = do
stitle ("Paradigms for " ++ lang)
append "#LParadigms"
space
link "source" file
space
rs <- rulesTable M.empty False isLatex cs file
rs <- rulesTable M.empty False cs file
space
delimit rs
space
@@ -172,25 +162,25 @@ inChunks i f = concat . intersperse ["\n\n"] . map f . chunks i where
-- Makes one table per result category.
-- Adds a subsection header for each table.
mkSplitTables :: Bool -> Bool -> ApiExx -> Cats -> Rules -> [String]
mkSplitTables hasEx isLatex aexx cs = concatMap t . addLexicalCats cs . sortRules
where t (c, xs) = [subtitle c expl] ++ tableOrLink
mkSplitTables :: Bool -> ApiExx -> Cats -> Rules -> [String]
mkSplitTables hasEx aexx cs = concatMap t . addLexicalCats cs . sortRules
where t (c, xs) = [subtitle c expl, "\n"] ++ tableOrLink
where
expl = case [e | (n,e,_) <- cs, n == c] of
[] -> ""
e:_ -> e
tableOrLink = if null xs then parad else mkTable hasEx isLatex aexx cs xs
tableOrLink = if null xs then parad else mkTable hasEx aexx cs xs
parad = [
"Lexical category, constructors given in",
"[lexical paradigms #RParadigms]."
]
mkTable :: Bool -> Bool -> ApiExx -> Cats -> Rules -> [String]
mkTable hasEx isLatex aexx cs = inChunks chsize (\rs -> header : map (unwords . row) rs)
mkTable :: Bool -> ApiExx -> Cats -> Rules -> [String]
mkTable hasEx aexx cs = inChunks chsize (\rs -> header : map (unwords . row) rs)
where
chsize = if isLatex then 40 else 1000
header = if hasEx then "|| Function | Type | Example ||"
else "|| Function | Type | Explanation ||"
chsize = 1000
header = if hasEx then "|| Function | Type | Example |"
else "|| Function | Type | Explanation |"
row (name,typ,ex) =
let ntyp = mkIdent (name ++ " : " ++ typ) in
if hasEx then ["|", name', "|", typ', "|", ex' ntyp, "|"]
@@ -205,6 +195,7 @@ mkTable hasEx isLatex aexx cs = inChunks chsize (\rs -> header : map (unwords .
expl typ = if null ex then itf "-" else itf ex
-- make an example with hover-popup translations
mkExample :: M.Map String String -> String -> String
mkExample es ex = unwords [
"#divreveal",
itf (maybe ex (mkEx revealedLang) (M.lookup revealedLang es)),
@@ -227,69 +218,56 @@ mkIdent = concatMap unspec where
':' -> "-"
_ -> [c]
mkCatTable :: Bool -> Cats -> [String]
mkCatTable isLatex cs = inChunks chsize (\rs -> header ++ map mk1 rs) cs
mkCatTable :: Cats -> [String]
mkCatTable cs = inChunks chsize (\rs -> header ++ map mk1 rs) cs
where
header = ["|| Category | Explanation | Example ||"]
chsize = if isLatex then 40 else 1000
header = ["|| Category | Explanation | Example |"]
chsize = 1000
mk1 (name,expl,ex) = unwords ["|", showCat cs name, "|", expl, "|", typo ex, "|"]
typo ex = if take 1 ex == "\"" then itf (init (tail ex)) else ex
srcPath = ("../src" ++)
srcPath :: FilePath -> FilePath
srcPath = ((</>) "../../src")
commonAPI = srcPath "/abstract/Common.gf"
catAPI = srcPath "/abstract/Cat.gf"
syntaxAPI = srcPath "/api/Constructors.gf"
structuralAPI = srcPath "/abstract/Structural.gf"
paradigmFiles = [
("Afrikaans", srcPath "/afrikaans/ParadigmsAfr.gf"),
("Basque", srcPath "/basque/ParadigmsEus.gf"),
("Bulgarian", srcPath "/bulgarian/ParadigmsBul.gf"),
("Catalan", srcPath "/catalan/ParadigmsCat.gf"),
("Chinese", srcPath "/chinese/ParadigmsChi.gf"),
("Danish", srcPath "/danish/ParadigmsDan.gf"),
("Dutch", srcPath "/dutch/ParadigmsDut.gf"),
("English", srcPath "/english/ParadigmsEng.gf"),
("Estonian", srcPath "/estonian/ParadigmsEst.gf"),
("Finnish", srcPath "/finnish/ParadigmsFin.gf"),
("French", srcPath "/french/ParadigmsFre.gf"),
("German", srcPath "/german/ParadigmsGer.gf"),
("Greek", srcPath "/greek/ParadigmsGre.gf"),
("Hindi", srcPath "/hindi/ParadigmsHin.gf"),
("Icelandic", srcPath "/icelandic/ParadigmsIce.gf"),
-- ("Interlingua", srcPath "/interlingua/ParadigmsIna.gf"),
("Italian", srcPath "/italian/ParadigmsIta.gf"),
("Japanese", srcPath "/japanese/ParadigmsJpn.gf"),
("Latvian", srcPath "/latvian/ParadigmsLav.gf"),
("Maltese", srcPath "/maltese/ParadigmsMlt.gf"),
("Mongolian", srcPath "/mongolian/ParadigmsMon.gf"),
("Nepali", srcPath "/nepali/ParadigmsNep.gf"),
("Norwegian", srcPath "/norwegian/ParadigmsNor.gf"),
("Nynorsk", srcPath "/nynorsk/ParadigmsNno.gf"),
("Polish", srcPath "/polish/ParadigmsPol.gf"),
("Punjabi", srcPath "/punjabi/ParadigmsPnb.gf"),
("Romanian", srcPath "/romanian/ParadigmsRon.gf"),
("Russian", srcPath "/russian/ParadigmsRus.gf"),
("Sindhi", srcPath "/sindhi/ParadigmsSnd.gf"),
("Spanish", srcPath "/spanish/ParadigmsSpa.gf"),
("Swedish", srcPath "/swedish/ParadigmsSwe.gf"),
("Thai", srcPath "/thai/ParadigmsTha.gf"),
("Urdu", srcPath "/urdu/ParadigmsUrd.gf")
commonAPI = srcPath "abstract/Common.gf"
catAPI = srcPath "abstract/Cat.gf"
syntaxAPI = srcPath "api/Constructors.gf"
structuralAPI = srcPath "abstract/Structural.gf"
-- all languages shown (a copy of this list appears in Makefile)
apiExxFiles :: [LangInfo] -> [FilePath]
apiExxFiles langs =
[ "api-examples-" ++ (langCode lang) ++ ".txt"
| lang <- langs
]
append s = appendFile synopsis ('\n':s)
paradigmFiles :: [LangInfo] -> [(String,FilePath)]
paradigmFiles langs =
[ (langName lang, srcPath $ printf "%s/Paradigms%s.gf" (langDir lang) (langCode lang))
| lang <- langs
]
-- | Split a string at given character, similar to words
splitOn :: (Char -> Bool) -> String -> [String]
splitOn _ "" = []
splitOn f s = takeWhile (not.f) s : splitOn f rest
where
rest = case dropWhile (not.f) s of
"" -> []
_:xs -> xs
append s = appendFile outfile ('\n':s)
title s = append $ "=" ++ s ++ "="
stitle s = append $ "==" ++ s ++ "=="
include s = append $ "%!include: " ++ s
space = append "\n"
delimit ss = mapM_ append ss
link s f = append $ s ++ " [``" ++ f ++ "`` " ++ fa ++ "]" where
fa = "http://www.grammaticalframework.org/lib" ++ dropWhile (=='.') f
link s f = append $ s ++ " [``" ++ f ++ "`` " ++ f ++ "]"
ttf s = "``" ++ s ++ "``"
itf s = "//" ++ s ++ "//"
hiddenLine :: String -> Bool
hiddenLine s = case reverse (words s) of
"--%":_ -> True
_ -> False
@@ -317,7 +295,7 @@ addLexicalCats cs rss =
resultCat :: (String,String,String) -> String
resultCat (_,t,_) = last (words t)
subtitle :: String -> String -> String
subtitle cat expl = "==" ++ cat ++ e ++ "==" ++ "[" ++ cat ++ "]"
where e = if null expl then "" else " - " ++ expl
@@ -336,8 +314,9 @@ showTyp cs = unwords . map f . words
&& isUpper (head cat)
-- to work around GHC 6.12 file input
readFileC :: String -> FilePath -> IO String
readFileC cod file = do
let tmp = file ++ ".tmp"
let tmp = file <.> "tmp"
case cod of
"utf8" -> readFile file
_ -> do
@@ -346,8 +325,9 @@ readFileC cod file = do
-- 'intelligently' determine the coding of a file
---- AR 5/6/2016: now utf8 is used for all languages except Bul, where no characters are shown in documentation anyway
coding :: FilePath -> String
coding file = case language file of
"Bul" -> "CP1251" --- "ISO-8859-1"
_ -> "utf8"
language = reverse . take 3 . drop 3 . reverse
where
language = reverse . take 3 . drop 3 . reverse

View File

@@ -7,10 +7,9 @@
==The Prelude module==
The ``Prelude`` defines commonly used utility functions, in particular for
strings and booleans.
The ``Prelude`` defines commonly used utility functions, in particular for strings and booleans.
|| Oper | Type | Explanation ||
|| Oper | Type | Explanation |
| ``SS`` | ``Type`` | the type ``{s : Str}``
| ``ss`` | ``Str -> SS`` | record from string
| ``nonExist`` | ``Str`` | missing form
@@ -30,7 +29,7 @@ strings and booleans.
These functions are hard-coded in GF. They are available without explicit opening, by the used of qualified names, e.g. ``Predef.tk``.
|| operation | type | explanation ||
|| Oper | Type | Explanation |
| ``PBool`` | ``PType`` | ``PTrue | PFalse``
| ``Error`` | ``Type`` | the empty type
| ``Integer`` | ``Type`` | the type of integers
@@ -57,7 +56,7 @@ These functions are hard-coded in GF. They are available without explicit openin
This module is used for defining formal languages, in particular ones that
use precedence levels and parentheses for grouping subexpressions.
|| Oper | Type | Explanation ||
|| Oper | Type | Explanation |
| ``Prec`` | ``PType`` | precedence levels 0..4
| ``TermPrec`` | ``Type`` | string with precedence
| ``mkPrec`` | ``Prec -> Str -> TermPrec`` | construct a ``TermPrec``
@@ -75,7 +74,7 @@ This module is used for embedding symbolic notation in natural-language
text constructed by the resource grammar API. It works for all resource
languages.
|| Function | Type | Example ||
|| Function | Type | Explanation |
| ``symb`` | ``Str -> NP`` | //x//
| ``symb`` | ``Int -> NP`` | //23//
| ``symb`` | ``Float -> NP`` | //0.99//
@@ -92,7 +91,7 @@ languages.
This module gives shortcuts for defining predicates (``pred``) and function
expressions (``app``). It works for all resource languages.
|| Function | Type | Example ||
|| Function | Type | Explanation |
| ``pred`` | ``V -> NP -> Cl`` | //x converges//
| ``pred`` | ``V2 -> NP -> NP -> Cl`` | //x intersects y//
| ``pred`` | ``V -> NP -> NP -> Cl`` | //x and y intersect//
@@ -111,5 +110,3 @@ expressions (``app``). It works for all resource languages.
| ``app`` | ``N2 -> NP -> CN`` | //divisor of x//
| ``app`` | ``N3 -> NP -> NP -> CN`` | //path from x to y//
| ``app`` | ``N2 -> NP -> NP -> CN`` | //path between x and y//

View File

@@ -8,12 +8,9 @@ of //C// that takes //D// as an argument. What the constructors exactly are,
and what other arguments they take, is described by separate tables for
each category.
| [categories.png] |
%!include(html): ''categories-imagemap.html''
The rectangular boxes mark open lexical categories, which have constructors
also in the ``Paradigms`` modules.

View File

@@ -1,46 +1,10 @@
=Introduction=
The GF Resource Grammar Library is the standard library for Grammatical Framework.
It covers the morphology and basic syntax of currently 32 languages:
Afrikaans,
Bulgarian,
Catalan,
Chinese (simplified),
Danish,
Dutch,
English,
Estonian,
Finnish,
French,
German,
Greek,
Hindi,
Icelandic,
Japanese,
Italian,
Latvian,
Maltese,
Mongolian,
Nepali,
Norwegian (bokmål),
Norwegial (nynorsk),
Persian,
Polish,
Punjabi,
Romanian,
Russian,
Sindhi,
Spanish,
Swedish,
Thai,
Urdu.
It covers the morphology and basic syntax of currently #LANGUAGE_COUNT languages:
#LANGUAGES
This document contains the most important parts of the GF Resource Grammar API,
as needed by a GF application programmer.
@@ -54,25 +18,24 @@ The main contents are:
constructing trees in them.
- [Chapter 2 #toc5]: syntactic construction functions, with cross-links and
examples.
- [Chapter 3 #toc84]: morphological paradigms.
- [Chapter 4 #toc116]: additional libraries.
- [Chapter 5 #toc122]: how to "browse" the library by
- [Chapter 3 #toc85]: morphological paradigms.
- [Chapter 4 #toc120]: additional libraries.
- [Chapter 5 #toc126]: how to "browse" the library by
loading the grammars into the ``gf`` command editor.
- [Chapter 6 #toc123]: a brief example of how application grammars can
- [Chapter 6 #toc127]: a brief example of how application grammars can
use the resource modules.
- [Detailed table of contents #toc124].
- [Detailed table of contents #toc128].
Other relevant documents:
- [The RGL Status Document ./status.html]: the current status of different languages
- [The RGL Status Document ../status.html]: the current status of different languages
and the authors of each grammar
- [The Resource Grammar Library coverage map http://www.postcrashgames.com/gf_world/]
- [RGL Documentation and Publications ./rgl-publications.html]: links to publications and other documentation
- [More modules gfdoc/sources.html]: extra modules, dictionaries, and
- [RGL Documentation and Publications ../rgl-publications.html]: links to publications and other documentation
- [More modules ../gfdoc/sources.html]: extra modules, dictionaries, and
the internals of the resource grammar
- [Internal abstract syntax ./absfuns.html]: synopsis of internal
- [Internal abstract syntax ../absfuns.html]: synopsis of internal
abstract functions and their Universal Dependency labels
- [RGL Source Browser ./browse]: look up functions and their source code
- [Minibar http://cloud.grammaticalframework.org/minibar/minibar.html]:
find resource grammar expressions by parsing (select Grammar: LibraryBrowser)
or test translations between all languages (select Grammar: ResourceDemo)
@@ -88,12 +51,3 @@ abstract functions and their Universal Dependency labels
Cambridge, pp. 281--308, 2009).
The library from a software engineering point of view.
[PDF http://www.cse.chalmers.se/~aarne/old/articles/libraries-kahn.pdf]
Many examples in [Chapter 2 #toc5] can be seen in multiple languages by hovering the
mouse over the example, as shown in the following screenshot:
[hovering.png]

View File

@@ -0,0 +1 @@
<script src="quicklinks.js"></script>

124
doc/synopsis/quicklinks.js Normal file
View File

@@ -0,0 +1,124 @@
// Find an element with a certain tag containing a certain text.
function findElement (tagname, text) {
var els = document.body.getElementsByTagName(tagname)
for (var i = 0; i < els.length; i++) {
if (els[i].innerText === text) return els[i]
}
return null
}
function text (s) {
return document.createTextNode(s)
}
function appendChildren (n, ds) {
if (Array.isArray(ds)) for (var i in ds) n.appendChild(ds[i])
else if (typeof ds === 'string') n.appendChild(text(ds))
else n.appendChild(ds)
}
function node (tag, cls, ds) {
var n = document.createElement(tag)
if (cls) n.className = cls
if (ds) appendChildren(n, ds)
return n
}
function a (href, txt) {
var a = node('a', '', txt)
a.href = href
return a
}
function forAllLinks (list, f) {
for (var i = 0; i < list.length; i++) {
var c = list[i].firstElementChild
if (c && c.tagName === 'A' && c.href) f(c)
}
}
/* -------------------------------------------------------------------------- */
// Extract links to the syntax rules
function listrules (ul) {
var rules = []
if (ul.tagName !== 'UL') return []
forAllLinks(ul.children, function (c) {
rules.push({
href: c.href,
text: c.innerText.split(' -')[0],
full: c.innerText
})
})
return rules
}
// Extract the links to the paradigm sections for all the languages
function listlangs (ul) {
var langs = []
if (ul.tagName !== 'UL') return []
forAllLinks(ul.children, function (c) {
if (/^Paradigms for /.test(c.innerText)) {
langs.push({
href: c.href,
text: c.innerText.substr(14),
full: c.innerText
})
}
})
return langs
}
function linklist (links) {
var d = node('div')
for (var i = 0; i < links.length; i++) {
var l = a(links[i].href, links[i].text)
l.title = links[i].full
d.appendChild(l)
d.appendChild(text(' '))
}
return d
}
function quicklinks () {
// Find the detailed table of contents
var h1toc = findElement('h1', 'Table of Contents')
var ultoc = h1toc.nextElementSibling
while (ultoc && ultoc.tagName !== 'UL') {
ultoc = ultoc.nextElementSibling
}
var lis = ultoc.children
var syntaxrules = []
var langs = []
// Find the Syntax Rules and Lexical Paradigms sections in the toc
for (var i = 0; i < lis.length; i++) {
var li = lis[i]
var c = li.firstElementChild
if (c.tagName === 'A') {
if (/^Syntax Rules /.test(c.innerText)) {
syntaxrules = listrules(c.nextElementSibling)
} else if (c.innerText === 'Lexical Paradigms') {
langs = listlangs(c.nextElementSibling)
}
}
}
return node(
'div',
'row',
[ node('div', 'col-5', [ node('h6', '', 'Syntax'), linklist(syntaxrules) ]),
node('div', 'col-7', [ node('h6', '', 'Morphology'), linklist(langs) ])
]
)
}
appendChildren(
document.getElementById('quicklinks'),
[
node('h5', '', 'Quick links'),
quicklinks()
]
)

35
doc/synopsis/synopsis.css Normal file
View File

@@ -0,0 +1,35 @@
/* Quick links */
#quicklinks {
line-height: 140%;
}
#quicklinks.sidebar {
overflow-y: scroll;
height: 100%;
position: fixed;
}
#quicklinks a {
display: block;
}
/* Reveal popup */
.popup {
display: none;
background: #ffffccee;
border: 1px solid #dee2e6;
padding: 1em 1em 1em 0;
}
.reveal:hover .popup {
display: block;
position: absolute;
margin: 0 1em;
}
/* General */
.table td, .table th {
padding: 0.5em .75rem;
}

143
doc/synopsis/template.html Normal file
View File

@@ -0,0 +1,143 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="$lang$" xml:lang="$lang$"$if(dir)$ dir="$dir$"$endif$>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
$for(author-meta)$
<meta name="author" content="$author-meta$" />
$endfor$
$if(date-meta)$
<meta name="dcterms.date" content="$date-meta$" />
$endif$
$if(keywords)$
<meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$" />
$endif$
<title>$if(title-prefix)$$title-prefix$ $endif$$pagetitle$</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.2/css/all.css" integrity="sha384-/rXc/GQVaYpyDdyxK+ecHPVYJSN9bmVFBvjA/9eOB+pb3F2w2N6fc5qB9Ew5yIns" crossorigin="anonymous">
$for(css)$
<link rel="stylesheet" href="$css$" />
$endfor$
$if(math)$
$math$
$endif$
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
$for(header-includes)$
$header-includes$
$endfor$
</head>
<body>
$for(include-before)$
$include-before$
$endfor$
<div class="container-fluid">
<div class="row">
<nav class="col-md-3 col-xl-2 d-none d-md-block sidebar pt-4" id="quicklinks">
<!-- filled dynamically via quicklinks.js -->
</nav>
<main role="main" class="col-md-9 col-xl-10 offset-md-3 offset-xl-2 pt-3">
$if(title)$
<header id="title-block-header">
<a href="$rel-root$" title="Home">
<img src="$rel-root$/doc/Logos/gf1.svg" height="200px" class="float-md-right mb-3 bg-white" alt="GF Logo">
</a>
<h1 class="title">$title$</h1>
$if(subtitle)$
<p class="subtitle">$subtitle$</p>
$endif$
$for(author)$
<p class="author">$author$</p>
$endfor$
$if(date)$
<p class="date">$date$</p>
$endif$
</header>
$endif$
$if(toc)$
<nav id="$idprefix$TOC">
$table-of-contents$
</nav>
$endif$
$body$
</main>
</div><!-- .row -->
</div><!-- .container-fluid -->
<footer class="bg-light mt-5 py-5 position-relative">
<div class="container">
<div class="row">
<div class="col-6 col-sm-3">
<a href="$rel-root$">
<i class="fas fa-home"></i>
Home
</a>
<h6 class="text-muted mt-3">Get started</h6>
<ul class="list-unstyled">
<li><a href="https://www.youtube.com/watch?v=x1LFbDQhbso">Google Tech Talk</a></li>
<li><a href="http://cloud.grammaticalframework.org/">GF Cloud</a></li>
<li><a href="$rel-root$/doc/tutorial/gf-tutorial.html">Tutorial</a></li>
<li><a href="$rel-root$/download"><strong>Download GF</strong></a></li>
</ul>
</div>
<div class="col-6 col-sm-3">
<h6 class="text-muted">Learn more</h6>
<ul class="list-unstyled">
<li><a href="$rel-root$/gf-book">The GF Book</a></li>
<li><a href="$rel-root$/doc/gf-refman.html">Reference Manual</a></li>
<li><a href="$rel-root$/doc/gf-shell-reference.html">GF Shell Reference</a></li>
<li><a href="http://www.molto-project.eu/sites/default/files/MOLTO_D2.3.pdf">Best Practices</a></li>
<li><a href="$rel-root$/lib/doc/synopsis/index.html"><strong>RGL Synopsis</strong></a></li>
</ul>
</div>
<div class="col-6 col-sm-3">
<h6 class="text-muted">Develop</h6>
<ul class="list-unstyled">
<li><a href="$rel-root$/doc/gf-developers.html">Developers Guide</a></li>
<li><a href="http://hackage.haskell.org/package/gf/docs/PGF.html">PGF library API (Haskell runtime)</a></li>
<li><a href="$rel-root$/doc/runtime-api.html">PGF library API (C runtime)</a></li>
<li><a href="http://hackage.haskell.org/package/gf/docs/GF.html">GF compiler API</a></li>
<li><a href="$rel-root$/doc/gf-editor-modes.html">Text Editor Support</a></li>
</ul>
</div>
<div class="col-6 col-sm-3">
<h6 class="text-muted">Contribute</i>
</h6>
<ul class="list-unstyled">
<li><a href="http://groups.google.com/group/gf-dev">Mailing List</a></li>
<li><a href="https://github.com/GrammaticalFramework/gf-core/issues">Issue Tracker</a></li>
<li><a href="$rel-root$/doc/gf-people.html">Authors</a></li>
<li><a href="http://school.grammaticalframework.org/2018/">Summer School</a></li>
</ul>
<h6 class="text-muted">
Repositories
<i class="fab fa-github ml-1"></i>
</h6>
<a href="https://github.com/GrammaticalFramework/gf-core">GF</a> ·
<a href="https://github.com/GrammaticalFramework/gf-rgl">RGL</a> ·
<a href="https://github.com/GrammaticalFramework/gf-contrib">Contributions</a>
</div>
<div>
<div>
</footer>
$for(include-after)$
$include-after$
$endfor$
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-7811807-3");
pageTracker._trackPageview();
} catch(err) {}</script>
</body>
</html>

View File

@@ -1,329 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META NAME="generator" CONTENT="http://txt2tags.org">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf8">
<TITLE>From Resource Grammar to Wide Coverage Translation with GF</TITLE>
</HEAD><BODY BGCOLOR="white" TEXT="black">
<CENTER>
<H1>From Resource Grammar to Wide Coverage Translation with GF</H1>
<FONT SIZE="4"><I>Aarne Ranta et al.</I></FONT><BR>
<FONT SIZE="4">January-May 2014</FONT>
</CENTER>
<H2>Scope</H2>
<P>
Wide-coverage interlingual translator for
Bulgarian, Chinese, Dutch, English, Finnish, French, German,
Hindi, Italian, Spanish, Swedish.
</P>
<H2>How to use it</H2>
<P>
If you just want to try it before reading more,
here are the main ways to get started:
</P>
<P>
1. <B>Run on our server.</B> <A HREF="http://www.grammaticalframework.org/demos/translation.html">http://www.grammaticalframework.org/demos/translation.html</A>
</P>
<P>
2. <B>Get an Android app.</B> <A HREF="http://www.grammaticalframework.org/demos/app.html">http://www.grammaticalframework.org/demos/app.html</A>
</P>
<P>
3. <B>Compile and run in the shell.</B> Get the latest GF sources (with darcs or github) and then
</P>
<UL>
<LI>compile and install the GF compiler and library and the C runtime (<CODE>pgf-translate</CODE>).
<P></P>
<LI>compile the translator:
<PRE>
cd GF/lib/src
make -j Translate11.pgf
</PRE>
This will take a long time (fifteen minutes or more) and will probably require at least 8GB of RAM.
<P></P>
<LI>run the translator
<PRE>
pgf-translate Translate11.pgf Phr TranslateEng TranslateSwe
</PRE>
with obviously the possibility to vary the source and the target language.
</UL>
<P>
4. To modify the sources, work on the files in
</P>
<PRE>
GF/lib/src/translator/
</PRE>
<P>
It is these files that will be explained below.
</P>
<H2>GF and the RGL</H2>
<P>
GF, Grammatical Framework, was originally designed for the purpose of <B>multilingual controlled language systems</B>,
which would enable high-quality translation on limited domains. The <B>abstract syntax</B> of GF defines the semantic
structures relevant for the domain, and the <B>concrete syntaxes</B> map these structures to grammatically correct
and idiomatic text in each target language. The <B>reversibility</B> of GF enables both <B>generation</B> and <B>parsing</B>,
and thereby <B>translation</B> where the abstract syntax functions as an <B>interlingua</B>.
</P>
<P>
As a bottle-neck of GF applications, it was soon realized that the definition of concrete syntax requires a lot
of manual work and linguistic skill, because of the complexities of natural language syntax and morphology. Some of
the complexities can be ignored in a small system. For instance, in a mathematical system, it may be enough to
use verbs in the present tense only. But very much the same linguistic problems must be solved again and again
in new applications: French verb inflection is the same in mathematics as in a tourist phrasebook. To solve
this problem, the <B>GF Resource Grammar Library</B> (RGL) was developed, to take care of "low-level" linguistic
rules such as inflection, agreement, and word order. This enables the authors of <B>application grammars</B> to focus
on the semantics (when designing the abstract syntax) and on selecting RGL functions that produce the idioms they
want. The RGL grew into an international open-source project, where more than 50 persons have contributed to
implementing it for 29 languages by the time of writing this.
</P>
<H2>Scaling up GF translation</H2>
<P>
The RGL was thus originally designed to be used just as its name says: as a library
for application grammars. Only the latter were meant to be used as <B>top-level grammars</B>, i.e. for
parsing, generation, and translation at run time. Little attention was therefore
paid to the usability of RGL as a top-level
grammar by itself. But when applications accumulated, ranging from technical text to spoken dialogue, the coverage
of the RGL grew into a coverage that approximates a "complete grammar" of many of the languages.
And recently, there has indeed been success in using the RGL as a wide-coverage translation grammar,
mainly due to Krasimir Angelov's efforts to scale up the size of GF applications from language fragments
to open-text processing. This success is a result of four lines of development:
</P>
<UL>
<LI><B>More efficient processing</B>, both due to better algorithms and to an optimized C implementation of a PGF
interpreter, the <B>C runtime</B>, achieving speeds competitive with the state of the art, e.g. the Stanford parser.
This development is also based on the work of Peter Ljunglöf on GF parsing and Lauri Alanko on the C runtime.
<P></P>
<LI><B>Large-scale dictionaries</B>, both manually built and extracted from free sources, and linked into a multilingual
translation dictionary now covering 10k to 60k entries for eleven languages. This work was started by Björn Bringert,
who ported the Oxford Advanced Learner's Dictionary of English to GF.
<P></P>
<LI><B>Probabilistic disambiguation</B>, using a model trained from the Penn Treebank. Due to the common abstract syntax,
the same model can be used for other languages as well, even though the adequacy of this transfer has not
been systematically evaluated.
<P></P>
<LI><B>Robust parsing</B>, which recovers from unknown words and syntax
by using chunk-by-chunk translations. This leads to loss of quality, but fulfills the principle that
"something is better than nothing".
</UL>
<H2>Remaining problems</H2>
<P>
The result of all this work is a wide-coverage translation system, which can be used in the same way as Google
Translate, Bing, Systran, and Apertium - to "translate anything", albeit with a varying quality. At the moment of
writing, the performance is not yet generally on the level with the best of the competition, but shows some promising
improvements in e.g. long-distance agreement and word order. To make these advantages into absolute improvements, we
will need to fix problems that the other systems (or at least some of them) get right but where GF translation
often fails:
</P>
<UL>
<LI><B>Lexical coverage</B>, to eliminate parsing failures due to unknown words.
<P></P>
<LI><B>Disambiguation</B>, with more sophisticated than the essentially context-free tree model used now.
<P></P>
<LI><B>Speed</B>, which gets worse with long sentences and with more complex languages.
<P></P>
<LI><B>Idiomacy</B>, due to the lack of idiomatic constructions that are not compositional and therefore don't get right
in the RGL but are often correct in phrase-based SMT.
</UL>
<H2>Advantages of GF translation</H2>
<P>
Given that these issues get resolved, the strengths of the GF approach can be made more visible:
</P>
<UL>
<LI><B>Grammaticality</B>, in particular the already mentioned issues of agreement and word order.
<P></P>
<LI><B>Predictability</B>, in the sense that a local change in the input usually results in a corresponding
local change in the output (unless otherwise required by idiomacy).
<P></P>
<LI><B>Feedback</B>, i.e. the ease of showing the confidence level of the translation, alternative translations,
and linguistic information.
<P></P>
<LI><B>Adaptability</B>, i.e. the ease of fixing bugs, adapting the system to special domains, and personalizing it.
This can be done with great precision. For instance, a bug in a grammar can be fixed without
breaking anything else.
<P></P>
<LI><B>Light weight</B>. The system runs on standard laptops and even on mobile phones; the size of the run-time
system for all pairs of 11 languages is under 25MB (on the Android platform), and recompiling the whole
system (e.g. after bug fixes or
domain adaptation) is a matter of a few minutes, where corresponding figures for SMT systems are gigabytes of size
and days of retraining.
<P></P>
<LI><B>Multilinguality</B>, in the sense that once the parsing of the input is settled, the output can be readily
rendered into all other languages,
and also in the sense that the GF model works equally well for any language pair.
</UL>
<H2>Wanted: more work, new ideas</H2>
<P>
The recipes for improvement are, as always, <B>more work</B> and <B>new ideas</B>. Each of the four weaknesses mentioned
above can be relieved by more work - in particular, lexical coverage by more work on the lexicon, since
automatic extraction methods cannot really be trusted. As for disambiguation, new ideas about probabilistic
tree models are being discussed. As for speed, new ideas on parsing (in particular, the integration of disambiguation
with parsing) would help, but also the complexity of grammatical structures plays a major role. As for idiomacy,
more work is being done in introducing <B>constructions</B> (non-compositional syntax rules, generalizing the notion of
<B>multiword expressions</B>, in particular, <B>phrases</B> in SMT), but also new ideas are being discussed on how to
extract such constructions from e.g. phrase tables.
</P>
<P>
In the following, we will focus on describing the role of grammar in the GF translation system - in particular, how
RGL can be modified to become usable as a top-level grammar for translating open text.
As RGL was not meant to be used for parsing open text, but rather for the controlled language generation task,
it has serious restrictions:
</P>
<UL>
<LI><B>Limited coverage</B>. The RGL does not cover all structures in any language - hence it is likely to fail when
parsing unlimited text.
<P></P>
<LI><B>Semantic overgeneration</B>. Semantic distinctions, such as between mass and count nouns, or place and manner
adverbials, are assumed to be defined in application grammars; the RGL just defines the combinatorics of
elements, but doesn't prescribe which elements can really go together.
<P></P>
<LI><B>Spurious ambiguities</B>. RGL parsing creates more ambiguities than what would be necessary, if there
was more semantic control. In addition, there are partly overlapping structures, which generate
spurious syntactic ambiguities.
<B>Example</B>: the very liberal apposition function.
<P></P>
<LI><B>Inefficiency</B>. Partly because of ambiguities, partly of the deep nesting and complex data structures, parsing
with the RGL can be very slow when compared to application grammars, even the comprehensive ResourceDemo grammar.
For some languages (Romanian, versions of French and Finnish), parsing is not practically possible at all because
PGF generation fails for memory reasons.
<P></P>
<LI><B>Syntax orientation</B>. The structures of the RGL are rather superficial and don't guarantee translation
equivalence when used as interlingua.
<P></P>
<LI><B>Coarse categories</B>. This is a particular aspect of syntax orientation, and causes at the same time overgeneration
and spurious ambiguities.
<B>Example</B>: the category <CODE>Adv</CODE>.
</UL>
<H2>What speaks for using RGL</H2>
<P>
Despite these problems, the RGL has shown to be a possible starting point for large-scale translation. It has a couple
of advantages speaking for this:
</P>
<UL>
<LI><B>Coverage</B>. Even though not complete, the RGL has grown into a coverage that is close to complete enough; work
with English shows that just about 20% more constructions can take us there.
<P></P>
<LI><B>Maintainability</B>. The RGL is constantly developed and maintained on its own right, and it makes sense to take
advantage of this and avoid duplicated work with some other large-scale grammar.
</UL>
<P>
Of course, we are still left with the other
option of addressing translation with an <I>application grammar</I>, something
similar to the ResourceDemo with flatter and more semantic structures. But this would in turn require
the replication of many rules, even though it would be to a large extent doable by using a <B>functor</B>, that is,
by just one set of rules covering all languages.
</P>
<H2>The structure of the wide-coverage translation grammar</H2>
<P>
Thus the path chosen is a mixture of RGL and application grammar. In brief, the translation grammar consists of
</P>
<UL>
<LI><B>Selected RGL modules and functions</B>, as they are (using restricted inheritance); around 80% of the syntax.
<P></P>
<LI><B>Overridden RGL functions</B>, with more general types; just a few of them.
<P></P>
<LI><B>Overridden RGL linearizations</B>, typically with more <B>variants</B> in individual languages; just a few, but
increasing.
<P></P>
<LI><B>Syntax extension</B>, new categories and functions, around 20% of the syntax, and increasing.
<P></P>
<LI><B>Big lexicon</B>, with an abstract syntax of 65k lemmas, increasing.
<P></P>
<LI><B>Constructions</B>, inspired by (and partly derived from) Construction Grammars, to capture idioms that
involve specific lexical items and are therefore "between the syntax and the lexicon".
</UL>
<P>
The following picture shows the principal module structure of the translation grammar.
</P>
<P>
<IMG ALIGN="middle" SRC="translation.png" BORDER="0" ALT="">
</P>
<P>
Here is a description of each of the modules:
</P>
<UL>
<LI><B>Translate</B> is the top module, which combines the RGL syntax with syntax extensions and a dictionary.
The RGL syntax is not inherited in its entirety, which is indicated by a dashed line. The overridden abstract
syntax functions (common to all languages) are replaced by functions in the Extensions module, whereas the
overridden concrete syntax definitions (specific to each language) are defined in this Translate module.
This consists of the module named <CODE>Translate</CODE>.
<P></P>
<LI><B>RGLSyntax</B> stands for the standard RGL module for syntax, excluding the RGL test lexicon and
the language-specific extensions of it. This consists of the standard module named <CODE>Grammar</CODE> and
the emerging module named <CODE>Construction</CODE>.
<P></P>
<LI><B>Extensions</B> stands for the syntax extensions added to the RGL syntax. This consists of the module
named <CODE>Extensions</CODE>.
<P></P>
<LI><B>Dictionary</B> is a large-scale multilingual dictionary. Its abstract syntax uses as identifiers English words
suffixed by categories and word sense information. This consists of the module named <CODE>Dictionary</CODE>.
<P></P>
<LI><B>RGLCategories</B> stands for the type system of the standard RGL, the module named <CODE>Cat</CODE>.
<P></P>
<LI><B>Chunk</B> is the grammar defining what chunks (noun phrases, verbs,
adverbs, etc) can be used and how they are combined, when exact
syntactic combination fails.
</UL>
<H2>Where and why the translation grammar differs from the RGL</H2>
<P>
A guiding principle is thus that the translation grammar preserves <I>as much as possible</I> of the RGL, so that
duplicated work is avoided. But as the purposes of the two are different, not everything is possible. Two
diverging principles have already been mentioned:
</P>
<UL>
<LI><B>Free variation</B>. The RGL bans free variation, because library users need to have full control on selecting
variants. For instance, English negation has two forms, contracted (<I>don't</I>) and uncontracted (<I>do not</I>),
which in the translation grammar are treated as variants. But RGL users sometimes need to choose the one or the
other, for instance, excluding contracted negation in formal style.
<P></P>
<LI><B>Semantic distinctions</B>. The RGL avoids semantic distinctions that are not absolutely necessary for syntax.
The reason for this is the ambition to keep the library as simple as possible, in particular for the voluntary
implementors of new languages. But meaning-preserving translation needs more distinctions, for instance, in
word senses, subcategorizations, selection restrictions, and tense and aspect systems.
</UL>
<P>
The old design principles of the RGL are thus kept in force, and this is made possible by separating parts of the
translation grammar modules from the RGL.
</P>
<!-- html code generated by txt2tags 2.6 (http://txt2tags.org) -->
<!-- cmdline: txt2tags -thtml translation.txt -->
</BODY></HTML>

View File

@@ -1,45 +1,45 @@
Code,Directory,Functor,Unlexer,Present,All,Try,Symbolic,Compatibility
Afr,afrikaans,,,,,,n,
Amh,amharic,,,,,n,n,
Ara,arabic,,,,,,y,
Eus,basque,,,,,,,
Bul,bulgarian,,,y,,,,
Cat,catalan,Romance,,y,,,,y
Chi,chinese,,,,,,,
Dan,danish,Scand,,y,,,,
Dut,dutch,,,y,,,,
Eng,english,,,y,,,,y
Est,estonian,,,,,,,
Fin,finnish,,,y,,,,y
Fre,french,Romance,,y,,,,y
Grc,ancient_greek,,,y,,n,n,
Gre,greek,,,,,,,
Heb,hebrew,,,,,n,n,
Hin,hindi,Hindustani,to_devanagari,y,,,,
Hun,hungarian,,,y,n,n,n,
Ger,german,,,,,,,
Ice,icelandic,,,,,,n,
Ina,interlingua,,,y,,n,n,
Ita,italian,Romance,,y,,,,y
Jpn,japanese,,,,,,,
Lat,latin,,,y,,n,n,
Lav,latvian,,,,,,,y
Mlt,maltese,,,,,,,
Mon,mongolian,,,,,,n,
Nep,nepali,,,,,,n,
Nor,norwegian,Scand,,y,,,,
Nno,nynorsk,,,y,,,,
Pes,persian,,,,,,,
Pol,polish,,,,,,,
Por,portuguese,Romance,,y,,,,y
Pnb,punjabi,,,y,,,,
Ron,romanian,,,y,,,,
Rus,russian,,,y,,,,
Snd,sindhi,,,,,,,
Spa,spanish,Romance,,y,,,,y
Swa,swahili,,,,n,n,n,y
Swe,swedish,Scand,,y,,,,y
Tel,telugu,,,y,n,n,n,
Tha,thai,,to_thai,,,,,
Tur,turkish,,,,,n,n,
Urd,urdu,Hindustani,,,,,,
Code,Name,Directory,Functor,Unlexer,Present,All,Try,Symbolic,Compatibility,Synopsis
Afr,Afrikaans,afrikaans,,,,,,n,,y
Amh,Amharic,amharic,,,,,n,n,,n
Ara,Arabic,arabic,,,,,,y,,y
Bul,Bulgarian,bulgarian,,,y,,,,,y
Cat,Catalan,catalan,Romance,,y,,,,y,y
Chi,Chinese (simplified),chinese,,,,,,,,y
Dan,Danish,danish,Scand,,y,,,,,y
Dut,Dutch,dutch,,,y,,,,,y
Eng,English,english,,,y,,,,y,y
Est,Estonian,estonian,,,,,,,,y
Eus,Basque,basque,,,,,,,,y
Fin,Finnish,finnish,,,y,,,,y,y
Fre,French,french,Romance,,y,,,,y,y
Ger,German,german,,,,,,,,y
Grc,Ancient Greek,ancient_greek,,,y,,n,n,,n
Gre,Greek,greek,,,,,,,,y
Heb,Hebrew,hebrew,,,,,n,n,,n
Hin,Hindi,hindi,Hindustani,to_devanagari,y,,,,,y
Hun,Hungarian,hungarian,,,y,n,n,n,,n
Ice,Icelandic,icelandic,,,,,,n,,y
Ina,Interlingua,interlingua,,,y,,n,n,,n
Ita,Italian,italian,Romance,,y,,,,y,y
Jpn,Japanese,japanese,,,,,,,,y
Lat,Latin,latin,,,y,,n,n,,n
Lav,Latvian,latvian,,,,,,,y,y
Mlt,Maltese,maltese,,,,,,,,y
Mon,Mongolian,mongolian,,,,,,n,,y
Nep,Nepali,nepali,,,,,,n,,y
Nno,Norwegian (nynorsk),nynorsk,,,y,,,,,y
Nor,Norwegian (bokmål),norwegian,Scand,,y,,,,,y
Pes,Persian,persian,,,,,,,,y
Pnb,Punjabi,punjabi,,,y,,,,,y
Pol,Polish,polish,,,,,,,,y
Por,Portuguese,portuguese,Romance,,y,,,,y,y
Ron,Pomanian,romanian,,,y,,,,,y
Rus,Russian,russian,,,y,,,,,y
Snd,Sindhi,sindhi,,,,,,,,y
Spa,Spanish,spanish,Romance,,y,,,,y,y
Swa,Swahili,swahili,,,,n,n,n,y,n
Swe,Swedish,swedish,Scand,,y,,,,y,y
Tel,Telugu,telugu,,,y,n,n,n,,n
Tha,Thai,thai,,to_thai,,,,,,y
Tur,Turkish,turkish,,,,,n,n,,n
Urd,Urdu,urdu,Hindustani,,,,,,,y
1 Code Name Directory Functor Unlexer Present All Try Symbolic Compatibility Synopsis
2 Afr Afrikaans afrikaans n y
3 Amh Amharic amharic n n n
4 Ara Arabic arabic y y
5 Eus Bul Bulgarian basque bulgarian y y
6 Bul Cat Catalan bulgarian catalan Romance y y y
7 Cat Chi Chinese (simplified) catalan chinese Romance y y y
8 Chi Dan Danish chinese danish Scand y y
9 Dan Dut Dutch danish dutch Scand y y
10 Dut Eng English dutch english y y y
11 Eng Est Estonian english estonian y y y
12 Est Eus Basque estonian basque y
13 Fin Finnish finnish y y y
14 Fre French french Romance y y y
15 Grc Ger German ancient_greek german y n n y
16 Gre Grc Ancient Greek greek ancient_greek y n n n
17 Heb Gre Greek hebrew greek n n y
18 Hin Heb Hebrew hindi hebrew Hindustani to_devanagari y n n n
19 Hun Hin Hindi hungarian hindi Hindustani to_devanagari y n n n y
20 Ger Hun Hungarian german hungarian y n n n n
21 Ice Icelandic icelandic n y
22 Ina Interlingua interlingua y n n n
23 Ita Italian italian Romance y y y
24 Jpn Japanese japanese y
25 Lat Latin latin y n n n
26 Lav Latvian latvian y y
27 Mlt Maltese maltese y
28 Mon Mongolian mongolian n y
29 Nep Nepali nepali n y
30 Nor Nno Norwegian (nynorsk) norwegian nynorsk Scand y y
31 Nno Nor Norwegian (bokmål) nynorsk norwegian Scand y y
32 Pes Persian persian y
33 Pol Pnb Punjabi polish punjabi y y
34 Por Pol Polish portuguese polish Romance y y y
35 Pnb Por Portuguese punjabi portuguese Romance y y y
36 Ron Pomanian romanian y y
37 Rus Russian russian y y
38 Snd Sindhi sindhi y
39 Spa Spanish spanish Romance y y y
40 Swa Swahili swahili n n n y n
41 Swe Swedish swedish Scand y y y
42 Tel Telugu telugu y n n n n
43 Tha Thai thai to_thai y
44 Tur Turkish turkish n n n
45 Urd Urdu urdu Hindustani y

View File

@@ -1,7 +1,7 @@
--1 Common: Structures with Common Implementations.
-- This module defines the categories that uniformly have the
-- linearization type ${s:Str}$ in all languages.
-- This module defines the categories that uniformly have the same
-- linearization type (usually ${s:Str}$) in all languages.
abstract Common = {

View File

@@ -71,6 +71,7 @@ fun
cat
Timeunit ;
Hour ;
Weekday ;
Month ;
Monthday ;
@@ -78,6 +79,35 @@ cat
fun
timeunitAdv : Card -> Timeunit -> Adv ; -- (for) three hours
timeunitRange : Card -> Card -> Timeunit -> Adv ; -- (cats live) ten to twenty years
oneHour : Hour ;
twoHour : Hour ;
threeHour : Hour ;
fourHour : Hour ;
fiveHour : Hour ;
sixHour : Hour ;
sevenHour : Hour ;
eightHour : Hour ;
nineHour : Hour ;
tenHour : Hour ;
elevenHour : Hour ;
twelveHour : Hour ;
thirteenHour : Hour ;
fourteenHour : Hour ;
fifteenHour : Hour ;
sixteenHour : Hour ;
seventeenHour : Hour ;
eighteenHour : Hour ;
nineteenHour : Hour ;
twentyHour : Hour ;
twentyOneHour : Hour ;
twentyTwoHour : Hour ;
twentyThreeHour : Hour ;
twentyFourHour : Hour ;
timeHour : Hour -> Adv ; -- at three a.m./p.m.
timeHourMinute : Hour -> Card -> Adv ; -- at six forty a.m./p.m.
weekdayPunctualAdv : Weekday -> Adv ; -- on Monday
weekdayHabitualAdv : Weekday -> Adv ; -- on Mondays

View File

@@ -200,7 +200,7 @@ abstract Extend = Cat ** {
-- Eng
UncontractedNeg : Pol ; -- do not, etc, as opposed to don't
UttVPShort : VP -> Utt ; -- have fun, as opposed to "to have fun"
ComplSlashPartLast : VPSlash -> NP -> VP ;
ComplSlashPartLast : VPSlash -> NP -> VP ; -- set it apart, as opposed to "set apart it"
-- Romance
DetNPMasc : Det -> NP ;

View File

@@ -70,7 +70,7 @@ abstract Sentence = Cat ** {
-- This covers subjunctive clauses, but they can also be added to the end.
SSubjS : S -> Subj -> S -> S ; -- I go home if she comes
SSubjS : S -> Subj -> S -> S ; -- I go home, if she comes
-- A sentence can be modified by a relative clause referring to its contents.

View File

@@ -0,0 +1,7 @@
--# -path=.:alltenses:prelude:src/somali
resource CombinatorsSom = Combinators with
(Cat = CatSom),
(Structural = StructuralSom),
(Noun = NounSom),
(Constructors = ConstructorsSom) ** open MissingSom in {} ;

View File

@@ -0,0 +1,3 @@
--# -path=.:alltenses:prelude:../somali
resource ConstructorsSom = Constructors with (Grammar = GrammarSom) ** open MissingSom in {} ;

5
src/api/SymbolicSom.gf Normal file
View File

@@ -0,0 +1,5 @@
--# -path=.:../somali:../common:../abstract:../prelude
resource SymbolicSom = Symbolic with
(Symbol = SymbolSom),
(Grammar = GrammarSom) ** open MissingSom in {} ;

5
src/api/SyntaxSom.gf Normal file
View File

@@ -0,0 +1,5 @@
--# -path=.:alltenses:prelude
instance SyntaxSom of Syntax =
ConstructorsSom, CatSom, StructuralSom, CombinatorsSom ;

3
src/api/TrySom.gf Normal file
View File

@@ -0,0 +1,3 @@
--# -path=.:../somali:../common:../abstract:../prelude
resource TrySom = SyntaxSom, LexiconSom, ParadigmsSom - [mkAdv,mkAdN,mkDet,mkQuant,mkPConj] ;

View File

@@ -21,7 +21,7 @@ concrete AdjectiveAra of Adjective = CatAra ** open ResAra, Prelude in {
-- $SuperlA$ belongs to determiner syntax in $Noun$.
--
ComplA2 a np = {
s = \\sp,g,n,st,c => a.s ! APosit g n st c ++ a.c2 ++ np.s ! Gen ;
s = \\sp,g,n,st,c => a.s ! APosit g n st c ++ a.c2.s ++ np.s ! a.c2.c ;
} ;
--
-- ReflA2 a = {
@@ -37,7 +37,13 @@ concrete AdjectiveAra of Adjective = CatAra ** open ResAra, Prelude in {
AdAP ada ap = {
s = \\sp,g,n,st,c => ada.s ++ ap.s ! sp ! g ! n ! st ! c
} ;
--
-- UseA2 a = a ;
--
UseA2 = PositA ;
UseComparA a = {
s = \\h,g,n,d,c => a.s ! AComp d c
};
-- : Ord -> AP ; -- warmest
AdjOrd ord = {s = \\h,g,n,s,c => ord.s ! g ! s ! c} ;
}

View File

@@ -2,21 +2,24 @@ concrete AdverbAra of Adverb = CatAra ** open ResAra, Prelude in {
flags coding=utf8;
lin
PositAdvAdj a = {s = a.s ! APosit Masc Sg Indef Acc} ;
-- ComparAdvAdj cadv a np = {
-- s = cadv.s ++ a.s ! AAdv ++ "مِنْ" ++ np.s ! Gen
-- } ;
-- ComparAdvAdjS cadv a s = {
-- s = cadv.s ++ a.s ! AAdv ++ "تهَن" ++ s.s
-- } ;
-- ComparAdvAdj cadv a np = {
-- s = cadv.s ++ a.s ! AAdv ++ "مِنْ" ++ np.s ! Gen
-- } ;
-- ComparAdvAdjS cadv a s = {
-- s = cadv.s ++ a.s ! AAdv ++ "مِنْ" ++ s.s
-- } ;
PrepNP prep np = {s = prep.s ++ np.s ! Gen} ;
PrepNP prep np = {s = prep.s ++ np.s ! prep.c} ;
AdAdv ad av = cc2 av ad ;
-- : Subj -> S -> Adv ; -- when she sleeps
SubjS subj s = {s = subj.s ++ s.s ! subj.o} ;
-- AdAdv = cc2 ;
--
-- SubjS = cc2 ;
-- AdvSC s = s ; --- this rule give stack overflow in ordinary parsing
--
-- AdnCAdv cadv = {s = cadv.s ++ "تهَن"} ;
--
AdnCAdv cadv = {s = cadv.s ++ "مِنْ"} ;
}

View File

@@ -1,3 +1,3 @@
--# -path=.:../abstract:../common:../prelude
--# -path=.:../abstract:../common:../api:../prelude
concrete AllAra of AllAraAbs = LangAra ;

View File

@@ -10,35 +10,35 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in {
-- Tensed/Untensed
S = {s : Str} ;
SSlash,
S = {s : Order => Str} ; -- subordinate clause has nominal word order and subject in acc
QS = {s : QForm => Str} ;
-- RS = {s : Agr => Str} ;
RS = {s : Agr => Case => Str} ; -- case because the relative pronoun inflects in case
-- Sentence
Cl = ResAra.Cl ; -- {s : ResAra.Tense => Polarity => Order => Str} ;
Cl = ResAra.Cl ; -- {s : Tense => Polarity => Order => Str} ;
ClSlash = ResAra.ClSlash ;
Imp = {s : Polarity => Gender => ResAra.Number => Str} ;
-- Question
QCl = ResAra.QCl ; -- {s : ResAra.Tense => Polarity => QForm => Str} ;
IP,
IDet,
IComp = ResAra.IP ; -- {s : Gender => State => Case => Str ; n : ResAra.Number} ;
-- IAdv = {s : Str} ;
QCl = ResAra.QCl ; -- {s : Tense => Polarity => QForm => Str} ;
IDet = ResAra.IDet ; -- {s : Gender => State => Case => Str ; n : Number} ;
IP = ResAra.IP ; -- {s : (isPred : Bool) => State => Case => Str ; n : Number} ;
IComp = ResAra.IComp ; --
IQuant = {s : State => Case => Str} ;
--
---- Relative
--
-- RCl = {s : Tense => Anteriority => Polarity => Agr => Str} ;
-- RP = {s : Case => Str ; a : RAgr} ;
--
-- Relative
RCl = ResAra.RCl ;
RP = ResAra.RP ;
-- Verb
VP = ResAra.VP ;
VPSlash = ResAra.VPSlash ; -- VP ** {c2:Str}
Comp = ResAra.Comp ; --{s : AAgr => Case => Str} ;
VPSlash = ResAra.VPSlash ; -- VP ** {c2:Preposition}
Comp = ResAra.Comp ** {obj : Obj ; isNP : Bool} ;
-- SC = {s : Str} ;
--
-- Adjective
@@ -47,20 +47,17 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in {
-- Noun
CN = ResAra.Noun ** {adj : NTable};
CN = ResAra.CN;
NP, Pron = ResAra.NP; --{s : Case => Str ; a : Agr } ;
Ord,
Num,
Ord,
Card = ResAra.NumOrdCard ;
Predet = ResAra.Predet ;
Det = ResAra.Det ;
-- {s : Species => Gender => Case => Str ;
-- d : State; n : Size; isNum : Bool } ;
Quant = {s : ResAra.Number => Species => Gender => Case => Str;
d : State;
isNum : Bool;
isPron: Bool} ;
Quant = ResAra.Quant ;
Art = {s : ResAra.Number => Species => Gender => Case => Str;
d : State} ;
@@ -75,22 +72,30 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in {
Conj = {s : Str ; n : ResAra.Number} ;
-- DConj = {s1,s2 : Str ; n : ResAra.Number} ;
-- Subj = {s : Str} ;
Prep = {s : Str} ;
Subj = {s : Str ; o : Order} ;
Prep = ResAra.Preposition ;
-- Open lexical classes, e.g. Lexicon
V, VS, VQ, VA = ResAra.Verb ; -- = {s : VForm => Str} ;
V2, V2A = ResAra.Verb ** {c2 : Str} ;
VV, V2V, V2S, V2Q = ResAra.Verb ** {c2 : Str} ; --- AR
V3 = ResAra.Verb ** {c2, c3 : Str} ;
V2, V2A = ResAra.Verb2 ;
VV = ResAra.Verb2 ** {sc : Preposition} ; -- c2 is for verb
V2S, V2Q = ResAra.Verb2 ;
V3 = ResAra.Verb3 ;
V2V = ResAra.Verb3 ** {sc : Preposition} ; -- c3 is for verb, c2 is for dir.obj
A = ResAra.Adj ;
A2 = ResAra.Adj ** {c2 : Str} ;
A2 = ResAra.Adj2 ;
N = ResAra.Noun ;
N2 = ResAra.Noun ** {c2 : Str} ;
N3 = ResAra.Noun ** {c2, c3 : Str} ;
N2 = ResAra.Noun2 ;
N3 = ResAra.Noun3 ;
PN = {s : Case => Str; g : Gender; h : Species} ;
linref
CN = \cn -> uttCN cn ! Masc ;
N = \n -> uttCN (useN n) ! Masc ;
VP = \vp -> uttVP vp ! Masc ;
}

View File

@@ -1,45 +1,82 @@
concrete ConjunctionAra of Conjunction =
CatAra ** open ResAra, Coordination, Prelude in {
--
-- flags optimize=all_subs ;
--
-- lin
--
-- ConjS = conjunctSS ;
-- DConjS = conjunctDistrSS ;
--
-- ConjAdv = conjunctSS ;
-- DConjAdv = conjunctDistrSS ;
--
-- ConjNP conj ss = conjunctTable Case conj ss ** {
-- a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p}
-- } ;
-- DConjNP conj ss = conjunctDistrTable Case conj ss ** {
-- a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p}
-- } ;
--
-- ConjAP conj ss = conjunctTable Agr conj ss ** {
-- isPre = ss.isPre
-- } ;
-- DConjAP conj ss = conjunctDistrTable Agr conj ss ** {
-- isPre = ss.isPre
-- } ;
--
---- These fun's are generated from the list cat's.
--
-- BaseS = twoSS ;
-- ConsS = consrSS comma ;
-- BaseAdv = twoSS ;
-- ConsAdv = consrSS comma ;
-- BaseNP x y = twoTable Case x y ** {a = conjAgr x.a y.a} ;
-- ConsNP xs x = consrTable Case comma xs x ** {a = conjAgr xs.a x.a} ;
-- BaseAP x y = twoTable Agr x y ** {isPre = andB x.isPre y.isPre} ;
-- ConsAP xs x = consrTable Agr comma xs x ** {isPre = andB xs.isPre x.isPre} ;
--
-- lincat
-- [S] = {s1,s2 : Str} ;
-- [Adv] = {s1,s2 : Str} ;
-- [NP] = {s1,s2 : Case => Str ; a : Agr} ;
-- [AP] = {s1,s2 : Agr => Str ; isPre : Bool} ;
--
lincat
[S] = {s1,s2 : Order => Str} ;
[Adv] = {s1,s2 : Str} ;
[NP] = {s1,s2 : Case => Str ; a : Agr ; empty : Str} ;
[AP] = {s1,s2 : Species => Gender => Number => State => Case => Str} ;
lin
BaseAdv = twoSS ;
ConsAdv = consrSS comma ;
ConjAdv = conjunctSS ;
BaseS = twoTable Order ;
ConsS = consrTable Order comma ;
ConjS = conjunctTable Order ;
BaseNP x y = twoTable Case x y ** {
a = conjAgr x.a y.a ;
empty = []
} ;
ConsNP xs x = consrTable Case comma xs x ** {
a = conjAgr xs.a x.a ;
empty = []
} ;
ConjNP conj ss = conjunctTable Case conj ss ** {
a = let gn = pgn2gn ss.a.pgn in
{pgn = Per3 gn.g (conjNumber conj.n gn.n) ; isPron = False} ;
empty = []
} ;
BaseAP = twoTable5 Species Gender Number State Case ;
ConsAP = consrTable5 Species Gender Number State Case comma ;
ConjAP = conjunctTable5 Species Gender Number State Case ;
oper
conjAgr : Agr -> Agr -> Agr = \a,b -> {
isPron = False ;
pgn = let gnA = pgn2gn a.pgn ; gnB = pgn2gn b.pgn in
Per3 (conjGender gnA.g gnB.g) (conjNumber gnA.n gnB.n)
} ;
conjGender : Gender -> Gender -> Gender = \g,h ->
case g of {Fem => h ; _ => Masc} ;
conjNumber : Number -> Number -> Number = \m,n ->
case m of {Sg => n ; _ => Pl} ;
-- move to predef?
ListTable5 : PType -> PType -> PType -> PType -> PType -> Type = \P,Q,R,T,S ->
{s1,s2 : P => Q => R => T => S => Str} ;
twoTable5 : (P,Q,R,T,S : PType) -> (_,_ : {s : P => Q => R => T => S => Str}) ->
ListTable5 P Q R T S =
\_,_,_,_,_,x,y ->
{s1 = x.s ; s2 = y.s} ;
consrTable5 :
(P,Q,R,T,S : PType) -> Str -> {s : P => Q => R => T => S => Str} ->
ListTable5 P Q R T S -> ListTable5 P Q R T S =
\P,Q,R,T,S,c,x,xs ->
{s1 = \\p,q,r,t,s => xs.s1 ! p ! q ! r ! t ! s ++ c ++ xs.s2 ! p ! q ! r ! t ! s ;
s2 = x.s
} ;
conjunctTable5 :
(P,Q,R,T,S : PType) -> Conjunction -> ListTable5 P Q R T S -> {s : P => Q => R => T => S => Str} =
\P,Q,R,T,S,or,xs ->
{s = \\p,q,r,t,s => xs.s1 ! p ! q ! r ! t ! s ++ or.s ++ xs.s2 ! p ! q ! r ! t ! s} ;
-- conjunctDistrTable5 :
-- (P,Q,R,T,S : PType) -> ConjunctionDistr -> ListTable5 P Q R T S ->
-- {s : P => Q => R => T => S => Str} =
-- \P,Q,R,T,S,or,xs ->
-- {s = \\p,q,r,t,s => or.s1++ xs.s1 ! p ! q ! r ! t ! s ++ or.s2 ++ xs.s2 ! p ! q ! r ! t ! s} ;
}

View File

@@ -0,0 +1,156 @@
concrete ConstructionAra of Construction = CatAra ** open
Prelude,
ParadigmsAra,
SyntaxAra,
SymbolicAra,
StructuralAra,
(E=ExtendAra),
(R=ResAra),
(L=LexiconAra) in {
lincat
Timeunit = N ;
Weekday = N ;
Monthday = NP ;
Month = N ;
Year = NP ;
lin
timeunitAdv n time =
let n_card : Card = n ;
n_hours_NP : NP = mkNP n_card time ;
in SyntaxAra.mkAdv during_Prep n_hours_NP | ParadigmsAra.mkAdv (n_hours_NP.s ! R.Nom) ;
-- random guesses
weekdayPunctualAdv w = SyntaxAra.mkAdv on_Prep (mkNP w) ; -- on Sunday
weekdayHabitualAdv w = SyntaxAra.mkAdv on_Prep (mkNP w) ; -- on Sundays
weekdayNextAdv w = SyntaxAra.mkAdv on_Prep (mkNP w) ; -- next Sunday
weekdayLastAdv w = SyntaxAra.mkAdv on_Prep (mkNP w) ; -- last Sunday
monthAdv m = SyntaxAra.mkAdv in_Prep (mkNP m) ;
yearAdv y = SyntaxAra.mkAdv in_Prep y ;
-- dummy
dayMonthAdv d m = SyntaxAra.mkAdv on_Prep (mkNP d) ; -- on 17 May
monthYearAdv m y = SyntaxAra.mkAdv on_Prep (mkNP m) ; -- in May 2012
dayMonthYearAdv d m y = SyntaxAra.mkAdv on_Prep y ; -- on 17 May 2013
intYear = symb ;
intMonthday = symb ;
-- n_units_AP
oper
-- hack used in the name constructions
toNP : Bool -> NP -> NP = \b -> if_then_else NP b R.emptyNP ;
lin
-- : NP -> NP -> Cl
have_name_Cl np nm =
let subjPron : Pron = R.np2pron np ;
me : NP = toNP np.a.isPron np ;
myName : NP = E.ApposNP me (mkNP (mkDet subjPron) L.name_N) ;
in mkCl myName nm ;
-- : NP -> QCl
what_name_QCl np =
let subjPron : Pron = R.np2pron np ;
me : R.NP = toNP np.a.isPron np ;
myName : NP = E.ApposNP me (mkNP (mkDet subjPron) L.name_N) ;
what_IP : R.IP = R.mkIP "مَا هُوَ" R.Sg ;
in mkQCl what_IP myName ;
-- how_old_QCl
-- hungry_VP =
-- thirsty_VP =
lincat Language = N ;
lin InLanguage l = mkAdv in_Prep (mkNP l) ;
lin
weekdayN w = w ;
monthN m = m ;
weekdayPN w = mkPN w ;
monthPN m = mkPN m ;
languageCN l = mkCN l ;
languageNP l = mkNP l ;
oper mkLanguage : Str -> N = mkN ;
----------------------------------------------
---- lexicon of snpcial names
-- TODO in arabic
lin second_Timeunit = mkN "second" ;
lin minute_Timeunit = mkN "minute" ;
lin hour_Timeunit = mkN "hour" ;
lin day_Timeunit = mkN "day" ;
lin week_Timeunit = mkN "week" ;
lin month_Timeunit = mkN "month" ;
lin year_Timeunit = mkN "year" ;
lin monday_Weekday = mkN "Monday" ;
lin tuesday_Weekday = mkN "Tuesday" ;
lin wednesday_Weekday = mkN "Wednesday" ;
lin thursday_Weekday = mkN "Thursday" ;
lin friday_Weekday = mkN "Friday" ;
lin saturday_Weekday = mkN "Saturday" ;
lin sunday_Weekday = mkN "Sunday" ;
lin january_Month = mkN "January" ;
lin february_Month = mkN "February" ;
lin march_Month = mkN "March" ;
lin april_Month = mkN "April" ;
lin may_Month = mkN "May" ;
lin june_Month = mkN "June" ;
lin july_Month = mkN "July" ;
lin august_Month = mkN "August" ;
lin september_Month = mkN "September" ;
lin october_Month = mkN "October" ;
lin november_Month = mkN "November" ;
lin december_Month = mkN "December" ;
-- lin afrikaans_Language = mkLanguage "Afrikaans" ;
-- lin amharic_Language = mkLanguage "Amharic" ;
lin arabic_Language = mkLanguage "عَرَبِيَّة" ;
-- lin bulgarian_Language = mkLanguage "Bulgarian" ;
-- lin catalan_Language = mkLanguage "Catalan" ;
-- lin chinese_Language = mkLanguage "Chinese" ;
-- lin danish_Language = mkLanguage "Danish" ;
-- lin dutch_Language = mkLanguage "Dutch" ;
lin english_Language = mkLanguage "إنْجلِيزيْة" ;
-- lin estonian_Language = mkLanguage "Estonian" ;
lin finnish_Language = mkLanguage "فِنْلَنْدِيّة" ;
-- lin french_Language = mkLanguage "French" ;
-- lin german_Language = mkLanguage "German" ;
-- lin greek_Language = mkLanguage "Greek" ;
-- lin hebrew_Language = mkLanguage "Hebrew" ;
-- lin hindi_Language = mkLanguage "Hindi" ;
-- lin japanese_Language = mkLanguage "Japanese" ;
-- lin italian_Language = mkLanguage "Italian" ;
-- lin latin_Language = mkLanguage "Latin" ;
-- lin latvian_Language = mkLanguage "Latvian" ;
-- lin maltese_Language = mkLanguage "Maltese" ;
-- lin nepali_Language = mkLanguage "Nepali" ;
-- lin norwegian_Language = mkLanguage "Norwegian" ;
lin nprsian_Language = mkLanguage "فَارِسيّة" ;
-- lin polish_Language = mkLanguage "Polish" ;
-- lin punjabi_Language = mkLanguage "Punjabi" ;
-- lin romanian_Language = mkLanguage "Romanian" ;
-- lin russian_Language = mkLanguage "Russian" ;
-- lin sindhi_Language = mkLanguage "Sindhi" ;
-- lin spanish_Language = mkLanguage "Spanish" ;
-- lin swahili_Language = mkLanguage "Swahili" ;
lin swedish_Language = mkLanguage "سُويدِيّة" ;
-- lin thai_Language = mkLanguage "Thai" ;
-- lin turkish_Language = mkLanguage "Turkish" ;
-- lin urdu_Language = mkLanguage "Urdu" ;
}

View File

@@ -4,16 +4,56 @@ concrete ExtendAra of Extend =
CatAra ** ExtendFunctor - [
GenNP, SlashBareV2S, PredAPVP, GenModNP, ExistsNP,
StrandRelSlash, ExistPluralCN, ExistMassCN, ExistCN, EmptyRelSlash, DetNPMasc, DetNPFem,
ComplBareVS, ComplDirectVS, ComplDirectVQ
ComplBareVS, ComplDirectVS, ComplDirectVQ,
ICompAP,
VPS, MkVPS, PredVPS, BaseVPS, ConsVPS, ConjVPS,
ApposNP
]
with (Grammar=GrammarAra)
** open
ParamX,
ResAra,
Prelude,
ResAra
Coordination
in {
lin
GenNP np = { s = \\_,_,_,_ => np.s ! Gen ; d = Const ; isNum, isPron = False } ;
} ;
GenNP np = {s = \\_,_,_,_ => np.s ! Gen ; d = Const ; isNum,isPron,is1sg = False} ;
-- : NP -> NP -> NP
ApposNP np1 np2 = np2 ** {s = \\c => np1.s ! c ++ np2.s ! c} ;
-- : AP -> IComp ; -- "how old"
ICompAP ap = {s = \\gn => "كَمْ" ++ ap.s ! NoHum ! gn.g ! gn.n ! Indef ! Acc} ;
lincat
VPS = {s : PerGenNum => Str} ; -- finite VP's with tense and polarity
[VPS] = {s1,s2 : PerGenNum => Str} ;
lin
-- : Temp -> Pol -> VP -> VPS ; -- hasn't slept
MkVPS t p vp = {
s = \\pgn => let vps =
wordOrderNoSubj
Nominal -- Nominal (=SVO) generalises best for ConjVPS.
vp.obj.a.isPron
(vStr vp pgn t.t p.p Nominal)
(case <vp.isPred,vp.obj.a.isPron> of {
<False,True> => BIND ++ vp.obj.s ;
_ => vp.obj.s })
(pred vp pgn t.t p.p)
vp.s2
in vps.before ++ vps.after -- word order is SVO, so this is safe for just this case.
} ;
BaseVPS = twoTable PerGenNum ;
ConsVPS = consrTable PerGenNum comma ;
ConjVPS = conjunctTable PerGenNum ;
PredVPS np vps = {
s = \\_ => np.s ! Nom ++ vps.s ! np.a.pgn -- first quick version with order always Nominal.
} ; -- if necessary, change VPS into {s : PerGenNum => Order => {before,after : Str}}
}

View File

@@ -1,15 +1,63 @@
concrete IdiomAra of Idiom = CatAra ** open Prelude, ResAra in {
flags coding=utf8;
--
-- flags optimize=all_subs ;
--
-- lin
-- ExistNP np =
-- mkClause "تهري" (agrP3 np.a.n) (insertObj (\\_ => np.s ! Acc) (predAux auxBe)) ;
-- ImpersCl vp = mkClause "ِت" (agrP3 Sg) vp ;
-- GenericCl vp = mkClause "ْني" (agrP3 Sg) vp ;
--
-- ProgrVP vp = insertObj (\\a => vp.ad ++ vp.prp ++ vp.s2 ! a) (predAux auxBe) ;
--
}
concrete IdiomAra of Idiom = CatAra ** open
Prelude,
ResAra,
VerbAra,
ParadigmsAra
in {
lin
-- : VP -> Cl ; -- it is hot
ImpersCl vp =
let it : ResAra.NP = case vp.isPred of {
True => pron2np (pgn2pron vp.obj.a.pgn) ;
False => pgn2pron vp.obj.a.pgn } ; -- if no obj, Per3 Masc Sg chosen by default
in predVP it vp ;
-- : VP -> Cl ; -- one sleeps
GenericCl = predVP (regNP "المَرْء" Sg) ;
-- : NP -> RS -> Cl ; -- it is I who did it
--CleftNP np rs =
-- : Adv -> S -> Cl ; -- it is here she slept
CleftAdv adv s =
let comp : Comp = CompAdv (lin Adv {s = adv.s ++ s.s ! Verbal}) ; -- no idea about word order /IL
pass_V = mkV "مضي" va vi ; -- switch to copula or some other verb if better /IL
in predVP emptyNP (UseV pass_V ** {isPred=True ; pred=comp}) ; -- very hacky /IL
-- : NP -> Cl ; -- there is a house
ExistNP np =
predVP (emptyNP ** {s=\\c=>"هُنَاكَ"}) (UseComp (CompNP np)) ; -- IL
-- ExistIP : IP -> QCl ; -- which houses are there
-- 7/12/2012 generalizations of these
-- : NP -> Adv -> Cl ; -- there is a house in Paris
ExistNPAdv np adv =
predVP (emptyNP ** {s=\\c=>"هُنَاكَ"}) (AdvVP (UseComp (CompNP np)) adv) ; -- IL
-- ExistIPAdv : IP -> Adv -> QCl ; -- which houses are there in Paris
-- ProgrVP : VP -> VP ; -- be sleeping
-- ImpPl1 : VP -> Utt ; -- let's go
-- ImpP3 : NP -> VP -> Utt ; -- let John walk
-- 3/12/2013 non-reflexive uses of "self"
-- : VP -> VP ; -- is at home himself; is himself at home
SelfAdvVP,
SelfAdVVP = \vp -> vp ** {
s = \\pgn,vf => vp.s ! pgn ! vf ++ reflPron Nom pgn
} ;
-- : NP -> NP ; -- the president himself (is at home)
SelfNP np = np ** {
s = \\c => np.s ! c ++ reflPron c (np.a.pgn)
} ;
}

View File

@@ -1,8 +1,9 @@
--# -path=.:../abstract:../common:../prelude
--# -path=.:../abstract:../common:../api:../prelude
concrete LangAra of Lang =
GrammarAra,
LexiconAra
LexiconAra,
ConstructionAra
** {
flags startcat = Phr ; unlexer = text ; lexer = text ; coding = utf8 ;

View File

@@ -3,7 +3,6 @@
concrete LexiconAra of Lexicon = CatAra ** open
ParadigmsAra,
ResAra,
MorphoAra, --shouldn't open it here, only needed reg &sndf
Prelude in {
flags
@@ -11,35 +10,37 @@ flags
lin
airplane_N = sdfN "ط؟ر" "فاعِلة" Fem NoHum ;
airplane_N = sdfN "طءر" "فاعِلة" Fem NoHum ;
answer_V2S = dirV2 (v3 "جوب") ;
apartment_N = brkN "شقّ" "فِعّة" "فِعَل" Fem NoHum ;
apple_N = sdfN "تفح" "فِعّالة" Fem NoHum ;
art_N = brkN "فنّ" "فَعّ" "فُعُول" Masc NoHum ;
ask_V2Q = dirV2 (regV "يَس؟َل") ;
-- ask_V2Q = dirV2 (v1 "س؟ل" a a) ;
baby_N = brkN "طفل" "فِعل" "أَفعال" Masc Hum;
bad_A = sndA "سو؟" "فَيِّع" ;
art_N = brkN "فنن" "فَعّ" "فُعُول" Masc NoHum ;
ask_V2Q = dirV2 (regV "يَسءَل") ;
-- ask_V2Q = dirV2 (v1 "سءل" a a) ;
baby_N = brkN "طفل" "فِعل" "أَفعَال" Masc Hum;
-- bad_A = sndA "سوء" "فَيِّع" ;
bad_A = degrA "سَيِّئ" "سَيِّئَة" "سَيِّئِين" ;
bank_N = brkN "بنك" "فَعل" "فُعُول" Masc NoHum ;
beautiful_A = sndA "جمل" "فَعِيل" ;
become_VA = mkVA (v4 "صبح") ;
beer_N = sdfN "بير" "فِعلة" Fem NoHum ;
beg_V2V = dirV2 (v5 "وسل") ;
beg_V2V = mkV2V (mkVV (v5 "وسل")) noPrep ;
big_A = sndA "كبر" "فَعِيل" ;
bike_N = sdfN "درج" "فَعّالة" Fem NoHum ;
bird_N = brkN "طير" "فَعل" "فُعُول" Masc NoHum;
black_A = clrA "سود" ;
blue_A = clrA "زرق" ;
boat_N = brkN "قرب" "فاعِل" "فَواعِل" Masc NoHum ;
book_N = brkN "كتب" "فِعال" "فُعُل" Masc NoHum ;
book_N = brkN "كتب" "فِعَال" "فُعُل" Masc NoHum ;
boot_N = sdfN "جزم" "فَعلة" Fem NoHum ;
boss_N = brkN "دور" "مُفِيع" "مُفَعاء" Masc Hum ;
boss_N = sdmN "دور" "مُفِيع" Masc Hum ;
--boss_N = brkN "دور" "مُفِيع" "مُفَعَاء" Masc Hum ;
boy_N = brkN "صبي" "فَعِل" "فُعلان" Masc Hum ;
bread_N = brkN "خبز" "فُعل" "أَفعال" Masc NoHum ;
bread_N = brkN "خبز" "فُعل" "أَفعَال" Masc NoHum ;
break_V2 = dirV2 (regV "يَكسُر") ;
-- break_V2 = dirV2 (v1 "كسر" a u) ;
broad_A = sndA "وسع" "فاعِل" ;
brother_N2 = mkN2 (brkN "؟خو" "فَع" "فِعلة" Masc Hum) ; --FIXME
brother_N2 = mkN2 (brkN "ءخو" "فَع" "فِعلة" Masc Hum) ; --FIXME dual
brown_A = sndA "بني" "فُعِّل";
butter_N = sdfN "سبد" "فُعلة" Fem NoHum ;
buy_V2 = dirV2 (v8 "شري") ;
@@ -47,74 +48,73 @@ flags
cap_N = sdfN "قبع" "فُعَّلة" Fem NoHum ; --qalnUsö
car_N = sdfN "سير" "فَعّالة" Fem NoHum ;
carpet_N = sdfN "سجد" "فَعّالة" Fem NoHum ;
cat_N = brkN "هرّ" "فِعّة" "فِعَل" Fem NoHum ;
cat_N = brkN "هرّ" "فِعّ" "فِعَلَة" Fem NoHum ;
ceiling_N = brkN "سقف" "فَعل" "أَفعُل" Masc NoHum ;
chair_N = brkN "كرس" "فُعلِي" "فَعالِي" Masc NoHum ;
cheese_N = brkN "جبن" "فُعلة" "أَفعال" Fem NoHum ;
child_N = brkN "ولد" "فَعَل" "أَفعال" Masc Hum ;
church_N = brkN "كنس" "فَعِيلة" "فَعاٱِل" Fem Hum ;
chair_N = brkN "كرس" "فُعلِي" "فَعَالِي" Masc NoHum ;
cheese_N = brkN "جبن" "فُعلة" "أَفعَال" Fem NoHum ;
child_N = brkN "ولد" "فَعَل" "أَفعَال" Masc Hum ;
church_N = brkN "كنس" "فَعِيلة" "فَعَاٱِل" Fem Hum ;
city_N = brkN "مدن" "فَعِيلة" "فُعُل" Fem NoHum ;
clean_A = sndA "نظف" "فَعِيل" ;
clever_A = sndA "جهد" "مُفتَعِل" ;
close_V2 = dirV2 (v4 "غلق") ;
coat_N = brkN "عطف" "مِفعَل" "مَفاعِل" Masc NoHum ;
cold_A = sndA "برد" "فاعِل" ;
come_V = v1 "جي؟" a i ; --check
come_V = v1 "جيء" a i ; --check
computer_N = brkN "حسب" "فاعُول" "فَواعِيل" Masc NoHum ;
country_N = brkN "بلد" "فَعَل" "فِعال" Masc NoHum ;
country_N = brkN "بلد" "فَعَل" "فِعَال" Masc NoHum ;
cousin_N = brkN "قرب" "فَعِيل" "أَفعِلاء" Masc Hum ; -- (<bn / bnt) (cam[ö] / xAl[ö])
cow_N = sdfN "بقر" "فَعلة" Fem NoHum ;
die_V = v1 "موت" a u ; --check
dirty_A = sndA "وسخ" "فَعِل" ;
distance_N3 = mkN3 (sdfN "سوف" "مَفاعة" Fem NoHum) "مِن" "إِلَى" ;
doctor_N = brkN "طبّ" "فَعِيل" "أَفِعّاء" Masc Hum ;
dog_N = brkN "كلب" "فَعل" "فِعال" Masc NoHum ;
door_N = brkN "بوب" "فاع" "أَفعال" Masc NoHum ;
doctor_N = brkN "طبب" "فَعِيل" "أَفِعّاء" Masc Hum ;
dog_N = brkN "كلب" "فَعل" "فِعَال" Masc NoHum ;
door_N = brkN "بوب" "فاع" "أَفعَال" Masc NoHum ;
drink_V2 = dirV2 (regV "شَرِب") ;
-- drink_V2 = dirV2 (v1 "شرب" i a) ;
easy_A2V = mkA2 (sndA "سهل" "فَعل") "لِ" ;
eat_V2 = dirV2 (regV "يَ؟كُل") ;
-- eat_V2 = dirV2 (v1 "؟كل" a u) ;
easy_A2V = mkA2 (sndA "سهل" "فَعل") liPrep ;
eat_V2 = dirV2 (mkV "ءكل" FormI) ;
empty_A = sndA "فرغ" "فاعِل" ;
enemy_N = brkN "عدو" "فَعُلّ" "أَفعاء" Masc Hum ;
enemy_N = brkN "عدو" "فَعُلّ" "أَفعَاء" Masc Hum ;
factory_N = brkN "صنع" "مَفعَل" "مَفاعِل" Masc NoHum ;
father_N2 = mkN2 (brkN "؟ب" "فَع" "أَفعاء" Masc Hum);
father_N2 = mkN2 (brkN "ءب" "فَع" "أَفعَاء" Masc Hum);
fear_VS = mkVS (v1 "خشي" i a );
find_V2 = dirV2 (v1 "وجد" a i ) ;
fish_N = brkN "سمك" "فَعَلة" "أَفعال" Fem NoHum ;
floor_N = brkN "؟رض" "فَعل" "فَعالِي" Fem NoHum;
fish_N = brkN "سمك" "فَعَلة" "أَفعَال" Fem NoHum ;
floor_N = brkN "ءرض" "فَعل" "فَعَالِي" Fem NoHum;
forget_V2 = dirV2 (v1 "نسي" i a ) ;
fridge_N = sdfN "برد" "فَعّال" Masc NoHum ;
friend_N = brkN "صدق" "فَعِيل" "أَفعِلاء" Masc Hum ; --SadIqö
fruit_N = brkN "فكه" "فاعِلة" "فَواعِل" Fem NoHum ;
fun_AV = sndA "متع" "مُفعِل" ;
garden_N = brkN "حدق" "فَعِيلة" "فَعاٱِل" Fem NoHum ;
girl_N = brkN "بنت" "فِعل" "فَعال" Fem Hum ;
garden_N = brkN "حدق" "فَعِيلة" "فَعَاٱِل" Fem NoHum ;
girl_N = brkN "بنت" "فِعل" "فَعَال" Fem Hum ;
glove_N = sdfN "قفز" "فُعّال" Masc NoHum ;
gold_N = sdfN "ذهب" "فَعَل" Masc NoHum ;
good_A = sndA "جود" "فَيِّع" ; -- Hasan, HisAn
go_V = regV "يَذهَب" ;
-- go_V = v1 "ذهب" a a ;
green_A = clrA "خضر" ;
harbour_N = brkN "رف؟" "مَفعَل" "مَفاعِل" Masc NoHum ; --mInA', marsaY
harbour_N = brkN "رفء" "مَفعَل" "مَفاعِل" Masc NoHum ; --mInA', marsaY
hate_V2 = dirV2 (regV "كَرِه") ;
hat_N = sdfN "قبع" "فُعَّلة" Fem NoHum ;
-- have_V2 = dirV2 (v1 "ملك" a i) ;
hear_V2 = dirV2 (regV "سَمِع") ;
-- hear_V2 = dirV2 (v1 "سمع" i a) ;
hill_N = brkN "هضب" "فَعلة" "فِعال" Fem NoHum ; --tallö, rAbiyö
hill_N = brkN "هضب" "فَعلة" "فِعَال" Fem NoHum ; --tallö, rAbiyö
hope_VS = mkVS (v1 "رجو" a u) ; --check
horse_N = brkN "حصن" "فِعال" "أَفعِلة" Masc NoHum ;
horse_N = brkN "حصن" "فِعَال" "أَفعِلة" Masc NoHum ;
hot_A = sndA "سخن" "فاعِل" ; --HAr
house_N = brkN "بيت" "فَعل" "فُعُول" Masc NoHum ; --manzil
important_A = sndA "هيم" "فاعّ" ;
industry_N = sdfN "صنع" "فِعالة" Fem NoHum ;
iron_N = brkN "حدّ" "فَعِيل" "فَعائِل" Masc NoHum ;
industry_N = sdfN "صنع" "فِعَالة" Fem NoHum ;
iron_N = brkN "حدد" "فَعِيل" "فَعَائِل" Masc NoHum ;
king_N = brkN "ملك" "فَعِل" "فُعُول" Masc Hum ;
know_V2 = dirV2 (regV "عَرِف") ;
know_VS = mkVS (regV "عَرِف") ; -- or with ع ل م?
know_VS = mkVS (regV "عَرِف") ; -- or with ع ل م?
lake_N = sdfN "بحر" "فُعَيلة" Fem NoHum ;
lamp_N = brkN "صبح" "مِفعال" "مَفاعِيل" Masc NoHum ; --qanDIl, fAnUs
lamp_N = brkN "صبح" "مِفعَال" "مَفاعِيل" Masc NoHum ; --qanDIl, fAnUs
learn_V2 = dirV2 (v5 "علم") ;
leather_N = brkN "جلد" "فِعل" "فُعُول" Masc NoHum ;
leave_V2 = dirV2 (regV "يَترُك") ;
@@ -128,16 +128,16 @@ flags
-- lose_V2 = dirV2 (v1 "خسر" i a) ; --Dayyac, >aDAc
love_N = brkN "حبّ" "فُعّ" "فُعّ" Masc NoHum ; -- no plur
love_V2 = dirV2 (v1 "حبّ" a i) ;
man_N = brkN "رجل" "فَعُل" "فِعال" Masc Hum ;
man_N = brkN "رجل" "فَعُل" "فِعَال" Masc Hum ;
married_A2 = mkA2 (sndA "زوج" "مُتَفَعِّل") "مِن" ;
meat_N = brkN "لحم" "فَعلة" "فُعُول" Masc NoHum ;
milk_N = brkN "حلب" "فَعِيل" "فَعِيل" Masc NoHum ; --no plur
moon_N = brkN "قمر" "فَعَل" "أَفعال" Masc NoHum ;
mother_N2 = mkN2 (sdfN "؟م" "فُعّ" Fem Hum) ;
mountain_N = brkN "جبل" "فَعَل" "فِعال" Masc NoHum ;
moon_N = brkN "قمر" "فَعَل" "أَفعَال" Masc NoHum ;
mother_N2 = mkN2 (sdfN "ءم" "فُعَّ" Fem Hum) ;
mountain_N = brkN "جبل" "فَعَل" "فِعَال" Masc NoHum ;
music_N = mkN (reg "مُوسِيقَى" "مُوسِيقَى") Fem NoHum ; --no plur
narrow_A = sndA "ضيق" "فَعِّل" ;
new_A = sndA "جدّ" "فَعِيل" ;
new_A = mkA "جدد" "فَعِيل" "فُعُل" ;
newspaper_N = brkN "صحف" "فَعِيلة" "فُعُل" Fem NoHum ;
oil_N = brkN "زيت" "فَعل" "فُعُول" Masc NoHum ;
old_A = sndA "قدم" "فَعِيل" ;
@@ -145,10 +145,10 @@ flags
-- open_V2 = dirV2 (v1 "فتح" a a ) ;
paint_V2A = mkV2A (regV "يَدهَن" ) [] ;
-- paint_V2A = mkV2A (v1 "دهن" a a ) [] ;
paper_N = brkN "ورق" "فَعَلة" "أَفعال" Fem NoHum ;
paper_N = brkN "ورق" "فَعَلة" "أَفعَال" Fem NoHum ;
paris_PN = mkPN "بارِيس" Fem NoHum ;
peace_N = brkN "سلم" "فَعال" "فَعال" Masc NoHum; --no plur
pen_N = brkN "قلم" "فَعَل" "أَفعال" Masc NoHum;
peace_N = brkN "سلم" "فَعَال" "فَعَال" Masc NoHum; --no plur
pen_N = brkN "قلم" "فَعَل" "أَفعَال" Masc NoHum;
planet_N = mkN (reg "كَوكَب" "كَواكِب") Masc NoHum ; -- quadriconsonantal
plastic_N = mkN (sndf "بلاستِيك") Masc NoHum ;
play_V2 = dirV2 (regV "لَعِب") ;
@@ -160,15 +160,15 @@ flags
radio_N = mkN (sndf "راديُو") Masc NoHum ;
rain_V0 = mkV0 (regV "يَمطُر") ;
-- rain_V0 = mkV0 (v1 "مطر" a u) ;
read_V2 = dirV2 (regV "يَقرَ؟") ;
-- read_V2 = dirV2 (v1 "قر؟" a a ) ;
read_V2 = dirV2 (regV "يَقرَء") ;
-- read_V2 = dirV2 (v1 "قرء" a a ) ;
red_A = clrA "حمر" ;
religion_N = brkN "دين" "فِعل" "أَفعال" Masc NoHum ;
religion_N = brkN "دين" "فِعل" "أَفعَال" Masc NoHum ;
restaurant_N = brkN "طعم" "مَفعَل" "مَفاعِل" Masc NoHum ;
river_N = brkN "نهر" "فَعل" "أَفعال" Masc NoHum ;
river_N = brkN "نهر" "فَعل" "أَفعَال" Masc NoHum ;
rock_N = brkN "صخر" "فَعلة" "فُعُول" Fem NoHum ;
roof_N = brkN "سطح" "فَعل" "أَفعُل" Masc NoHum ;
rubber_N = brkN "مطّ" "فَعّال" "فَعّال" Masc NoHum ; -- no hum
rubber_N = brkN "مطط" "فَعَّال" "فَعَّال" Masc NoHum ; -- no hum
run_V = regV "يَركُض" ;
-- run_V = v1 "ركض" a u ;
say_VS = mkVS (v1 "قول" a u) ; --check
@@ -177,41 +177,41 @@ flags
sea_N = brkN "بحر" "فَعل" "فُعُول" Masc NoHum ;
seek_V2 = dirV2 (regV "يَطلُب") ;
-- seek_V2 = dirV2 (v1 "طلب" a u) ;
see_V2 = dirV2 (v1 "ر؟ي" a a) ;
see_V2 = dirV2 (v1 "رءي" a a) ;
sell_V3 = dirdirV3 (v1 "بيع" a i) ; --check
send_V3 = dirdirV3 (v4 "رسل") ;
sheep_N = brkN "خرف" "فَعُول" "فِعال" Masc NoHum ;
sheep_N = brkN "خرف" "فَعُول" "فِعَال" Masc NoHum ;
ship_N = brkN "سفن" "فَعِيلة" "فُعُل" Fem NoHum ;
shirt_N = brkN "قمص" "فَعِيل" "فُعلان" Masc NoHum ;
shoe_N = brkN "حذو" "فِعاء" "أَفعِية" Masc NoHum ;
shoe_N = brkN "حذو" "فِعَاء" "أَفعِية" Masc NoHum ;
shop_N = brkN "تجر" "مَفعَل" "مَفاعِل" Masc NoHum ;
short_A = sndA "قصر" "فَعِيل" ;
silver_N = brkN "فضّ" "فِعّة" "فِعَل" Fem NoHum ;
sister_N = brkN "؟خو" "فُعت" "فَعَوات" Fem Hum ; --FIXME
silver_N = brkN "فضض" "فِعَّة" "فِعَل" Fem NoHum ;
sister_N = brkN "ءخو" "فُعت" "فَعَوَات" Fem Hum ; --FIXME
sleep_V = v1 "نوم" i a ; --check
small_A = sndA "صغر" "فَعِيل" ;
snake_N = sdfN "حيّ" "فَعّة" Fem NoHum ;
snake_N = sdfN "حيّ" "فَعَّة" Fem NoHum ;
sock_N = brkN "جرب" "فَوعَل" "فَواعِل" Masc NoHum ;
speak_V2 = dirV2 (v5 "كلم") ;
star_N = brkN "نجم" "فَعل" "فُعُول" Masc NoHum ; --najmö
steel_N = brkN "فلذ" "فُوعال" "فَواعِل" Masc NoHum ;
stone_N = brkN "حجر" "فَعَل" "أَفعال" Masc NoHum ;
steel_N = brkN "فلذ" "فُوعَال" "فَواعِل" Masc NoHum ;
stone_N = brkN "حجر" "فَعَل" "أَفعَال" Masc NoHum ;
stove_N = brkN "وقد" "مَفعِل" "مَفاعِل" Masc NoHum ;
student_N = brkN "طلب" "فاعِل" "فُعّال" Masc Hum ; --tilmI*
stupid_A = clrA "بله" ;
sun_N = brkN "شمس" "فَعل" "فُعُول" Fem NoHum ;
switch8off_V2 = dirV2 (v4 "طف؟") ;
switch8off_V2 = dirV2 (v4 "طفء") ;
switch8on_V2 = dirV2 (v4 "شعل") ;
table_N = sdfN "طول" "فاعِلة" Fem NoHum ;
talk_V3 = mkV3 (v5 "حدث") "لِ" "عَن" ;
talk_V3 = mkV3 (v5 "حدث") liPrep (mkPrep "عَن") ;
teacher_N = sdmN "علم" "مُفَعِّل" Masc Hum ; --mucal~imö
teach_V2 = dirV2 (v2 "علم") ;
television_N = mkN (sndf "تِلِفِزيُون") Masc NoHum ;
thick_A = sndA "سمك" "فَعِيل" ;
thin_A = sndA "رفع" "فَعِيل" ;
train_N = sdfN "قطر" "فِعال" Masc NoHum;
train_N = sdfN "قطر" "فِعَال" Masc NoHum;
travel_V = v3 "سفر" ;
tree_N = brkN "شجر" "فَعلة" "أَفعال" Fem NoHum ;
tree_N = brkN "شجر" "فَعلة" "أَفعَال" Fem NoHum ;
ugly_A = sndA "قبح" "فَعِيل" ;
understand_V2 = dirV2 (regV "فَهِم") ;
-- understand_V2 = dirV2 (v1 "فهم" i a ) ;
@@ -219,7 +219,7 @@ flags
village_N = brkN "قري" "فَعلة" "فُعَى" Fem NoHum ; --Daycö
wait_V2 = dirV2 (v8 "نظر") ;
walk_V = v1 "مشي" a i ; --check
warm_A = sndA "دف؟" "فاعِل" ;
warm_A = sndA "دفء" "فاعِل" ;
war_N = brkN "حرب" "فَعل" "فُعُول" Fem NoHum ;
watch_V2 = dirV2 (v3 "شهد") ;
water_N = mkN (reg "ماء" "مِياه") Fem NoHum ; --"موه" "فاء" "فِياع" ??
@@ -229,34 +229,34 @@ flags
win_V2 = dirV2 (regV "رَبِح") ;
-- win_V2 = dirV2 (v1 "ربح" i a) ;
woman_N = mkN (reg "إِمرَأَة" "نِسوَة") Fem Hum ;
wonder_VQ = mkVQ (v6 "س؟ل") ;
wood_N = brkN "خشب" "فَعَل" "أَفعال" Masc NoHum ;
wonder_VQ = mkVQ (v6 "سءل") ;
wood_N = brkN "خشب" "فَعَل" "أَفعَال" Masc NoHum ;
write_V2 = dirV2 (regV "يَكتُب") ;
-- write_V2 = dirV2 (v1 "كتب" a u) ;
yellow_A = clrA "صفر" ;
young_A = sndA "شبّ" "فاعّ" ;
young_A = sndA "شبب" "فَاعّ" ;
do_V2 = dirV2 (regV "يَفعَل") ;
-- do_V2 = dirV2 (v1 "فعل" a a ) ;
now_Adv = mkAdv "الآن" ;
already_Adv = mkAdv "سابِقاً" ;
song_N = brkN "غني" "أَفعِلة" "أَفاعِي" Fem NoHum ;
song_N = brkN "غني" "أُفعِلَة" "أَفَاعِي" Fem NoHum ;
add_V3 = dirV3 (regV "يَجمَع") "وَ" ;
-- add_V3 = dirV3 (v1 "جمع" a a) "وَ" ;
number_N = brkN "رقم" "فَعل" "أَفعال" Masc NoHum ; --cadad
number_N = brkN "رقم" "فَعل" "أَفعَال" Masc NoHum ; --cadad
put_V2 = dirV2 (v1 "وضع" a a );
stop_V = v5 "وقف" ;
jump_V = regV "يَقفِز" ;
-- jump_V = v1 "قفز" a i ;
left_Ord = mkOrd "أَيسَر" "يُسرَى";
right_Ord = mkOrd "أَيمَن" "يُمنَى" ;
left_Ord = mkOrd "أَيسَر" "يُسرَى" One;
right_Ord = mkOrd "أَيمَن" "يُمنَى" One;
far_Adv = mkAdv "بَعِيداً" ;
correct_A = sndA "صحّ" "فَعِيل" ;
correct_A = sndA "صحّ" "فَعِيل" ; -- TODO broken plural
dry_A = sndA "نشف" "فاعِل" ;
dull_A = sndA "بهت" "فاعِل" ;
full_A = sndA "مل؟" "فَعِيل" ;
full_A = sndA "ملء" "فَعِيل" ;
heavy_A = sndA "ثقل" "فَعِيل" ;
near_A = sndA "قرب" "فَعِيل" ;
rotten_A = sndA "فسد" "فاعِل" ;
@@ -268,68 +268,68 @@ flags
wide_A = sndA "وسع" "فاعِل" ;
animal_N = sdfN "حيّ" "فَعَوان" Masc NoHum ;
ashes_N = brkN "رمد" "فَعال" "أَفعِلة" Masc NoHum;
ashes_N = brkN "رمد" "فَعَال" "أَفعِلة" Masc NoHum;
back_N = brkN "ظهر" "فَعل" "فُعُول" Masc NoHum;
bark_N = brkN "نبح" "فَعل" "فُعال" Masc NoHum;
bark_N = brkN "نبح" "فَعل" "فُعَال" Masc NoHum;
belly_N = brkN "بطن" "فَعل" "فُعُول" Fem NoHum;
blood_N = brkN "دم" "فَع" "فِعاء" Masc NoHum;
bone_N = brkN "عظم" "فَعلة" "فِعال" Fem NoHum;
blood_N = brkN "دم" "فَع" "فِعَاء" Masc NoHum;
bone_N = brkN "عظم" "فَعلة" "فِعَال" Fem NoHum;
breast_N = brkN "صدر" "فَعل" "فُعُول" Masc NoHum;
cloud_N = brkN "غيم" "فَعلة" "فُعُول" Fem NoHum;
day_N = brkN "يوم" "فَعل" "أَفّاع" Masc NoHum;
dust_N = brkN "غبر" "فُعال" "أَفعِلة" Masc NoHum;
ear_N = brkN "؟ذن" "فُعل" "أَفعال" Fem NoHum;
day_N = brkN "يوم" "فَعل" "أَفَّاع" Masc NoHum;
dust_N = brkN "غبر" "فُعَال" "أَفعِلة" Masc NoHum;
ear_N = brkN "ءذن" "فُعل" "أَفعَال" Fem NoHum;
earth_N = brkN "ترب" "فُعلة" "فُعَل" Fem NoHum;
egg_N = sdfN "بيض" "فَعلة" Fem NoHum;
eye_N = brkN "عين" "فَعل" "فُعُول" Fem NoHum;
fat_N = brkN "دهن" "فُعل" "فُعُول" Masc NoHum ;
feather_N = sdfN "ريش" "فِعلة" Fem NoHum;
fingernail_N = brkN "ظفر" "فُعل" "أَفاعِل" Masc NoHum;
fire_N = brkN "نور" "فاع" "فِيعان" Fem NoHum;
fire_N = brkN "نور" "فاع" "فِيعَان" Fem NoHum;
flower_N = brkN "زهر" "فَعلة" "فُعُول" Fem NoHum;
fog_N = brkN "ضبّ" "فَعال" "فَعال" Masc NoHum; --no plural ?
foot_N = brkN "قدم" "فَعَل" "أَفعال" Fem NoHum;
fog_N = brkN "ضبب" "فَعَال" "فَعَال" Masc NoHum; --no plural ?
foot_N = brkN "قدم" "فَعَل" "أَفعَال" Fem NoHum;
forest_N = sdfN "غيب" "فاعة" Fem NoHum;
grass_N = brkN "عشب" "فُعلة" "أَفعال" Fem NoHum;
guts_N = brkN "حشو" "فَعا" "أَفعاء" Fem NoHum;
grass_N = brkN "عشب" "فُعلة" "أَفعَال" Fem NoHum;
guts_N = brkN "حشو" "فَعَا" "أَفعَاء" Fem NoHum;
hair_N = sdfN "شعر" "فَعلة" Fem NoHum ;
hand_N = brkN "يد" "فَع" "أَفاعِي" Fem NoHum ;
head_N = brkN "ر؟س" "فَعل" "فُعُول" Masc NoHum;
heart_N = brkN "قلب" "فَعل" "فُعُول" Masc NoHum;
hand_N = brkN "يد" "فَع" "أَفَاعِي" Fem NoHum ;
head_N = brkN "رءس" "فَعل" "فُعُول" Masc NoHum;
heart_N = brkN "قلب" "فَعْل" "فُعُول" Masc NoHum;
horn_N = brkN "قرن" "فَعل" "فُعُول" Masc NoHum;
husband_N = brkN "زوج" "فَعل" "أَفعال" Masc NoHum;
husband_N = brkN "زوج" "فَعل" "أَفعَال" Masc NoHum;
ice_N = brkN "ثلج" "فَعل" "فُعُول" Masc NoHum;
knee_N = brkN "ركب" "فُعلة" "فُعَل" Fem NoHum;
leaf_N = brkN "ورق" "فَعَلة" "أَفعال" Fem NoHum;
leaf_N = brkN "ورق" "فَعَلة" "أَفعَال" Fem NoHum;
leg_N = brkN "رجل" "فِعل" "أَفعُل" Fem NoHum;
liver_N = brkN "كبد" "فَعِل" "أَفعال" Masc NoHum ;
liver_N = brkN "كبد" "فَعِل" "أَفعَال" Masc NoHum ;
louse_N = sdfN "قمل" "فَعلة" Fem NoHum;
mouth_N = brkN "فوه" "فُعل" "أَفعال" Masc NoHum ;
name_N = brkN "؟سم" "فِعل" "فَعالِي" Masc NoHum;
neck_N = brkN "رقب" "فَعَلة" "فِعال" Fem NoHum;
night_N = brkN "ليل" "فَعلة" "فَعالِي" Fem NoHum; --plural?
nose_N = brkN "؟نف" "فَعل" "فُعُول" Masc NoHum;
person_N = brkN "شخص" "فَعل" "أَفعال" Masc Hum;
mouth_N = brkN "فوه" "فُعل" "أَفعَال" Masc NoHum ;
name_N = brkN "ءسم" "فِعل" "فَعَالِي" Masc NoHum;
neck_N = brkN "رقب" "فَعَلة" "فِعَال" Fem NoHum;
night_N = brkN "ليل" "فَعلة" "فَعَالِي" Fem NoHum; --plural?
nose_N = brkN "ءنف" "فَعل" "فُعُول" Masc NoHum;
person_N = brkN "شخص" "فَعل" "أَفعَال" Masc Hum;
question_N = mkN "سؤال" ; ----IL
rain_N = brkN "مطر" "فَعَل" "أَفعال" Masc NoHum;
rain_N = brkN "مطر" "فَعَل" "أَفعَال" Masc NoHum;
road_N = brkN "طرق" "فَعِيل" "فُعُل" Fem NoHum;
root_N = brkN "جذر" "فَعل" "فُعُول" Masc NoHum ;
rope_N = brkN "حبل" "فَعل" "فِعال" Masc NoHum;
salt_N = brkN "ملح" "فِعل" "أَفعال" Masc NoHum;
sand_N = brkN "رمل" "فَعل" "فِعال" Masc NoHum;
rope_N = brkN "حبل" "فَعل" "فِعَال" Masc NoHum;
salt_N = brkN "ملح" "فِعل" "أَفعَال" Masc NoHum;
sand_N = brkN "رمل" "فَعل" "فِعَال" Masc NoHum;
seed_N = brkN "بذر" "فَعل" "فُعُول" Masc NoHum;
skin_N = brkN "جلد" "فِعل" "فُعُول" Masc NoHum;
sky_N = sdfN "سمو" "فَعاء" Fem NoHum;
smoke_N = brkN "دخن" "فُعال" "أَفعِلة" Masc NoHum;
sky_N = sdfN "سمو" "فَعَاء" Fem NoHum;
smoke_N = brkN "دخن" "فُعَال" "أَفعِلة" Masc NoHum;
snow_N = brkN "ثلج" "فَعل" "فُعُول" Masc NoHum;
stick_N = brkN "عصو" "فَعا" "فِعِي" Masc NoHum ; --"عصو"
tail_N = brkN "ذنب" "فَعَل" "أَفعال" Masc NoHum;
tongue_N = brkN "لسن" "فِعال" "أَفعِلة" Masc NoHum;
tooth_N = brkN "سنّ" "فِعل" "أَفعال" Masc NoHum ;
stick_N = brkN "عصو" "فَعَا" "فِعِي" Masc NoHum ; --"عصو"
tail_N = brkN "ذنب" "فَعَل" "أَفعَال" Masc NoHum;
tongue_N = brkN "لسن" "فِعَال" "أَفعِلة" Masc NoHum;
tooth_N = brkN "سنن" "فِعّ" "أَفعَال" Masc NoHum ;
wife_N = sdfN "زوج" "فَعلة" Fem Hum;
wind_N = brkN "ريح" "فِعل" "فِعال" Fem NoHum;
wing_N = brkN "جنح" "فَعال" "أَفعِلة" Masc NoHum ;
worm_N = brkN "دود" "فُعلة" "فِيعان" Fem NoHum ;
wind_N = brkN "ريح" "فِعل" "فِعَال" Fem NoHum;
wing_N = brkN "جنح" "فَعَال" "أَفعِلة" Masc NoHum ;
worm_N = brkN "دود" "فُعلة" "فِيعَان" Fem NoHum ;
year_N = mkN "سَنَة" "سَنَوَات" Fem NoHum ;
blow_V = regV "يَنفُخ" ;
@@ -355,7 +355,7 @@ flags
swim_V = regV "يَسبَح" ;
think_V = v2 "فكر" ;
turn_V = regV "يَبرُم" ;
vomit_V = v5 "قي؟" ;
vomit_V = v5 "قيء" ;
bite_V2 = dirV2 ( v1 "عضّ" a a ) ;
count_V2 = dirV2 (v1 "عدّ" a u) ;
@@ -378,7 +378,5 @@ flags
tie_V2 = dirV2 (regV "يَربُط" ) ;
wash_V2 = dirV2 ( regV "يَغسِل" ) ;
wipe_V2 = dirV2 ( regV "يَمسَح" ) ;
-- other_A = sndA "ْتهر" ;
} ;

View File

@@ -3,43 +3,21 @@ resource MissingAra = open GrammarAra, Prelude in {
-- temporary definitions to enable the compilation of RGL API
oper AdAdv : AdA -> Adv -> Adv = notYet "AdAdv" ;
oper AdVVP : AdV -> VP -> VP = notYet "AdVVP" ;
oper AdjOrd : Ord -> AP = notYet "AdjOrd" ;
oper AdnCAdv : CAdv -> AdN = notYet "AdnCAdv" ;
oper AdvCN : CN -> Adv -> CN = notYet "AdvCN" ;
oper AdvIAdv : IAdv -> Adv -> IAdv = notYet "AdvIAdv" ;
oper AdvS : Adv -> S -> S = notYet "AdvS" ;
oper BaseAP : AP -> AP -> ListAP = notYet "BaseAP" ;
oper BaseAdv : Adv -> Adv -> ListAdv = notYet "BaseAdv" ;
oper BaseNP : NP -> NP -> ListNP = notYet "BaseNP" ;
oper BaseRS : RS -> RS -> ListRS = notYet "BaseRS" ;
oper BaseS : S -> S -> ListS = notYet "BaseS" ;
oper CAdvAP : CAdv -> AP -> NP -> AP = notYet "CAdvAP" ;
oper CleftAdv : Adv -> S -> Cl = notYet "CleftAdv" ;
oper CleftNP : NP -> RS -> Cl = notYet "CleftNP" ;
oper ComparAdvAdj : CAdv -> A -> NP -> Adv = notYet "ComparAdvAdj" ;
oper ComparAdvAdjS : CAdv -> A -> S -> Adv = notYet "ComparAdvAdjS" ;
oper ComplVA : VA -> AP -> VP = notYet "ComplVA" ;
oper ComplVQ : VQ -> QS -> VP = notYet "ComplVQ" ;
oper ComplVS : VS -> S -> VP = notYet "ComplVS" ;
oper ConjAP : Conj -> ListAP -> AP = notYet "ConjAP" ;
oper ConjAdv : Conj -> ListAdv -> Adv = notYet "ConjAdv" ;
oper ConjNP : Conj -> ListNP -> NP = notYet "ConjNP" ;
oper ConjRS : Conj -> ListRS -> RS = notYet "ConjRS" ;
oper ConjS : Conj -> ListS -> S = notYet "ConjS" ;
oper ConsAP : AP -> ListAP -> ListAP = notYet "ConsAP" ;
oper ConsAdv : Adv -> ListAdv -> ListAdv = notYet "ConsAdv" ;
oper ConsNP : NP -> ListNP -> ListNP = notYet "ConsNP" ;
oper ConsRS : RS -> ListRS -> ListRS = notYet "ConsRS" ;
oper ConsS : S -> ListS -> ListS = notYet "ConsS" ;
oper DetNP : Det -> NP = notYet "DetNP" ;
oper EmbedQS : QS -> SC = notYet "EmbedQS" ;
oper EmbedS : S -> SC = notYet "EmbedS" ;
oper EmbedVP : VP -> SC = notYet "EmbedVP" ;
oper ExistIP : IP -> QCl = notYet "ExistIP" ;
oper ExistNP : NP -> Cl = notYet "ExistNP" ;
oper FunRP : Prep -> NP -> RP -> RP = notYet "FunRP" ;
oper GenericCl : VP -> Cl = notYet "GenericCl" ;
oper IdRP : RP = notYet "IdRP" ;
oper ImpPl1 : VP -> Utt = notYet "ImpPl1" ;
oper ImpersCl : VP -> Cl = notYet "ImpersCl" ;
oper PConjConj : Conj -> PConj = notYet "PConjConj" ;
@@ -48,25 +26,15 @@ oper PredSCVP : SC -> VP -> Cl = notYet "PredSCVP" ;
oper ProgrVP : VP -> VP = notYet "ProgrVP" ;
oper ReflA2 : A2 -> AP = notYet "ReflA2" ;
oper ReflVP : VPSlash -> VP = notYet "ReflVP" ;
oper RelCN : CN -> RS -> CN = notYet "RelCN" ;
oper RelCl : Cl -> RCl = notYet "RelCl" ;
oper RelNP : NP -> RS -> NP = notYet "RelNP" ;
oper RelSlash : RP -> ClSlash -> RCl = notYet "RelSlash" ;
oper RelVP : RP -> VP -> RCl = notYet "RelVP" ;
oper SentAP : AP -> SC -> AP = notYet "SentAP" ;
oper SentCN : CN -> SC -> CN = notYet "SentCN" ;
oper SlashPrep : Cl -> Prep -> ClSlash = notYet "SlashPrep" ;
oper Slash2V3 : V3 -> NP -> VPSlash = notYet "Slash2V3" ;
oper SlashV2A : V2A -> AP -> VPSlash = notYet "SlashV2A" ;
oper SlashV2Q : V2Q -> QS -> VPSlash = notYet "SlashV2Q" ;
oper SlashV2S : V2S -> S -> VPSlash = notYet "SlashV2S" ;
oper SlashV2V : V2V -> VP -> VPSlash = notYet "SlashV2V" ;
oper SlashV2VNP : V2V -> NP -> VPSlash -> VPSlash = notYet "SlashV2VNP" ;
oper SlashVS : NP -> VS -> SSlash -> ClSlash = notYet "SlashVS" ;
oper SubjS : Subj -> S -> Adv = notYet "SubjS" ;
oper UseA2 : A2 -> AP = notYet "UseA2" ;
oper UseComparA : A -> AP = notYet "UseComparA" ;
oper UseRCl : Temp -> Pol -> RCl -> RS = notYet "UseRCl" ;
oper UseSlash : Temp -> Pol -> ClSlash -> SSlash = notYet "UseSlash" ;
oper VocNP : NP -> Voc = notYet "VocNP" ;
oper pot3plus : Sub1000 -> Sub1000 -> Sub1000000 = notYet "pot3plus" ;

View File

@@ -7,9 +7,10 @@ flags optimize = all ;--noexpand;
mkDet : Str -> Number -> State -> Det
= \word,num,state ->
{ s = \\_,_,c => word + vowel ! c ;
{ s = \\_,_,c => word + caseTbl ! c ;
n = numberToSize num;
d = state; --only Const is used now. check StructuralAra
is1sg = False;
isNum = False;
isPron = False
};
@@ -18,7 +19,7 @@ flags optimize = all ;--noexpand;
= \word,decl ->
{ s = \\c =>
case decl of {
True => word + vowel!c;
True => word + caseTbl!c;
False => word
};
isDecl = decl
@@ -33,18 +34,11 @@ flags optimize = all ;--noexpand;
case g of {
Masc => waHid;
Fem => waHida
} in defArt state waHid + word + dec1sg ! state ! c;
} in defArt state c waHid + word + dec1sg ! state ! c;
n = num;
d = state;
isPron = False;
isNum = True
};
vowel : Case => Str =
table {
Nom => "ُ";
Acc => "َ";
Gen => "ِ"
};
}

View File

@@ -5,145 +5,141 @@ flags optimize=noexpand ;
lin
DetCN det cn = let {
number = sizeToNumber det.n;
cas : Case -> Case = if_then_else Case det.is1sg Bare ;
number = case cn.isDual of {
True =>
case sizeToNumber det.n of {
Sg => Sg ;
_ => Dl } ;
False => sizeToNumber det.n } ;
determiner : Case -> Str = \c ->
det.s ! cn.h ! (detGender cn.g det.n) ! c;
noun : Case -> NTable -> Str = \c,nt -> nt !
number ! (nounState det.d number) ! (nounCase c det.n det.d)
det.s ! cn.h ! (detGender cn.g det.n) ! c ;
noun : Case -> Str = \c ->
cn.s ! number
! nounState det.d number
! nounCase c det.n det.d ;
adj : Case -> Str = \c ->
cn.s2 ! number
! (definite ! det.d) -- Indef remains Indef, rest become Def
! c
} in {
s = \\c =>
case cnB4det det.isPron det.isNum det.n det.d of {
False => determiner c ++ noun c cn.s ++ noun c cn.adj ;
--FIXME use the adj -> cn -> cn rule from below instead of
--repeating code
True => cn.s ! number ! det.d ! c ++ det.s ! cn.h ! cn.g ! c
++ cn.adj ! number ! det.d ! c
False => determiner c
++ noun c
++ adj c
++ cn.np ! c ;
True => noun (cas c) -- deal with possessive suffix
++ determiner c -- (nounCase c det.n det.d) --??
++ adj c
++ cn.np ! c
};
a = { pgn = agrP3 cn.h cn.g number;
isPron = False }
isPron = False } ;
empty = []
};
UsePN pn = {
s = pn.s;
a = {pgn = (Per3 pn.g Sg); isPron = False }
a = {pgn = Per3 pn.g Sg ; isPron = False} ;
empty = []
};
UsePron p = p ;
PredetNP pred np = {
DetNP det = emptyNP ** {s = det.s ! NoHum ! Masc} ; ----
PredetNP pred np = np ** {
s = \\c => case pred.isDecl of {
True => pred.s!c ++ np.s ! Gen ; -- akvaru l-awlAdi
False => pred.s!c ++ np.s ! c
};
a = np.a
} ;
{-
--should compile.. not working :( wierd error message.. bug?
a = np.a ** {isPron=False}
} ;
{-
PPartNP np v2 =
let x = case np.a.pgn of {
Per3 g n => ( positAdj (v2.s ! VPPart) ) ! g ! n ! Indef ;
_ => \\_ => [] -- not occuring anyway
} in {
s = \\c => np.s ! c ++ x ! c ;
a = np.a
Per3 g n => positAdj (v2.s ! VPPart) ) ! g ! n ! Indef ; -- doesn't work because trying to glue runtime tokens
Per2 g n => \\_ => [] ;
_ => \\_ => []
} in np ** {
s = \\c => np.s ! c ++ v2.s ! VPPart ---- TODO: agreement
};
-}
-- FIXME try parsing something like "this house now" and you'll get
-- an internal compiler error, but it still works.. wierd..
AdvNP np adv = {
s = \\c => np.s ! c ++ adv.s;
a = np.a
};
{-
DetSg quant ord = {
s = \\h,g,c =>
quant.s ! Sg ! h ! g ! c ++ ord.s ! g ! quant.d ! c ;
n = One;
d = quant.d;
isPron = quant.isPron;
isNum =
case ord.n of {
None => False;
_ => True
}
} ;
-}
DetQuantOrd quant num ord = {
s = \\h,g,c => quant.s ! Pl ! h ! g ! c
++ num.s ! g ! (toDef quant.d num.n) ! c
AdvNP np adv = np ** {
s = \\c => np.s ! c ++ adv.s
};
DetQuantOrd quant num ord = quant ** {
s = \\h,g,c => let d = toDef quant.d num.n in
quant.s ! Pl ! h ! g ! c
++ num.s ! g ! d ! c
--FIXME check this:
++ ord.s ! g ! (toDef quant.d num.n) ! c ;
++ ord.s ! g
! case d of {Poss => Def ; _ => d}
! c ;
n = num.n;
d = quant.d;
isPron = quant.isPron;
isNum =
case num.n of {
None => False;
_ => True
}
isNum = orB num.isNum ord.isNum ;
-- ord may come from OrdDigits or OrdNumeral
-- num may come from NumCard : Card -> Num
} ;
DetQuant quant num = {
s = \\h,g,c => quant.s ! Pl ! h ! g ! c
DetQuant quant num = quant ** {
s = \\h,g,c => quant.s ! sizeToNumber num.n ! h ! g ! c
++ num.s ! g ! (toDef quant.d num.n) ! c ;
n = num.n;
d = quant.d;
isPron = quant.isPron;
isNum =
isNum = -- Num may come from NumCard : Card -> Num
case num.n of {
None => False;
_ => True
_ => num.isNum
}
} ;
--DEPRECATED
-- SgQuant quant = {s = quant.s ! Sg ; d = quant.d;
-- isPron = quant.isPron; isNum = False} ;
-- PlQuant quant = {s = quant.s ! Pl ; d = quant.d;
-- isPron = quant.isPron; isNum = False} ;
PossPron p = {
s = \\_,_,_,_ => p.s ! Gen;
d = Const;
s = \\_,_,_,_ => BIND ++ p.s ! Gen;
d = Poss;
is1sg = case p.a.pgn of { Per1 Sing => True ; _ => False } ;
isPron = True;
isNum = False } ;
NumSg = {
s = \\_,_,_ => [] ;
n = One } ;
n = One ;
isNum = False } ;
NumPl = {
s = \\_,_,_ => [] ;
n = None } ;
n = None ;
isNum = False } ;
NumDigits digits = {
s = \\_,_,_ => digits.s;
n = digits.n
NumDigits digits = digits ** {
s = \\_,_,_ => digits.s ;
isNum = True
};
NumNumeral numeral = {
NumNumeral numeral = numeral ** {
s = numeral.s ! NCard ;
n = numeral.n
isNum = True
};
NumCard n = n ;
AdNum adn num = {
AdNum adn num = num ** {
s = \\g,d,c => adn.s ++ num.s ! g ! d ! c ;
n = num.n } ;
} ;
OrdDigits digits = {
OrdDigits digits = digits ** {
s = \\_,d,_ => Al ! d ++ digits.s;
n = digits.n
isNum = True
};
-- OrdNumeral : Numeral -> Ord ; -- fifty-first
OrdNumeral numeral = {
OrdNumeral numeral = numeral ** {
s = numeral.s ! NOrd ;
n = numeral.n
isNum = True
};
-- FIXME, "the biggest house" would better translate into
@@ -151,48 +147,58 @@ lin
-- DetCN (DetSg DefArt (OrdSuperl big_A)) (UseN house_N)
OrdSuperl a = {
s = \\_,d,c => a.s ! AComp d c;
n = One
n = One ;
isNum = False
} ;
DefArt = {
s = \\_,_,_,_ => [];
d = Def ;
isNum,isPron = False
isNum,isPron,is1sg = False
} ;
IndefArt = {
s = \\_,_,_,_ => [];
d = Indef ;
isNum,isPron = False
isNum,isPron,is1sg = False
} ;
MassNP cn = ---- AR
{s = cn.s ! Sg ! Indef ; a = {pgn = Per3 cn.g Sg ; isPron = False}} ;
MassNP cn =
{s = \\c => cn2str cn Sg Indef c ;
a = {pgn = Per3 cn.g Sg ; isPron = False} ;
empty = []} ;
-- MassDet = {s = \\_,_,_,_ => [] ; d = Indef;
-- isNum = False; isPron = False} ;
UseN,
UseN2 = \n -> n ** {adj = \\_,_,_ => []};
UseN2 = useN ;
Use2N3 n3 = n3 ;
Use3N3 n3 = n3 ** {c2 = n3.c3} ;
ComplN2 n2 np = UseN n2 ** --- IL
{s = \\n,s,c => n2.s ! n ! s ! c ++ n2.c2 ++ np.s ! Gen} ;
ComplN2 n2 np = UseN n2 ** {np = \\c => n2.c2.s ++ np.s ! n2.c2.c} ;
ComplN3 n3 np = ComplN2 n3 np ** {c2 = n3.c3} ;
AdjCN ap cn = {
s = \\n,d,c => cn.s ! n ! d ! c;
adj = \\n,d,c => ap.s ! cn.h ! cn.g ! n ! (definite ! d) ! c ;
g = cn.g;
h = cn.h
AdjCN ap cn = cn ** {
s2 = \\n,d,c => cn.s2 ! n ! d ! c ++ ap.s ! cn.h ! cn.g ! n ! (definite ! d) ! c
};
-- RelCN cn rs = {s = \\n,c => cn.s ! n ! c ++ rs.s ! {n = n ; p = P3}} ;
-- AdvCN cn ad = {s = \\n,c => cn.s ! n ! c ++ ad.s} ;
--
-- SentCN cn sc = {s = \\n,c => cn.s ! n ! c ++ sc.s} ;
ApposCN cn np = cn ** {
s = \\n,d,c => cn.s ! n ! d ! c ++ np.s ! c } ;
RelCN cn rs = cn ** {
s2 = \\n,s,c => cn.s2 ! n ! s ! c ++ rs.s ! {pgn=Per3 cn.g n ; isPron=False} ! c};
RelNP np rs = np ** {s = \\c => np.s ! c ++ rs.s ! np.a ! c} ;
AdvCN,
SentCN = \cn,ss -> cn ** {s2 = \\n,d,c => cn.s2 ! n ! d ! c ++ ss.s} ;
ApposCN cn np = cn ** { np = \\c => cn.np ! c ++ np.s ! c } ;
-- : CN -> NP -> CN ; -- house of Paris, house of mine
PossNP cn np = cn ** {
s = \\n,_d,c => cn.s ! n ! Const ! c ;
s2 = \\n,_d,c => cn.s2 ! n ! Const ! Gen ; -- unsure about this /IL
np = \\c => cn.np ! c ++ np.s ! Gen
};
-- : CN -> NP -> CN ; -- glass of wine
--PartNP
}

View File

@@ -2,14 +2,50 @@ resource OrthoAra = open Prelude, Predef in {
flags coding=utf8 ;
oper
oper
rectifyHmz: Str -> Str = \word ->
vow : pattern Str = #("َ" | "ِ" | "ُ" | "ً" | "ٍ" | "ٌ") ;
weak : pattern Str = #("و"|"ي") ;
-- "Sun letters": assimilate with def. article
sun : pattern Str = #("ت"|"ث"|"د"|"ذ"|"ر"|"ز"|"س"|"ش"|"ص"|"ض"|"ط"|"ظ"|"ل"|"ن") ;
-- Shadda: https://www.unicode.org/L2/L2017/17253-arabic-ordering.pdf
fixShd : Str -> Str -> Str = \word,suffix ->
case <word,suffix> of {
-- <x + "ّ", v@#vow + y> => x + v + "ّ" + y ;
<x + v@#vow, "ّ" + y> => x + "ّ" + v + y ;
_ => word + suffix
} ;
-- IL: using this to reuse patterns for weak verbs, might be strange/wrong
rmSukun : Str -> Str = \s -> case s of {
x + "ْ" + y => x + y ;
_ => s
} ;
-- Hamza
hamza : pattern Str = #("ء"|"؟") ;
rectifyHmz : Str -> Str = \word ->
case word of {
l@(""|"ال") + "؟" + v@("َ"|"ُ") + tail => l + "أ" + v + tail;
l@(""|"ال") + "؟" + v@("ِ") + tail => l + "إ" + v + tail;
head + v1@("ِ"|"ُ"|"َ"|"ْ"|"ا"|"ي"|"و") + "؟" + v2@(""|"ُ"|"َ"|"ْ"|"ِ") => head + v1 + (tHmz v1) + v2;
head + "؟" + tail => head + (bHmz (dp 2 head) (take 2 tail)) + tail; --last head , take 1 tail
l@(""|"ال") + ("أ"|"أَ") + #hamza + "ْ" + tail => l + "آ" + tail;
l@(""|"ال") + ("أ"|"أَ") + #hamza + tail => l + "آ" + tail;
l@(""|"ال") + #hamza + v@("َ"|"ُ") + tail => l + "أ" + v + tail;
l@(""|"ال") + #hamza + v@("ِ") + tail => l + "إ" + v + tail;
head + v1@(#vow|"ْ"|"ا"|"ي"|"و")
+ #hamza + v2@(#vow|"ْ") + tail =>
case v2 of { "ْ" => head + v1 + bHmz v1 v2 + tail ; -- unsure about this /IL
_ => head + v1 + bHmz v1 v2 + v2 + tail } ;
head + v1@(#vow|"ْ"|"ا"|"ي"|"و") -- the same but it ends in vowel
+ #hamza + v2@(#vow|"ْ") =>
case v2 of { "ْ" => head + v1 + tHmz v1 ;
_ => head + v1 + tHmz v1 + v2 } ;
head + v1@(#vow|"ْ"|"ا"|"ي"|"و") -- the same but it ends without vowel
+ #hamza => head + v1 + tHmz v1 ;
head + #hamza + tail => head + (bHmz (dp 2 head) (take 2 tail)) + tail; --last head , take 1 tail
_ => word
};

View File

@@ -35,31 +35,54 @@ resource ParadigmsAra = open
oper
-- Prepositions are used in many-argument functions for rection.
Case : Type ;
nom : Case ;
acc : Case ;
gen : Case ;
-- Prepositions are used in many-argument functions for rection.
Preposition : Type ;
noPrep : Preposition ;
casePrep : Case -> Preposition ;
--- TODO: continue, add all over the grammar
Gender : Type ;
masc : Gender ;
fem : Gender ;
Number : Type ;
sg : Number ;
pl : Number ;
Species : Type ;
hum : Species ;
nohum : Species ;
Vowel : Type ;
va : Vowel ;
vi : Vowel ;
vu : Vowel ;
--2 Nouns
-- Overloaded operator for main cases
mkN = overload {
mkN : (sg : Str) -> N -- non-human regular nouns
= smartN ;
mkN : Species -> N -> N
= \p,n -> n ** {h = p} ;
mkN : (sg,pl : Str) -> Gender -> Species -> N
= \sg,pl -> mkFullN (reg sg pl) ;
mkN : NTable -> Gender -> Species -> N -- loan words, irregular
= mkFullN ;
mkN : (root,sgPatt,brokenPlPatt : Str) -> Gender -> Species -> N -- broken plural
= brkN ;
mkN : N -> (attr : Str) -> N -- Compound nouns
= \n,attr -> n ** { s = \\num,s,c => n.s ! num ! s ! c ++ attr } ; --- IL (TODO: all kinds of compounds)
mkN : overload {
mkN : (sg : Str) -> N ; -- non-human regular nouns
mkN : Species -> N -> N ;
mkN : (sg,pl : Str) -> Gender -> Species -> N ;
mkN : NTable -> Gender -> Species -> N ; -- loan words, irregular
mkN : (root,sgPatt,brokenPlPatt : Str) -> Gender -> Species -> N ; -- broken plural
mkN : N -> (attr : Str) -> N ; -- Compound noun with invariant attribute
mkN : N -> N -> N ; -- Compound noun where attribute inflects in state and case. Attribute in singular.
mkN : Number -> N -> N -> N ; -- Compound noun where attribute inflects in state and case. Attribute's number specified by 1st arg.
--- mkN : (root,sgPatt : Str) -> Gender -> Species -> N -- sound feminine plural
--- = sdfN ;
} ;
dualN : N -> N ; -- Force the plural of the N into dual (e.g. "twins")
--This is used for loan words or anything that has untreated irregularities
--in the interdigitization process of its words
mkFullN : NTable -> Gender -> Species -> N ;
@@ -82,6 +105,8 @@ resource ParadigmsAra = open
mkPN = overload {
mkPN : Str -> PN -- Fem Hum if ends with ة, otherwise Masc Hum
= smartPN ;
mkPN : N -> PN
= \n -> lin PN (n ** {s = \\c => n.s ! Sg ! Const ! c ++ n.s2 ! Sg ! Const ! c }) ; -- no idea /IL
mkPN : Str -> Gender -> Species -> PN
= mkFullPN ;
} ;
@@ -92,13 +117,17 @@ resource ParadigmsAra = open
--3 Relational nouns
mkN2 = overload {
mkN2 : N -> Preposition -> N2 = prepN2 ;
mkN2 : N -> N2 = \n -> lin N2 (n ** {c2 = []}) ;
mkN2 : Str -> N2 = \str -> lin N2 (smartN str ** {c2 = []})
mkN2 : overload {
mkN2 : N -> Preposition -> N2 ; -- ready-made preposition
mkN2 : N -> Str -> N2 ; -- preposition given as a string
mkN2 : N -> N2 ; -- no preposition
mkN2 : Str -> N2 ; -- no preposition, predictable inflection
} ;
mkN3 : N -> Preposition -> Preposition -> N3 ;
mkN3 : overload {
mkN3 : N -> Preposition -> Preposition -> N3 ; -- ready-made prepositions
mkN3 : N -> Str -> Str -> N3 ; -- prepositions given as strings
} ;
--2 Adjectives
@@ -106,26 +135,32 @@ resource ParadigmsAra = open
-- Overloaded operator for main cases
mkA = overload {
mkA : (root,patt : Str) -> A
= sndA ;
mkA : (root : Str) -> A -- forms adjectives with positive form aFCal
= clrA ;
mkA : (posit,compar,plur : Str) -> A
= degrA ;
mkA : (root,sg : Str) -> A -- adjective with sound plural; takes root string and sg. pattern string
= \r,p -> lin A (sndA r p);
mkA : (root : Str) -> A -- adjective with positive form aFCal
= \r -> lin A (clrA r);
mkA : (root,sg,pl : Str) -> A -- adjective with broken plural
= \r,s,p -> lin A (brkA r s p) ;
} ;
degrA : (posit,compar,plur : Str) -> A ;
--Takes a root string and a pattern string
sndA : (root,patt : Str) -> A ;
sndA : (root,patt : Str) -> Adj ;
--Takes a root string only
clrA : (root : Str) -> A ; -- forms adjectives of type aFCal
clrA : (root : Str) -> Adj ; -- forms adjectives of type aFCal
nisbaA : Str -> Adj ; -- forms relative adjectives by adding the suffix ِيّ
--3 Two-place adjectives
--
-- Two-place adjectives need a preposition for their second argument.
mkA2 : overload {
mkA2 : A -> Preposition -> A2 ;
mkA2 : A -> Str -> A2
} ;
--2 Adverbs
@@ -139,75 +174,65 @@ resource ParadigmsAra = open
mkAdA : Str -> AdA ;
mkInterj : Str -> Interj ;
mkSubj : overload {
mkSubj : Str -> Subj ; -- Default order Subord (=noun first and in accusative)
mkSubj : Str -> Order -> Subj -- Specify word order
} ;
--2 Prepositions
--
-- A preposition as used for rection in the lexicon, as well as to
-- build $PP$s in the resource API, just requires a string.
mkPrep : Str -> Prep
= \s -> lin Prep {s = mkPreposition s} ; -- preposition in the sense of RGL abstract syntax
mkPreposition : Str -> Preposition ; -- just a string, for internal use
-- build $PP$s in the resource API. Requires a string and a case.
mkPrep : overload {
mkPrep : Str -> Prep ;
mkPrep : Str -> Case -> Prep
} ; -- preposition in the sense of RGL abstract syntax
--2 Verbs
-- Overloaded operations
mkV = overload {
mkV : (imperfect : Str) -> V
= regV ;
mkV : (root : Str) -> (perf,impf : Vowel) -> V -- verb form I ; vowel = a|i|u
= v1 ;
mkV : (root : Str) -> VerbForm -> V -- FormI .. FormX (no VII, IX) ; default vowels a u for I
= formV ;
mkV : overload {
mkV : (imperfect : Str) -> V ; -- The verb in Per3 Sg Masc imperfect tense gives the most information
mkV : (root : Str) -> (perf,impf : Vowel) -> V ; -- verb form I ; vowel = a|i|u
mkV : (root : Str) -> VerbForm -> V ; -- FormI .. FormX (no VII, IX) ; default vowels a u for I
mkV : V -> (particle : Str) -> V -- V with a non-inflecting particle/phrasal verb
} ;
-- The verb in the imperfect tense gives the most information
-- regV : Str -> V ;
regV : Str -> V ;
reflV : V -> V ; -- نَفْس in the proper case and with possessive suffix, e.g. نَفْسَكِ
--Verb Form I : fa`ala, fa`ila, fa`ula
v1 : Str -> Vowel -> Vowel -> V ; -- Verb Form I : fa`ala, fa`ila, fa`ula
v1 : Str -> Vowel -> Vowel -> V ;
v2 : Str -> V ; -- Verb Form II : fa``ala
--Verb Form II : fa``ala
v3 : Str -> V ; -- Verb Form III : faa`ala
v2 : Str -> V ;
v4 : Str -> V ; -- Verb Form IV : 'af`ala
--Verb Form III : faa`ala
v5 : Str -> V ; -- Verb Form V : tafa``ala
v3 : Str -> V ;
v6 : Str -> V ; -- Verb Form VI : tafaa`ala
--Verb Form IV : 'af`ala
v7 : Str -> V ; -- Verb Form VII : infa`ala
v4 : Str -> V ;
v8 : Str -> V ; -- Verb Form VIII ifta`ala
--Verb Form V : tafa``ala
v5 : Str -> V ;
--Verb Form VI : tafaa`ala
v6 : Str -> V ;
--Verb Form VIII 'ifta`ala
v8 : Str -> V ;
-- Verb Form X 'istaf`ala
v10 : Str -> V ;
v10 : Str -> V ; -- Verb Form X 'istaf`ala
--3 Two-place verbs
-- Two-place verbs need a preposition, except the special case with direct object.
-- (transitive verbs). Notice that a particle comes from the $V$.
mkV2 = overload {
mkV2 : V -> V2 = dirV2 ;
mkV2 : V -> Preposition -> V2 = prepV2 ;
mkV2 : Str -> V2 = strV2;
mkV2 : overload {
mkV2 : V -> V2 ; -- No preposition
mkV2 : V -> Str -> V2 ; -- Preposition as string, default case genitive
mkV2 : V -> Preposition -> V2 ; -- Ready-made preposition
mkV2 : Str -> V2 ; -- Predictable verb conjugation, no preposition
} ;
dirV2 : V -> V2 ;
@@ -217,8 +242,14 @@ resource ParadigmsAra = open
-- Three-place (ditransitive) verbs need two prepositions, of which
-- the first one or both can be absent.
mkV3 : overload {
mkV3 : V -> Preposition -> Preposition -> V3 ; -- speak, with, about
mkV3 : V -> (to : Str) -> (about:Str) -> V3 -- like above, but with strings as arguments (default complement case genitive)
} ;
dirV3 : overload {
dirV3 : V -> Preposition -> V3 ; -- give,_,to
dirV3 : V -> (to : Str) -> V3 -- like above, but with string as argument (default complement case genitive)
} ;
dirdirV3 : V -> V3 ; -- give,_,_
--3 Other complement patterns
@@ -231,9 +262,15 @@ resource ParadigmsAra = open
mkV2S : V -> Str -> V2S ;
mkVV = overload {
mkVV : V -> VV = regVV ;
mkVV : V -> Str -> VV = c2VV
mkVV : V -> Str -> VV = c2VV ;
mkVV : V -> Preposition -> VV = prepVV ;
mkVV : V -> Preposition -> Preposition -> VV = prep2VV
} ;
mkV2V : overload {
mkV2V : V -> Str -> Str -> V2V ;
mkV2V : V -> Preposition -> Preposition -> V2V ;
mkV2V : VV -> Preposition -> V2V
} ;
mkVA : V -> VA ;
mkV2A : V -> Str -> V2A ;
mkVQ : V -> VQ ;
@@ -258,6 +295,94 @@ resource ParadigmsAra = open
-- The definitions should not bother the user of the API. So they are
-- hidden from the document.
Case = ResAra.Case ;
nom = ResAra.Nom ;
acc = ResAra.Acc ;
gen = ResAra.Gen ;
-- Prepositions are used in many-argument functions for rection.
Preposition = ResAra.Preposition ;
noPrep = {s=[]; c=nom} ;
casePrep c = {s=[]; c=c} ;
Gender = ResAra.Gender ;
masc = ResAra.Masc ;
fem = ResAra.Fem ;
Number = ResAra.Number ;
sg = ResAra.Sg ;
pl = ResAra.Pl ;
Species = ResAra.Species ;
hum = ResAra.Hum ;
nohum = ResAra.NoHum ;
Vowel = ResAra.Vowel ;
va = ResAra.a ;
vu = ResAra.u ;
vi = ResAra.i ;
mkPrep = overload {
mkPrep : Str -> Prep = \s ->
lin Prep (mkPreposition s) ;
mkPrep : Str -> Case -> Prep = \s,c ->
lin Prep (mkPreposition s c)
} ;
mkV2 = overload {
mkV2 : V -> V2 = dirV2 ;
mkV2 : V -> Str -> V2 = \v,p -> prepV2 v (mkPreposition p);
mkV2 : V -> Preposition -> V2 = prepV2 ;
mkV2 : Str -> V2 = strV2;
} ;
prepV2 : V -> Preposition -> V2 = \v,p -> v ** {s = v.s ; c2 = p ; lock_V2 = <>} ;
strV2 : Str -> V2 = \str -> dirV2 (mkV str) ;
mkN = overload {
mkN : (sg : Str) -> N -- non-human regular nouns
= smartN ;
mkN : Species -> N -> N
= \p,n -> n ** {h = p} ;
mkN : (sg,pl : Str) -> Gender -> Species -> N
= \sg,pl -> mkFullN (reg sg pl) ;
mkN : NTable -> Gender -> Species -> N -- loan words, irregular
= mkFullN ;
mkN : (root,sgPatt,brokenPlPatt : Str) -> Gender -> Species -> N -- broken plural
= brkN ;
mkN : N -> (attr : Str) -> N -- Compound nouns with noninflecting attribute
= \n,attr -> n ** {s2 = \\n,s,c => attr} ;
mkN : N -> N -> N -- Compound nouns where attribute inflects in state and case but not number
= attrN Sg ;
mkN : Number -> N -> N -> N -- Compound nouns where attribute inflects in state, case and number
= attrN ;
} ;
attrN : Number -> N -> N -> N = \num,n1,n2 -> n1 ** {
s = \\n,_,c => n1.s ! n ! Const ! c ;
s2 = \\n,s,c => let c' = case c of {Dat => Gen; _ => c} in -- the Dat with liPrep hack only applies to the first word
n1.s2 ! num ! s ! c' -- attribute doesn't change
++ n2.s ! num ! s ! c'
++ n2.s2 ! num ! s ! c'} ;
dualN : N -> N = \n -> n ** {isDual=True} ;
proDrop : NP -> NP ; -- Force a NP to lose its string, only contributing with its agreement.
mkPron : (_,_,_ : Str) -> PerGenNum -> Pron ;
mkV = overload {
mkV : (imperfect : Str) -> V
= regV ;
mkV : (root : Str) -> (perf,impf : Vowel) -> V -- verb form I ; vowel = a|i|u
= v1 ;
mkV : (root : Str) -> VerbForm -> V -- FormI .. FormX (no VII, IX) ; default vowels a u for I
= formV ;
mkV : V -> (particle : Str) -> V = \v,p ->
v ** { s = \\vf => v.s ! vf ++ p } ;
} ;
regV : Str -> V = \wo ->
let rau : Str * Vowel * Vowel =
@@ -272,28 +397,19 @@ resource ParadigmsAra = open
v1 = \rootStr,vPerf,vImpf ->
let { raw = v1' rootStr vPerf vImpf } in
{ s = \\vf =>
case rootStr of {
_ + "؟" + _ => rectifyHmz(raw.s ! vf);
_ => raw.s ! vf
};
lock_V = <>
} ;
va : Vowel = ResAra.a ;
lin V { s = \\vf =>rectifyHmz (raw.s ! vf) } ;
v1' : Str -> Vowel -> Vowel -> Verb =
\rootStr,vPerf,vImpf ->
let { root = mkRoot3 rootStr ;
l = dp 2 rootStr } in --last rootStr
case <l, root.c> of {
<"ّ",_> => v1geminate rootStr vPerf vImpf ;
<"و"|"ي",_> => case vPerf of {
let root = mkRoot3 rootStr
in case rootStr of {
_ + "ّ" => v1geminate rootStr vPerf vImpf ;
? + #hamza + #weak => v1doubleweak root ;
? + ? + #weak => case vPerf of {
i => v1defective_i root vImpf ;
_ => v1defective_a root vImpf } ;
<_,"و"|"ي"> => v1hollow root vImpf ;
_ => v1sound root vPerf vImpf
};
? + #weak + ? => v1hollow root vImpf ;
_ => v1sound root vPerf vImpf } ;
v2 =
\rootStr ->
@@ -302,7 +418,7 @@ resource ParadigmsAra = open
} in {
s =
case root.l of {
"و"|"ي" => (v2defective root).s;
#weak => (v2defective root).s;
_ => (v2sound root).s
};
lock_V = <>
@@ -319,16 +435,13 @@ resource ParadigmsAra = open
v4 =
\rootStr ->
let {
root = mkRoot3 rootStr
} in {
s =
case root.l of {
"و"|"ي" => (v4defective root).s;
_ => (v4sound root).s
};
lock_V = <>
};
let root : Root3 = mkRoot3 rootStr ;
verb : Verb = case rootStr of {
? + #hamza + #weak => v4doubleweak root ;
? + #weak + ? => v4hollow root ;
_ + #weak => v4defective root ;
_ => v4sound root } ;
in lin V verb ;
v5 =
@@ -336,7 +449,7 @@ resource ParadigmsAra = open
let { raw = v5' rootStr } in
{ s = \\vf =>
case rootStr of {
_ + "؟" + _ => rectifyHmz(raw.s ! vf);
_ + #hamza + _ => rectifyHmz(raw.s ! vf);
_ => raw.s ! vf
};
lock_V = <>
@@ -359,31 +472,43 @@ resource ParadigmsAra = open
lock_V = <>
};
v7 =
\rootStr ->
let {
fcl = mkRoot3 rootStr ;
v7fun = v7geminate ; -- TODO add rest
} in lin V (v7fun fcl) ;
v8 =
\rootStr ->
let {
rbT = mkRoot3 rootStr ;
v8fun = case rbT.f of {
("و"|"ي"|"ّ") => v8assimilated ;
_ => v8sound }
_ =>
case rbT.c of {
#weak => v8hollow ;
_ => v8sound }}
} in lin V (v8fun rbT) ;
v10 =
\rootStr ->
let {
rbT = mkRoot3 rootStr ;
v10fun = case rbT.c of {
("و"|"ي") => v10hollow ;
v10fun : Root3 -> Verb = case rootStr of {
? + #weak + ? => v10hollow ;
? + ? + #weak => v10defective ;
_ => v10sound }
} in lin V (v10fun rbT) ;
Preposition = Str ;
reflV v = lin V (ResAra.reflV v) ;
mkFullN nsc gen spec =
mkFullN nsc gen spec = lin N
{ s = nsc; --NTable
s2 = emptyNTable;
g = gen;
h = spec;
lock_N = <>
isDual = False
};
brkN' : Str -> Str -> Str -> Gender -> Species -> N =
@@ -393,20 +518,24 @@ resource ParadigmsAra = open
} in mkFullN (reg kitAb kutub) gen spec;
brkN root sg pl gen spec =
let { raw = brkN' root sg pl gen spec} in
let { raw = brkN' root sg pl gen spec} in raw **
{ s = \\n,d,c =>
case root of {
_ + "؟" + _ => rectifyHmz(raw.s ! n ! d ! c);
_ + #hamza + _ => rectifyHmz(raw.s ! n ! d ! c);
_ => raw.s ! n ! d ! c
};
g = gen;
h = spec ; lock_N = <>
}
};
sdfN =
\root,sg,gen,spec ->
let { kalima = mkWord sg root;
} in mkFullN (sndf kalima) gen spec;
let { kalimaStr = mkWord sg root;
kalimaRaw = sndf kalimaStr;
kalima : NTable = \\n,d,c => case root of {
_ + #hamza + _
=> rectifyHmz (kalimaRaw ! n ! d ! c);
_ => kalimaRaw ! n ! d ! c
};
} in mkFullN kalima gen spec;
sdmN =
\root,sg,gen,spec ->
@@ -420,38 +549,39 @@ resource ParadigmsAra = open
lock_PN = <>
};
mkN2 = overload {
mkN2 : N -> Preposition -> N2 = prepN2 ;
mkN2 : N -> Str -> N2 = \n,s -> prepN2 n (mkPreposition s);
mkN2 : N -> N2 = \n -> lin N2 (n ** {c2 = noPrep}) ;
mkN2 : Str -> N2 = \str -> lin N2 (smartN str ** {c2 = noPrep})
} ;
prepN2 : N -> Str -> N2 = \n,p -> lin N2 (n ** {c2 = p}) ;
prepN2 : N -> Preposition -> N2 = \n,p -> lin N2 (n ** {c2 = p}) ;
mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p ; c3 = q} ;
mkN3 = overload {
mkN3 : N -> Preposition -> Preposition -> N3 = \n,p,q ->
lin N3 (n ** {c2 = p ; c3 = q}) ;
mkN3 : N -> Str -> Str -> N3 = \n,p,q ->
lin N3 (n ** {c2 = mkPreposition p ; c3 = mkPreposition q}) ;
} ;
mkPron : (_,_,_ : Str) -> PerGenNum -> NP = \ana,nI,I,pgn ->
{ s =
table {
Nom => ana;
Acc => nI;
Gen => I
};
a = {pgn = pgn; isPron = True };
lock_NP = <>
};
mkPron : (_,_,_ : Str) -> PerGenNum -> Pron = \ana,nI,I,pgn ->
lin Pron (ResAra.mkPron ana nI I pgn) ;
proDrop : NP -> NP = \np -> lin NP (ResAra.proDrop np) ;
-- e.g. al-jamii3, 2a7ad
regNP : Str -> Number -> NP = \word,n ->
{ s = \\c => word ++ vowel ! c ; ---- gives strange chars
a = {pgn = Per3 Masc n; isPron = False };
lock_NP = <>
};
regNP : Str -> Number -> NP = \word,n -> lin NP (emptyNP ** {
s = \\c => fixShd word (dec1sg ! Def ! c)
});
-- e.g. hadha, dhaalika
indeclNP : Str -> Number -> NP = \word,n ->
{ s = \\c => word ;
a = {pgn = Per3 Masc n; isPron = False };
lock_NP = <>
};
indeclNP : Str -> Number -> NP = \word,n -> lin NP (emptyNP ** {
s = \\c => word
});
mkQuant7 : (_,_,_,_,_,_,_ : Str) -> State -> Quant =
\hava,havihi,havAn,havayn,hAtAn,hAtayn,hA'ulA,det ->
\hava,havihi,havAn,havayn,hAtAn,hAtayn,hA'ulA,det -> lin Quant (baseQuant **
{ s = \\n,s,g,c =>
case <s,g,c,n> of {
<_,Masc,_,Sg> => hava;
@@ -463,14 +593,11 @@ resource ParadigmsAra = open
<Hum,_,_,Pl> => hA'ulA;
_ => havihi
};
d = Def;
isPron = False;
isNum = False;
lock_Quant = <>
};
d = det
});
mkQuant3 : (_,_,_ : Str) -> State -> Quant =
\dalika,tilka,ula'ika,det ->
\dalika,tilka,ula'ika,det -> lin Quant (baseQuant **
{ s = \\n,s,g,c =>
case <s,g,c,n> of {
<_,Masc,_,Sg> => dalika;
@@ -478,11 +605,21 @@ resource ParadigmsAra = open
<Hum,_,_,_> => ula'ika;
_ => tilka
};
d = Def;
isPron = False;
isNum = False;
lock_Quant = <>
};
d = det
});
brkA : (root,sg,pl : Str) -> Adj = \root,sg,pl ->
let jadId = mkWord sg root ;
jadIda = jadId + "َة" ;
judud = mkWord pl root ;
akbar = mkWord "أَفعَل" root ;
mascTbl = reg jadId judud ;
femTbl = reg jadIda judud ;
in { s = table {
APosit Masc n d c => rectifyHmz (mascTbl ! n ! d ! c) ;
APosit Fem n d c => rectifyHmz (femTbl ! n ! d ! c) ;
AComp d c => rectifyHmz (indeclN akbar ! d ! c) }
} ;
degrA : (posit,compar,plur : Str) -> A
= \posit,compar,plur -> lin A {s = clr posit compar plur} ;
@@ -491,72 +628,105 @@ resource ParadigmsAra = open
let raw = sndA' root pat in {
s = \\af =>
case root of {
_ + "؟" + _ => rectifyHmz(raw.s ! af);
_ + #hamza + _ => rectifyHmz(raw.s ! af);
_ => raw.s ! af
};
lock_A = <>
}
};
sndA' : Str -> Str -> A =
sndA' : Str -> Str -> Adj =
\root,pat ->
let { kabIr = mkWord pat root;
akbar = mkWord "أَفعَل" root
} in {
s = table {
APosit g n d c => (positAdj kabIr) ! g ! n ! d ! c ;
AComp d c => (indeclN akbar) ! d ! c
};
lock_A = <>
APosit g n d c => positAdj kabIr ! g ! n ! d ! c ;
AComp d c => indeclN akbar ! d ! c
}
};
nisbaA : Str -> Adj = \Haal ->
let Haaliyy = Haal + "ِيّ" in {
s = table {
APosit g n d c => positAdj Haaliyy ! g ! n ! d ! c ;
AComp d c => "أَكْثَر" ++ indeclN Haaliyy ! d ! c
}
} ;
clrA root =
let { eaHmar = mkWord "أَفعَل" root;
HamrA' = mkWord "فَعلاء" root;
Humr = mkWord "فُعل" root
} in {
s = clr eaHmar HamrA' Humr;
lock_A = <>
};
mkA2 a p = a ** {c2 = p ; lock_A2 = <>} ;
mkA2 = overload {
mkA2 : A -> Preposition -> A2 = prepA2 ;
mkA2 : A -> Str -> A2 = \a,p -> prepA2 a (mkPreposition p)
} ;
mkAdv x = ss x ** {lock_Adv = <>} ;
mkAdV x = ss x ** {lock_AdV = <>} ;
mkAdA x = ss x ** {lock_AdA = <>} ;
prepA2 : A -> Preposition -> A2 = \a,p -> lin A2 (a ** {c2 = p}) ;
mkPreposition p = p ;
mkAdv x = lin Adv (ss x) ;
mkAdV x = lin AdV (ss x) ;
mkAdA x = lin AdA (ss x) ;
mkInterj x = lin Interj (ss x) ;
prepV2 : V -> Preposition -> V2 = \v,p -> v ** {s = v.s ; c2 = p ; lock_V2 = <>} ;
strV2 : Str -> V2 = \str -> dirV2 (mkV str) ;
mkSubj = overload {
mkSubj : Str -> Subj = \s -> lin Subj {s = s ; o = Subord} ;
mkSubj : Str -> Order -> Subj = \s,o -> lin Subj {s = s ; o = o} ;
} ;
dirV2 v = prepV2 v [] ;
dirV2 v = prepV2 v (casePrep acc) ;
mkV3 v p q = v ** {s = v.s ; c2 = p ; c3 = q ; lock_V3 = <>} ;
dirV3 v p = mkV3 v [] p ;
dirdirV3 v = dirV3 v [] ;
mkV3 = overload {
mkV3 : V -> Preposition -> Preposition -> V3 = \v,p,q ->
lin V3 (prepV3 v p q) ;
mkV3 : V -> Str -> Str -> V3 = \v,p,q ->
lin V3 (v ** {s = v.s ; c2 = mkPreposition p ; c3 = mkPreposition q})
} ;
prepV3 : V -> Preposition -> Preposition -> Verb3 = \v,p,q ->
v ** {s = v.s ; c2 = p ; c3 = q} ;
dirV3 = overload {
dirV3 : V -> Preposition -> V3 = \v,p -> mkV3 v (casePrep acc) p ;
dirV3 : V -> Str -> V3 = \v,s -> mkV3 v (casePrep acc) (mkPreposition s)
} ;
dirdirV3 v = dirV3 v (casePrep acc) ;
mkVS v = v ** {lock_VS = <>} ;
mkVQ v = v ** {lock_VQ = <>} ;
regVV : V -> VV = \v -> lin VV v ** {c2 = "أَنْ"} ;
c2VV : V -> Str -> VV = \v,prep -> regVV v ** {c2 = prep} ;
regVV : V -> VV = \v -> lin VV v ** {c2 = mkPreposition "أَنْ" ; sc = noPrep} ;
c2VV : V -> Str -> VV = \v,prep -> regVV v ** {c2 = mkPreposition prep ; sc = noPrep} ;
prepVV : V -> Preposition -> VV = \v,prep -> regVV v ** {c2=prep; sc=noPrep} ;
prep2VV : V -> (_,_ : Preposition) -> VV = \v,p1,p2 -> regVV v ** {c2=p1; sc=p2} ;
V0 : Type = V ;
---- V2S, V2V, V2Q, V2A : Type = V2 ;
AS, A2S, AV : Type = A ;
A2V : Type = A2 ;
mkV0 v = v ** {lock_V = <>} ;
mkV2S v p = mkV2 v p ** {lock_V2S = <>} ;
mkV2V v p t = mkV2 v p ** {s4 = t ; lock_V2V = <>} ;
mkV0 v = v ;
mkV2S v p = lin V2S (prepV2 v (mkPreposition p)) ;
mkV2V = overload {
mkV2V : V -> Str -> Str -> V2V = \v,p,q ->
lin V2V (prepV3 v (mkPreposition p) (mkPreposition q) ** {sc = noPrep}) ;
mkV2V : V -> Preposition -> Preposition -> V2V = \v,p,q ->
lin V2V (prepV3 v p q ** {sc = noPrep}) ;
mkV2V : VV -> Preposition -> V2V = \vv,p ->
lin V2V (vv ** {c2 = p ; c3 = vv.c2}) ;
} ;
mkVA v = v ** {lock_VA = <>} ;
mkV2A v p = mkV2 v p ** {lock_V2A = <>} ;
mkV2Q v p = mkV2 v p ** {lock_V2Q = <>} ;
mkV2A v p = lin V2A (prepV2 v (mkPreposition p));
mkV2Q v p = lin V2Q (prepV2 v (mkPreposition p));
mkAS,
mkAV = \a -> a ;
mkA2S,
mkA2V = \a,p -> prepA2 a (mkPreposition p) ;
mkAS v = v ** {lock_A = <>} ;
mkA2S v p = mkA2 v p ** {lock_A = <>} ;
mkAV v = v ** {lock_A = <>} ;
mkA2V v p = mkA2 v p ** {lock_A2 = <>} ;
smartN : Str -> N = \s -> case s of {
@@ -577,12 +747,12 @@ formV : (root : Str) -> VerbForm -> V = \s,f -> case f of {
FormIV => v4 s ;
FormV => v5 s ;
FormVI => v6 s ;
--- FormVII => v7 s ;
FormVII => v7 s ;
FormVIII => v8 s ;
FormX => v10 s
} ;
param VerbForm =
FormI | FormII | FormIII | FormIV | FormV | FormVI | FormVIII | FormX ;
FormI | FormII | FormIII | FormIV | FormV | FormVI | FormVII | FormVIII | FormX ;
} ;

View File

@@ -35,9 +35,13 @@ flags coding=utf8 ;
fuci = { h = "" ; m1 = "ُ" ; m2 = ""; t = "ِ" } ;
fucu = { h = "" ; m1 = "ُ" ; m2 = ""; t = "ُ" } ;
fUc = { h = "" ; m1 = "ُو"; m2 = ""; t = "" } ;
ufAc = { h = "ُ" ; m1 = "َا"; m2 = ""; t = "" } ;
ufca = { h = "ُ" ; m1 = "ْ" ; m2 = ""; t = "َ" } ;
eafAc = fAc ** { h = "أَ" } ;
eafac = fac ** { h = "أَ" } ;
eafIc = fIc ** { h = "أَ" } ;
eafic = fic ** { h = "أَ" } ;
eafAcil = { h = "أَ"; m1 = "َا" ; m2 = "ِ" ; t = "" } ;
eafAcIl = { h = "أَ"; m1 = "َا" ; m2 = "ِي" ; t = "" } ;
eafcilp = { h = "أَ"; m1 = "ْ" ; m2 = "ِ" ; t = "َة" } ;
@@ -47,8 +51,14 @@ flags coding=utf8 ;
eafcul = { h = "أَ"; m1 = "ْ" ; m2 = "ُ" ; t = "" } ;
eiftacal = { h = "إِ"; m1 = "ْتَ" ; m2 = "َ" ; t = "" } ;
eufcil = { h = "أُ"; m1 = "ْ" ; m2 = "ِ" ; t = "" } ;
eufic = fic ** { h = "أُ" } ;
eufIc = fIc ** { h = "أُ" } ;
ufic = fic ** { h = "ُ" } ;
ufIc = fIc ** { h = "ُ" } ;
ufac = fac ** { h = "ُ" } ;
ufAc = fAc ** { h = "ُ" } ;
euftucil = { h = "أُ"; m1 = "ْتُ" ; m2 = "ِ" ; t = "" } ;
euttucil = euftucil ** { h = "اُتُّ" ; m1 = "ِ" } ; ---- IL assimilated VIII
euttucil = euftucil ** { h = "اُتُّ" ; m1 = "ِ" } ; ---- IL assimilated VIII
afcul = { h = "َ" ; m1 = "ْ" ; m2 = "ُ" ; t = "" } ;
faccalo = { h = "" ; m1 = "َ" ; m2 = "َّ" ; t = "ْ" } ;
facal = { h = "" ; m1 = "َ" ; m2 = "َ" ; t = "" } ;
@@ -77,9 +87,12 @@ flags coding=utf8 ;
ficAl = { h = "" ; m1 = "ِ" ; m2 = "َا" ; t = "" } ;
ficlp = { h = "" ; m1 = "ِ" ; m2 = "ْ" ; t = "َة" } ;
ftacal = { h = "" ; m1 = "ْتَ" ; m2 = "َ" ; t = "" } ;
ftical = ftacal ** { m1 = "ْتِ" } ; -- IL hollow VIII
ftAcal = ftacal ** { m1 = "ْتَا" } ; -- IL hollow VIII
ftIcal = ftacal ** { m1 = "ْتِي" } ; -- IL hollow VIII
ftacil = { h = "" ; m1 = "ْتَ" ; m2 = "ِ" ; t = "" } ;
ttacal = ftacal ** { m1 = "" ; h = "تَّ" } ; ---- IL assimilated VIII
ttacil = ftacil ** { m1 = "" ; h = "تَّ" } ; ---- IL assimilated VIII
ttacal = ftacal ** { m1 = "" ; h = "تَّ" } ; ---- IL assimilated VIII
ttacil = ftacil ** { m1 = "" ; h = "تَّ" } ; ---- IL assimilated VIII
fuccAl = { h = "" ; m1 = "ُ" ; m2 = "َّا" ; t = "" } ;
fuccil = { h = "" ; m1 = "ُ" ; m2 = "ِّ" ; t = "" } ;
fuccilo = { h = "" ; m1 = "ُ" ; m2 = "ِّ" ; t = "ْ" } ;

View File

@@ -10,15 +10,16 @@ concrete PhraseAra of Phrase = CatAra ** open
UttQS qs = {s = \\g => qs.s ! QDir} ;
UttImpSg pol imp = {s = \\g => imp.s ! pol.p ! g ! ResAra.Sg ++ pol.s} ;
UttImpPl,UttImpPol = \pol,imp -> {s = \\g => imp.s ! pol.p ! g ! ResAra.Pl ++ pol.s} ;
UttInterj i = {s = \\g => i.s} ;
UttIP ip = {s = \\g => ip.s ! g ! Def ! Nom} ; --IL
UttIP ip = {s = \\g => ip.s ! False ! g ! Def ! Nom} ; --IL
UttAP ap = {s = ResAra.uttAP ap} ; --IL
UttCard c = {s = ResAra.uttNum c} ; --IL
UttCN cn = {s = \\_ => cn.s ! Sg ! Def ! Nom} ; --IL
UttCN cn = {s = ResAra.uttCN cn } ; --IL
UttNP np = {s = \\_ => np.s ! Nom} ;
UttVP vp = {s = \\g => (compVP vp).s ! {g=g ; n=Sg} ! Nom} ; --IL
UttS,
UttVP vp = {s = uttVP vp} ; --IL
UttS s = {s = \\_ => s.s ! Verbal} ;
UttAdv,
UttIAdv = \s -> {s = \\_ => s.s} ; ---- OK? AR
--

View File

@@ -1,4 +1,4 @@
concrete QuestionAra of Question = CatAra ** open ResAra, ParamX, Prelude, VerbAra in {
concrete QuestionAra of Question = CatAra ** open ResAra, ParamX, Prelude, VerbAra, SentenceAra in {
flags optimize=all_subs ; coding = utf8 ;
@@ -7,97 +7,72 @@ concrete QuestionAra of Question = CatAra ** open ResAra, ParamX, Prelude, VerbA
QuestCl cl = {
s = \\t,p =>
table {
QIndir => "إِذا" ++ cl.s ! t ! p ! Verbal ;
QDir => "هَل" ++ cl.s ! t ! p ! Verbal
QIndir => "إِذا" ++ cl.s ! t ! p ! toOrder QIndir ;
QDir => "هَلْ" ++ cl.s ! t ! p ! toOrder QDir
}
};
-- ComplSlashIP vps ip = {} ;
-- AR copied from PredVP
--IL guessed
QuestVP qp vp =
{ s =\\t,p,_ =>
let {
---- o = Verbal ; ---- AR
objgn = pgn2gn vp.obj.a.pgn ;
np = {s = qp.s ! objgn.g ! Def ; ----IL just guessing state
a ={pgn = Per3 Masc qp.n ; isPron = False}} ;
pgn = np.a.pgn ;
gn = pgn2gn pgn;
kataba = vp.s ! pgn ! VPPerf ;
yaktubu = vp.s ! pgn ! VPImpf Ind ;
yaktuba = vp.s ! pgn ! VPImpf Cnj ;
yaktub = vp.s ! pgn ! VPImpf Jus ;
vStr : ResAra.Tense -> Polarity -> Str =
\tn,pl -> case<vp.isPred,tn,pl> of {
<False, ResAra.Pres, Pos> => yaktubu ;
<False, ResAra.Pres, Neg> => "لَا" ++ yaktubu ;
<True, ResAra.Pres, Pos> => "" ; --no verb "to be" in present
<True, ResAra.Pres, Neg> => "لَيسَ" ;--same here, just add negation particle
<_, ResAra.Past, Pos> => kataba ;
<_, ResAra.Past, Neg> => "لَمْ" ++ yaktub ;
<_, ResAra.Fut, Pos> => "سَ" ++ yaktubu ;
<_, ResAra.Fut, Neg> => "لَنْ" ++ yaktuba
};
pred : ResAra.Tense -> Polarity -> Str =
\tn,pl -> case <vp.isPred,tn,pl> of {
<True, ResAra.Pres, Pos> => vp.pred.s ! gn ! Nom; --xabar marfooc
_ => vp.pred.s ! gn ! Acc --xabar kaana wa laysa manSoob
} ;
let np = ip2np qp vp.isPred ;
cl = PredVP np vp ;
in { s = \\t,p,qf => cl.s ! t ! p ! toOrder qf } ;
} in
--- case o of {
---- _ =>
case <False, np.a.isPron> of {
---- AR workaround 18/12/2008 case <vp.obj.a.isPron, np.a.isPron> of {
-- ya2kuluhu
<False,True> => (vStr t p) ++ vp.obj.s ++ vp.s2 ++ (pred t p);
-- ya2kuluhu al-waladu, yakuluhu al-2awlaadu
<False,False> => (vStr t p) ++ np.s ! Nom ++ vp.obj.s ++ vp.s2 ++ (pred t p);
<True,False> => (vStr t p) ++ vp.obj.s ++ np.s ! Nom ++ vp.s2 ++ (pred t p);
<True,True> => (vStr t p) ++ vp.obj.s ++ vp.s2 ++ (pred t p)
};
---- Nominal =>
---- np.s ! Nom ++ (vStr t p) ++ vp.obj.s ++ vp.s2 ++ (pred t p)
}
; ---- };
---- AR guessed
QuestIAdv iadv cl = {s = \\t,p,_ => iadv.s ++ cl.s ! t ! p ! Verbal} ;
QuestIAdv iadv cl = {s = \\t,p,qf => iadv.s ++ cl.s ! t ! p ! toOrder qf} ;
---- IL guessed
QuestIComp icomp np =
let vp = kaan (CompNP np) in
QuestVP icomp vp ;
-- : IComp -> NP -> QCl
QuestIComp ic np =
let vp = UseComp (CompNP np) ; -- puts NP in nominative
ip : ResAra.IP = np ** { -- NP's s is already present in VP, we only want its agr
s = \\_,_,_,_ => ic.s ! pgn2gn np.a.pgn } ;
in QuestVP ip vp ;
CompIP ip = ip ;
-- old, when IComp = Comp { s = \\{g=g ; n=_},c => ip.s ! g ! Def ! c } ; ----
CompIAdv iadv = mkIP iadv.s ResAra.Sg ;
-- QCl = {s : R.Tense => Polarity => QForm => Str} ;
QuestSlash ip cl = { ----IL just guessing
s = \\t,p,qf => case qf of {
QDir => cl.s ! t ! p ! Verbal ++ cl.c2 ++ ip.s ! Masc ! Def ! Nom ; --VSO (purely guessing)
QIndir => cl.s ! t ! p ! Nominal ++ cl.c2 ++ ip.s ! Masc ! Def ! Nom } --SVO (purely guessing)
-- : IP -> IComp ;
CompIP ip = ip ** {
s = \\gn => ip.s ! True -- True=IP will be a subject of predicative sentence
! gn.g -- IComp agrees in gender with eventual head
! Def ! Nom ; -- IP will be a subject
} ;
PrepIP p ip = {s = p.s ++ ip.s ! Masc ! Def ! Acc} ; ----IL
CompIAdv iadv = { s = \\_ => iadv.s ; a = ResAra.Sg } ;
-- QCl = {s : Tense => Polarity => QForm => Str} ;
QuestSlash ip cls = { ----IL just guessing
s = \\t,p,qf =>
let cl : ResAra.Cl = complClSlash cls ; -- dummy conversion to Cl
o = toOrder qf
in cls.c2.s ++ ip.s ! False ! Masc ! Def ! Nom ++ cl.s ! t ! p ! o
} ;
--IL guessed
PrepIP p ip = {
s = p.s ++ ip.s ! False -- not used as a subject of predicative sentence
! Masc ----
! Def ! Gen
} ;
AdvIP ip adv = ip ** {
s = \\g,s,c => ip.s ! g ! s ! c ++ adv.s ;
n = ip.n
s = \\isPred,g,s,c => ip.s ! isPred ! g ! s ! c ++ adv.s ;
} ;
----IL guessed with help of L and Google translate
-- : IDet -> IP
IdetIP idet = idet ; -- Gender still matters if turned into IComp
IdetIP idet = idet ** {
s = \\isPred => idet.s ;
a = { pgn = agrP3 NoHum Masc idet.n ; isPron = False }
} ;
-- : IDet -> CN -> IP
IdetCN idet cn = idet ** {
s = \\g,s,c => idet.s ! cn.g ! s ! c ++ -- gender is determined by the CN
cn.s ! idet.n ! Indef ! Gen ; --idaafa
IdetCN idet cn = {
s = \\isPred,g,s,c
=> idet.s ! cn.g ! s ! c ++
cn2str cn idet.n idet.d Gen ;
a = { pgn = agrP3 NoHum cn.g idet.n ; isPron = False }
} ;
-- : IQuant -> Num -> IDet
@@ -105,6 +80,7 @@ concrete QuestionAra of Question = CatAra ** open ResAra, ParamX, Prelude, VerbA
s = \\g,s,c =>
let gend = detGender g num.n -- gender flips with some numbers
in iquant.s ! s ! c ++ num.s ! gend ! s ! c ;
n = sizeToNumber num.n
n = sizeToNumber num.n ;
d = Indef ---- TODO check
} ;
}

View File

@@ -1,35 +1,50 @@
concrete RelativeAra of Relative = CatAra ** open ResAra in {
concrete RelativeAra of Relative = CatAra **
open ResAra in {
flags coding=utf8;
--
-- flags optimize=all_subs ;
--
-- lin
--
-- RelCl cl = {
-- s = \\t,a,p,_ => "سُعه" ++ "تهَت" ++ cl.s ! t ! a ! p ! ODir
-- } ;
--
-- RelVP rp vp = {
-- s = \\t,ant,b,ag =>
-- let
-- agr = case rp.a of {
-- RNoAg => ag ;
-- RAg a => a
-- } ;
-- cl = mkClause (rp.s ! Nom) agr vp
-- in
-- cl.s ! t ! ant ! b ! ODir
-- } ;
--
-- RelSlash rp slash = {
-- s = \\t,a,p,_ => slash.c2 ++ rp.s ! Acc ++ slash.s ! t ! a ! p ! ODir
-- } ;
lin
RelCl cl = {
s = \\t,p,agr,c => IdRP.s ! agr2ragr agr c ++ cl.s ! t ! p ! Nominal
} ;
-- : RP -> VP -> RCl ; -- who loves John
RelVP rp vp = {
s = \\t,p,agr,c =>
let
npS : Case => Str = \\_ => rp.s ! agr2ragr agr c ;
np : ResAra.NP = agrNP agr ** {s = npS} ;
cl = predVP np vp ;
in
cl.s ! t ! p ! Nominal
} ;
-- : RP -> ClSlash -> RCl ; -- whom John loves
RelSlash rp cls = cls ** {
s = \\t,p,agr,c =>
let --empty : Agr -> NP = emptyNP ;
obj : ResAra.NP = pgn2pron agr.pgn ; -- head is repeated as a clitic object pronoun
cl : ResAra.Cl = complClSlash obj cls ;
in rp.s ! agr2ragr agr c ++ cl.s ! t ! p ! VOS
} ;
--
-- FunRP p np rp = {
-- s = \\c => np.s ! c ++ p.s ++ rp.s ! Acc ;
-- a = RAg np.a
-- } ;
--
-- IdRP = mkIP "وهِعه" "وهِعه" "وهْسي" Sg ** {a = RNoAg} ;
--
IdRP =
{ s = table {
RSg Masc => "اَلَّذِي" ;
RSg Fem => "اَلَّتِي" ;
RPl Masc => "اَلَّذِين" ;
RPl Fem => "اَللَّاتِي" ;
RDl Masc Bare => "اَللَّذَيْن" ;
RDl Masc Nom => "اَللَّذَانِ" ;
RDl Masc _ => "اَللَّذَيْنِ" ;
RDl Fem Bare => "اَللَّتَيْن" ;
RDl Fem Nom => "اَللَّتَانِ" ;
RDl Fem _ => "اَللَّتَيْنِ"
}
} ;
}

File diff suppressed because it is too large Load Diff

View File

@@ -26,67 +26,16 @@ concrete SentenceAra of Sentence = CatAra ** open
}
};
-}
PredVP np vp =
{ s =\\t,p,o =>
let {
pgn =
case <o,np.a.isPron> of {
<Verbal, False> => verbalAgr np.a.pgn;
_ => np.a.pgn
};
gn = pgn2gn pgn;
kataba = vp.s ! pgn ! VPPerf ;
yaktubu = vp.s ! pgn ! VPImpf Ind ;
yaktuba = vp.s ! pgn ! VPImpf Cnj ;
yaktub = vp.s ! pgn ! VPImpf Jus ;
vStr : ResAra.Tense -> Polarity -> Str =
\tn,pl -> case<vp.isPred,tn,pl> of {
<False, ResAra.Pres, Pos> => yaktubu ;
<False, ResAra.Pres, Neg> => "لَا" ++ yaktubu ;
<True, ResAra.Pres, Pos> => "" ; --no verb "to be" in present
<True, ResAra.Pres, Neg> => "لَيسَ" ;--same here, just add negation particle
<_, ResAra.Past, Pos> => kataba ;
<_, ResAra.Past, Neg> => "لَمْ" ++ yaktub ;
<_, ResAra.Fut, Pos> => "سَ" ++ yaktubu ;
<_, ResAra.Fut, Neg> => "لَنْ" ++ yaktuba
};
pred : ResAra.Tense -> Polarity -> Str =
\tn,pl -> case <vp.isPred,tn,pl> of {
<True, ResAra.Pres, Pos> => vp.pred.s ! gn ! Nom; --xabar marfooc
_ => vp.pred.s ! gn ! Acc --xabar kaana wa laysa manSoob
};
} in
case o of {
Verbal =>
--case <False, np.a.isPron> of { ---- AR workaround 18/12/2008
case <vp.obj.a.isPron, np.a.isPron> of {
{- IL: I don't think we should do prodrop here. vStr drops the copula in present tense,
so there's hardly anything left for a predicative clause: e.g.
PredVP (UsePron i_Pron) (UseComp (CompCN (UseN car_N))) "I am a car"
would be linearised just as "car", if we have both prodrop and copula drop.
Leaving it up to someone who knows Arabic to decide what is better.
Original here:
<True,True> => (vStr t p) ++ vp.obj.s ++ vp.s2 ++ (pred t p) ;
-- ya2kuluhu
<False,True> => (vStr t p) ++ vp.obj.s ++ vp.s2 ++ (pred t p); -}
-- ya2kuluhu al-waladu, yakuluhu al-2awlaadu
<False> => (vStr t p) ++ np.s ! Nom ++ vp.obj.s ++ vp.s2 ++ (pred t p);
<True> => (vStr t p) ++ vp.obj.s ++ np.s ! Nom ++ vp.s2 ++ (pred t p)
};
Nominal =>
np.s ! Nom ++ (vStr t p) ++ vp.obj.s ++ vp.s2 ++ (pred t p)
}
};
PredVP = predVP ;
-- PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp ;
ImpVP vp = {
s = \\p,g,n =>
case p of {
Pos => vp.s ! (Per2 g n) ! VPImp ++ vp.obj.s ++ vp.s2 ;
Neg => "لا" ++ vp.s ! (Per2 g n) ! (VPImpf Jus) ++ vp.obj.s ++ vp.s2
}
Pos => vp.s ! Per2 g n ! VPImp ;
Neg => "لَا" ++ vp.s ! Per2 g n ! VPImpf Jus
} ++ vp.obj.s ++ vp.pred.s ! {g=g;n=n} ! Acc ++ vp.s2
};
--
@@ -100,9 +49,11 @@ concrete SentenceAra of Sentence = CatAra ** open
-- ClSlash
SlashVP np vps = PredVP np vps ** { c2 = vps.c2 } ;
SlashVP = predVPSlash ;
AdvSlash slash adv = slash ** { s2 = slash.s2 ++ adv.s } ;
SlashPrep cl prep = cl ** {c2 = prep.s} ;
-- : Cl -> Prep -> ClSlash
-- SlashPrep cl prep = TODO
-- SlashVS np vs sslash = TODO
@@ -113,22 +64,26 @@ concrete SentenceAra of Sentence = CatAra ** open
--
UseCl t p cl =
{s = case <t.t,t.a> of { --- IL guessed tenses
<(Pres|Cond),Simul> => cl.s ! ResAra.Pres ! p.p ! Verbal ;
<Fut ,_ > => cl.s ! ResAra.Fut ! p.p ! Verbal ;
<_ ,_ > => cl.s ! ResAra.Past ! p.p ! Verbal
{s = \\o => t.s ++ p.s ++
case <t.t,t.a> of { --- IL guessed tenses
<Pres,Simul> => cl.s ! Pres ! p.p ! o ;
<Pres,Anter> => cl.s ! Past ! p.p ! o ;
<x ,_ > => cl.s ! x ! p.p ! o
}
};
UseQCl t p qcl =
{s = \\q =>
{s = \\q => t.s ++ p.s ++
case <t.t,t.a> of { --- IL guessed tenses
<(Pres|Cond),Simul> => qcl.s ! ResAra.Pres ! p.p ! q ;
<Fut ,_ > => qcl.s ! ResAra.Fut ! p.p ! q ;
<_ ,_ > => qcl.s ! ResAra.Past ! p.p ! q
<Pres,Simul> => qcl.s ! Pres ! p.p ! q ;
<Pres,Anter> => qcl.s ! Past ! p.p ! q ;
<x ,_ > => qcl.s ! x ! p.p ! q
}
};
-- UseRCl t a p cl = {s = \\r => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! r} ;
UseRCl t p cl = {s = \\agr,c => t.s ++ p.s ++ cl.s ! t.t ! p.p ! agr ! c} ;
UseSlash t p cl = UseCl t p (complClSlash cl) ;
AdvS adv s = s ** {s = \\o => adv.s ++ s.s ! o} ;
}

View File

@@ -4,8 +4,8 @@ concrete StructuralAra of Structural = CatAra **
flags optimize=all ; coding=utf8 ;
lin
above_Prep = ss "فَوْقَ" ;
after_Prep = ss "بَعْدَ" ;
above_Prep = mkPrep "فَوْقَ" ;
after_Prep = mkPrep "بَعْدَ" ;
all_Predet = mkPredet "كُلّ" True ;
almost_AdA = ss "تَقْرِيباً";
almost_AdN = ss "حَوَالي" ; -- or "تَقرِيبا"
@@ -13,20 +13,20 @@ concrete StructuralAra of Structural = CatAra **
-- always_AdV = ss "َلوَيس" ;
and_Conj = ss "وَ" ** {n = Pl} ;
-- because_Subj = ss "بعَُسي" ;
before_Prep = ss "قَبْلَ" ;
behind_Prep = ss "خَلْفَ" ;
between_Prep = ss "بَيْنَ" ;
before_Prep = mkPrep "قَبْلَ" ;
behind_Prep = mkPrep "خَلْفَ" ;
between_Prep = mkPrep "بَيْنَ" ;
-- both7and_DConj = sd2 "بْته" "َند" ** {n = Pl} ;
-- but_PConj = ss "بُت" ;
by8agent_Prep = ss "بِ" ;
by8means_Prep = ss "بِ" ;
by8agent_Prep,
by8means_Prep = biPrep ;
can_VV = mkVV (mkV "طوع" FormX) ;
-- can8know_VV = {
-- s = table VVForm [["بي َبلي تْ"] ; "عَن" ; "عُْلد" ;
-- ["بّن َبلي تْ"] ; ["بِنغ َبلي تْ"] ; "عَنءت" ; "عُْلدنءت"] ;
-- isAux = True
-- } ;
during_Prep = ss "خِلَالَ" ;
during_Prep = mkPrep "خِلَالَ" ;
-- either7or_DConj = sd2 "ِتهر" "ْر" ** {n = Sg} ;
everybody_NP = regNP "الجَمِيع" Pl ;
every_Det = mkDet "كُلّ" Sg Const ;
@@ -34,18 +34,23 @@ concrete StructuralAra of Structural = CatAra **
-- everywhere_Adv = ss "ثريوهري" ;
few_Det = mkDet "بَعض" Pl Const ;
-- first_Ord = ss "فِرست" ;
from_Prep = ss "مِنَ" ;
he_Pron = mkPron "هُوَ" "هُ" "هُ" (Per3 Masc Sg) ;
for_Prep = liPrep ;
from_Prep = mkPrep "مِنَ" ;
he_Pron = ResAra.he_Pron ;
here_Adv = ss "هُنا" ;
-- here7to_Adv = ss ["تْ هري"] ;
-- here7from_Adv = ss ["فرْم هري"] ;
how_IAdv = ss "كَيفَ" ;
-- how8many_IDet = mkDet "كَمْ" Pl Const ; -- IL: check (was ["هْو مَني"]) ;
-- if_Subj = ss "ِف" ;
in8front_Prep = ss "مُقَابِلَ" ;
i_Pron = mkPron "أَنَا" "نِي" "ِي" (Per1 Sing);
in_Prep = ss "فِي" ;
it_Pron = mkPron "ِت" "ِت" "ِتس" (Per3 Masc Sg); -- IL: check
how8many_IDet = {
s = \\g,s,c => "كَمْ عَدَد" + caseTbl ! c ;
n = Pl ; d = Def
} ; -- IL
if_Subj = mkSubj "إِذَا" Verbal ;
in8front_Prep = mkPrep "مُقَابِلَ" ;
i_Pron = ResAra.i_Pron ;
in_Prep = mkPrep "فِي" ;
it_Pron = emptyNP ** {s = \\_ => "هَذَا"} ; -- was: it_Pron = mkPron "ِت" "ِت" "ِتس" (Per3 Masc Sg);
-- less_CAdv = ss "لسّ" ;
many_Det = mkDet "جَمِيع" Pl Const ;
-- more_CAdv = ss "مْري" ;
@@ -57,64 +62,65 @@ concrete StructuralAra of Structural = CatAra **
-- isAux = True
-- } ;
no_Utt = {s = \\_ => "لا"} ;
on_Prep = ss "عَلى" ;
--- DEPREC one_Quant = mkQuantNum "واحِد" Sg Indef ;
on_Prep = mkPrep "عَلَى" ;
only_Predet = mkPredet "فَقَط" False;
-- or_Conj = ss "ْر" ** {n = Sg} ;
-- otherwise_PConj = ss "ْتهروِسي" ;
part_Prep = ss "مِنَ" ;
part_Prep = mkPrep "مِنَ" ;
-- please_Voc = ss "ةلَسي" ;
possess_Prep = ss "ل" ;
possess_Prep = liPrep ;
-- quite_Adv = ss "قُِتي" ;
she_Pron = mkPron "هِيَ" "ها" "ها" (Per3 Fem Sg) ;
she_Pron = ResAra.she_Pron ;
-- so_AdA = ss "سْ" ;
somebody_NP = regNP "أَحَد" Sg ;
someSg_Det = mkDet "أَحَد" Pl Const ;
someSg_Det = mkDet "أَحَد" Sg Const ;
somePl_Det = mkDet "بَعض" Pl Const ;
something_NP = regNP "شَيْء" Sg ;
-- somewhere_Adv = ss "سْموهري" ;
that_Quant = mkQuant3 "ذَلِكَ" "تِلكَ" "أُلٱِكَ" Def;
that_Subj = mkSubj "أنَّ" ;
----b that_NP = indeclNP "ذَلِكَ" Sg ;
there_Adv = ss "هُناك" ;
-- there7to_Adv = ss "تهري" ;
-- there7from_Adv = ss ["فرْم تهري"] ;
-- therefore_PConj = ss "تهرفْري" ;
----b these_NP = indeclNP "هَؤُلَاء" Pl ;
they_Pron = mkPron "هُمْ" "هُمْ" "هُمْ" (Per3 Masc Pl) ;
they_Pron = theyMasc_Pron ;
this_Quant = mkQuant7 "هَذا" "هَذِهِ" "هَذَان" "هَذَيْن" "هَاتَان" "هَاتَيْن" "هَؤُلَاء" Def;
----b this_NP = indeclNP "هَذا" Sg ;
----b those_NP = indeclNP "هَؤُلَاءكَ" Pl ;
through_Prep = ss "عَبْرَ" ;
through_Prep = mkPrep "عَبْرَ" ;
-- too_AdA = ss "تّْ" ;
to_Prep = ss "إِلى" ;
under_Prep = ss "تَحْتَ" ;
to_Prep = mkPrep "إِلى" ;
under_Prep = mkPrep "تَحْتَ" ;
-- very_AdA = ss "ثري" ;
-- want_VV = P.mkVV (P.regV "وَنت") ;
we_Pron = mkPron "نَحنُ" "نا" "نا" (Per1 Plur) ;
whatPl_IP = mkIP "ماذا" Pl ;
whatSg_IP = mkIP "ماذا" Sg ;
want_VV = mkVV (mkV "رود" FormIV) ;
we_Pron = ResAra.we_Pron ;
whatPl_IP = mkIP "ما" "ماذا" Pl ;
whatSg_IP = mkIP "ما" "ماذا" Sg ;
when_IAdv = ss "مَتَى" ;
-- when_Subj = ss "وهن" ;
when_Subj = mkSubj "عِنْدَمَا" Verbal ;
where_IAdv = ss "أَينَ" ;
which_IQuant = {
s = \\s,c => case <c,s> of {
<Nom,Indef> => "أيٌّ" ;
<Nom,_> => "أيُّ" ;
<Bare,_> => "أيّ" ;
<Nom,Indef> => "أيٌّ" ;
<Nom,_> => "أيُّ" ;
<Acc,Indef> => "أيّاً" ;
<Acc,_> => "أيَّ" ;
<Gen,Indef> => "أيٍّ" ;
<Gen,_> => "أيِّ"
<Acc,_> => "أيَّ" ;
<_Gen,Indef> => "أيٍّ" ;
<_Gen,_> => "أيِّ"
}
} ;
whoSg_IP = mkIP "مَنْ" Sg ;
whoPl_IP = mkIP "مَنْ" Pl ;
whoSg_IP = mkIP "مَنْ" "مَنْ" Sg ;
whoPl_IP = mkIP "مَنْ" "مَنْ" Pl ;
-- why_IAdv = ss "وهي" ;
without_Prep = ss "بِدُونِ" ;
with_Prep = ss "مَع" ;
without_Prep = mkPrep "بِدُونِ" ;
with_Prep = mkPrep "مَع" ;
yes_Utt = {s = \\_ => "نَعَم"} ;
youSg_Pron = mkPron "أَنتَ" "كَ" "كَ" (Per2 Masc Sg) ;
youPl_Pron = mkPron "أَنتُمْ" "كُمْ" "كُمْ" (Per2 Masc Sg) ;
youPol_Pron = mkPron "أَنتِ" "كِ" "كِ" (Per2 Fem Sg) ;
youSg_Pron = youSgMasc_Pron ;
youPl_Pron = youPlMasc_Pron ;
youPol_Pron = youPlFem_Pron ; -- arbitrary?
have_V2 = dirV2 (regV "يَملِك") ;

View File

@@ -9,25 +9,27 @@ lin
FloatPN i = {s = \\c => i.s ; g = Masc ; h = NoHum } ; --IL
NumPN i = {s = \\c => uttNum i ! Masc ; g = Masc ; h = NoHum } ; --IL
-- CNIntNP cn i = {
-- s = \\c => cn.s ! Sg ! Def ! c ++ uttNum i ! Masc ;
-- s = \\c => cn2str cn Sg Def c ++ uttNum i ! cn.g ;
-- a = dummyAgrP3 Sg ;
-- } ;
--IL TODO: check out some opers regarding state in ResAra. These are just dummy values.
CNSymbNP det cn xs =
let g = cn.g ; n = sizeToNumber det.n in {
s = \\c => det.s ! NoHum ! g ! c ++ cn.s ! Sg ! Def ! c ++ cn.adj ! n ! Def ! c ++ xs.s; ----IL word order?? Seems to be nontrivial according to ResAra comments.
s = \\c => det.s ! NoHum ! g ! c ++ cn2str cn n Def c ++ xs.s; ----IL word order?? Seems to be nontrivial according to ResAra comments.
a = dummyAgrP3 n ;
empty = []
} ;
CNNumNP cn i = {
s = \\c => cn.s ! Sg ! Def ! c ++ uttNum i ! Masc ;
s = \\c => cn2str cn Sg Def c ++ uttNum i ! cn.g ;
a = dummyAgrP3 Sg ;
empty = []
} ;
SymbS sy = sy ;
SymbS sy = {s = \\_ => sy.s} ;
SymbOrd n = {s = \\_,_,_ => n.s ; n = None } ;
SymbNum n = SymbOrd n ** { n = ThreeTen } ; ----IL
SymbOrd n = {s = \\_,_,_ => n.s ; n = One ; isNum = False } ;
SymbNum n = SymbOrd n ** { n = ThreeTen ; isNum = True } ; ----IL
lincat

View File

@@ -1,4 +1,4 @@
concrete VerbAra of Verb = CatAra ** open Prelude, ResAra in {
concrete VerbAra of Verb = CatAra ** open Prelude, ResAra, ParamX in {
flags optimize=all_subs ;
@@ -6,47 +6,96 @@ concrete VerbAra of Verb = CatAra ** open Prelude, ResAra in {
UseV = predV ;
SlashVV vv vps = vps ** predV vv ; ----IL
SlashV2a v = predVSlash v ;
Slash3V3 v np = insertObj np (predVSlash v) ** {c2 = v.c3};
-- : V2V -> VP -> VPSlash ; -- beg (her) to go
SlashV2V v2v vp = let v2vVP = predV v2v in -- IL
vp ** {
s = v2vVP.s ;
agrObj = \\pgn => v2v.c3.s -- أَنْ
++ vp.s ! pgn ! VPImpf Cnj ; -- this will agree with the object added by ComplSlash
isPred = False ;
c2 = v2v.c2 ; -- preposition for the direct object
sc = v2v.sc
} ;
-- : V2V -> NP -> VPSlash -> VPSlash ; -- beg me to buy
SlashV2VNP v2v np vps = let v2vVP = slashV2 v2v in -- IL
vps ** {
s = \\pgn,vpf => v2vVP.s ! pgn ! vpf -- main verb agrees with subject
++ bindIfPron np v2vVP
++ v2v.c3.s -- أَنْ
++ vps.s ! np.a.pgn ! VPImpf Cnj -- verb from old VP agrees with object
++ vps.obj.s ; -- otherwise obj appears in a weird place /IL
obj = emptyObj ;
isPred = False ;
-- preposition for the direct object comes from VP
sc = v2v.sc
} ;
SlashV2a = slashV2 ;
Slash3V3 v np = insertObj np (slashV2 v) ** {c2 = v.c3 ; agrObj = \\_ => []};
ComplSlash vp np = insertObj np vp ;
-- Complv3 v np np2 = insertObj np2 (insertObj np (predV v)) ;
{-{s = \\_ => v.c2 ++ np.s ! Acc ++ v.c3 ++ np2.s ! Acc ;
a = {pgn = Per3 Masc Sg ; isPron = False} } --FIXME
(predV v) ;-}
ComplVV vv vp = let vvVP = predV vv in --- IL
-- : VV -> VP -> VP ; -- want to run
ComplVV vv vp = let vvVP = predV vv in -- IL
vp ** {
s = \\pgn,vpf => vvVP.s ! pgn ! vpf
++ vv.c2 -- أَنْ
++ vp.s ! pgn ! VPImpf Cnj
++ vv.c2.s -- أَنْ
++ vp.s ! pgn ! VPImpf Cnj ;
isPred = False ;
sc = vv.sc
} ;
-- ComplVS v s = insertObj (\\_ => conjThat ++ s.s) (predV v) ;
-- ComplVQ v q = insertObj (\\_ => q.s ! QIndir) (predV v) ;
--
-- ComplVA v ap = insertObj (ap.s) (predV v) ;
-- : VS -> S -> VP ; -- say that she runs
ComplVS vs s = predV vs ** { -- IL
obj = emptyObj ** {s = s.s ! Subord}
} ;
-- : VQ -> QS -> VP ; -- wonder who runs
ComplVQ vq qs = predV vq ** { -- IL
obj = emptyObj ** {s = qs.s ! QIndir}
} ;
-- : VA -> AP -> VP ; -- they become red
ComplVA v ap = predV v ** {pred = CompAP ap} ;
-- ComplV2A v np ap =
-- insertObj (\\_ => v.c2 ++ np.s ! Acc ++ ap.s ! np.a) (predV v) ;
--
UseComp xabar = kaan xabar ;
UseComp xabar =
case xabar.isNP of {
False => kaan xabar ;
True => predV copula ** {obj = xabar.obj ; isPred=True}
} ;
UseCopula = predV copula ;
-- : VP -> Prep -> VPSlash ; -- live in (it)
VPSlashPrep vp prep = vp ** {
c2 = prep ;
agrObj = \\_ => []
} ;
AdvVP vp adv = insertStr adv.s vp ;
-- AdVVP adv vp = insertAdV adv.s vp ;
AdVVP adv = insertStr adv.s ;
AdVVPSlash adv vps = vps ** insertStr adv.s vps ;
--
-- ReflV2 v = insertObj (\\a => v.c2 ++ reflPron ! a) (predV v) ;
--
PassV2 v = kaan {s = \\_,_ => v.s ! VPPart} ; ---- IL guessed
PassV2 = passPredV ;
--
-- UseVS, UseVQ = \vv -> {s = vv.s ; c2 = [] ; isRefl = vv.isRefl} ; -- no
CompCN cn = {s = \\agr,c => cn.s ! agr.n ! Indef ! c} ; ----IL
CompAP ap = {s = \\agr,c => ap.s ! Hum ! agr.g ! agr.n ! Indef ! c} ; --FIXME
CompNP np = {s = \\_,c => np.s ! c};
CompAdv a = {s = \\_,_ => a.s} ;
CompAP ap = {s = \\agr,c => ap.s ! Hum ! agr.g ! agr.n ! Indef ! c ; --FIXME
obj = emptyObj ; isNP = False} ;
CompAdv a = {s = \\_,_ => a.s ;
obj = emptyObj ; isNP = False} ;
CompCN cn = {s = \\agr,c => cn2str cn agr.n Indef Nom ;
obj = emptyObj ; isNP = False} ;
CompNP np = {s = \\_,_ => [] ; obj = np ** {s = np.s ! Nom} ; isNP = True} ;
--
--
}

View File

@@ -21,7 +21,9 @@ incomplete concrete AdjectiveBantu of Adjective =
} ;
ComplA2 a np = {
s = \\g,n => a.s !AComp g n ++ a.c2 ++ np.s ! NCase Nom;
isPre = False
} ;
ReflA2 a ={

View File

@@ -13,8 +13,10 @@ incomplete concrete AdverbBantu of Adverb =
} ;
PrepNP prep np = let agr = complAgr np.a
in {s = prep.s!agr.n!agr.g ++ (np.s ! NCase Loc ) } ;
AdAdv = cc2 ;
PositAdAAdj a = {s = a.s !AAdj G1 Sg } ;

View File

@@ -12,7 +12,9 @@ resource CommonBantu = ParamX ** open Prelude in {
param
Case = Nom | Loc ;
NPCase = NCase Case | NPoss ;
CardOrd = NCard | NOrd ;
oper

View File

@@ -4,6 +4,7 @@ interface DiffBantu = open CommonBantu, Prelude in {
flags coding=utf8 ;
oper
Gender : PType ;
firstGender : Gender ;
@@ -37,8 +38,10 @@ oper
} ;
verbAgr : Agr -> {g : Gender ; n : Number ; p : Person} = \a -> case a of {
Ag g n p => {g = g ; n = n ; p = p}
} ; --
detAgr : Agr -> {g : Gender ; p : Person} = \a -> case a of {
Ag g _ p => {g = g; p = p}
} ;
@@ -70,6 +73,7 @@ param
DetForm = Sub | Obj Gender ;
oper
conjThan : Str ; --one of them in bantu
conjThat : Str ;
@@ -82,8 +86,10 @@ param
DForm ;
AForm;
oper
ProunSgprefix : Gender -> Str ;
ProunPlprefix : Gender -> Str ;
Cardoneprefix : Gender -> Str;
Cardtwoprefix : Gender -> Str;
Allpredetprefix : Gender -> Str;

View File

@@ -23,7 +23,9 @@ lin
n=agr.n; g=agr.g
in {s = table {
NCase c => pron.s!Pers ;
NPoss => pron.s!Poss n g };
a = Ag agr.g agr.n agr.p;
} ;
-- Predet -> NP -> NP
@@ -140,12 +142,14 @@ lin
-- PossNP : CN -> NP -> CN
-- e.g. 'house of Paris', 'house of mine'
PossNP cn np =let agr = detAgr np.a in
{s = \\n,c => cn.s ! n ! Nom ++ possess_Prep.s! n!cn.g ++ np.s ! NPoss;
s2 =\\n => []; g = cn.g} ;
-- PartNP : CN -> NP -> CN
-- e.g. 'glass of wine'
PartNP cn np = {s = \\n,c => cn.s ! n ! Nom ++ part_Prep.s! n!cn.g ++ np.s ! NCase Nom ; s2 =\\n => []; g = cn.g} ;
-- CountNP : Det -> NP -> NP
-- e.g. 'three of them', 'some of the boys'
CountNP det np = let agr = verbAgr np.a
@@ -161,8 +165,10 @@ lin
DetDAP d = { s=d.s; n=d.n };
-- ApposCN cn np = let agr = complAgr np.a in
-- {s = \\n,c => np.s ! NCase Nom --++ possess_Prep.s!n!agr.g
-- ++ cn.s !n ! Nom ; s2 =\\n => ""; g = cn.g} ;
}

View File

@@ -18,7 +18,9 @@ oper
{s : NPCase => Str ; a : Agr} = \i,my,g,n,p ->
{ s = table {
NCase Nom => i ;
NCase Loc | NPoss => my -- works for normal genitives, "whose", etc.
} ;
a = Ag g n p ;
};

View File

@@ -2019,7 +2019,7 @@ oper
(v0+"˙ő")
(v0+"ŕë")
(v0+"˙ë")
(v0+"-")
(v0+"ŕí")
(v0+"˙ů")
(v0+"č")
(v0+"ŕíĺ") ;

View File

@@ -1,165 +0,0 @@
--# -path=alltenses:../english:../translator:../abstract
concrete ParseBul of ParseEngAbs =
TenseX - [IAdv, CAdv],
CatBul,
NounBul - [PPartNP],
AdjectiveBul,
NumeralBul,
SymbolBul [PN, Symb, String, CN, Card, NP, MkSymb, SymbPN, CNNumNP],
ConjunctionBul,
VerbBul - [SlashV2V, PassV2, UseCopula, ComplVV],
AdverbBul,
PhraseBul,
SentenceBul,
QuestionBul,
RelativeBul,
IdiomBul [NP, VP, Tense, Cl, ProgrVP, ExistNP],
ExtraBul [NP, Quant, VPSlash, VP, Tense, GenNP, PassVPSlash,
Temp, Pol, Conj, VPS, ListVPS, S, MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS,
VPI, VPIForm, VPIInf, VPIPresPart, ListVPI, VV, MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV,
ComplSlashPartLast,
ClSlash, RCl, EmptyRelSlash],
DocumentationBul,
DictionaryBul **
open ResBul, Prelude in {
flags
literal=Symb ;
coding = utf8 ;
lin
CompoundCN num noun cn = {
s = \\nf => num.s ! CFNeut Indef ++ (noun.rel ! nform2aform nf cn.g) ++ (cn.s ! (indefNForm nf)) ;
g = cn.g
} ;
GerundN v = {
s = \\nform => v.s ! Imperf ! VNoun nform ;
rel = \\aform => v.s ! Imperf ! VPresPart aform ++
case v.vtype of {
VMedial c => reflClitics ! c;
_ => []
};
g = ANeut
} ;
GerundAP v = {
s = \\aform => v.s ! Imperf ! VPresPart aform ++
case v.vtype of {
VMedial c => reflClitics ! c;
_ => []
};
adv = v.s ! Imperf ! VPresPart (ASg Neut Indef);
isPre = True
} ;
PastPartAP v = {
s = \\aform => v.s ! Perf ! VPassive aform ;
adv = v.s ! Perf ! VPassive (ASg Neut Indef);
isPre = True
} ;
PositAdVAdj a = {s = a.adv} ;
that_RP = {
s = whichRP
} ;
UseQuantPN q pn = { s = table {
RObj Dat => "на" ++ pn.s;
_ => pn.s
} ;
a = {gn = GSg pn.g; p = P3};
p = q.p
} ;
PastPartRS ant pol vp = {
s = \\agr =>
ant.s ++ pol.s ++
vp.ad.s ++
case pol.p of {Pos => ""; Neg => "не"} ++
case ant.a of {Simul => ""; Anter => auxBe ! VPerfect (aform agr.gn Indef (RObj Acc))} ++
vp.s ! Perf ! VPassive (aform agr.gn Indef (RObj Acc)) ++
case vp.vtype of {
VMedial c => reflClitics ! c;
_ => []
} ++
vp.compl1 ! agr ++ vp.compl2 ! agr ;
} ;
PresPartRS ant pol vp = {
s = \\agr =>
ant.s ++ pol.s ++
vp.ad.s ++
case pol.p of {Pos => ""; Neg => "не"} ++
case ant.a of {Simul => ""; Anter => auxBe ! VPerfect (aform agr.gn Indef (RObj Acc))} ++
vp.s ! Imperf ! VPresPart (aform agr.gn Indef (RObj Acc)) ++
case vp.vtype of {
VMedial c => reflClitics ! c;
_ => []
} ++
vp.compl ! agr ;
} ;
SlashV2V vv ant p vp =
insertSlashObj2 (\\agr => ant.s ++ p.s ++ vv.c3.s ++
daComplex ant.a (orPol p.p vp.p) vp ! Perf ! agr)
Pos
(slashV vv vv.c2) ;
ComplVV vv ant p vp =
insertObj (\\agr => ant.s ++ p.s ++
case vv.typ of {
VVInf => daComplex ant.a p.p vp ! Perf ! agr;
VVGerund => gerund vp ! Imperf ! agr
}) vp.p
(predV vv) ;
PredVPosv np vp = {
s = \\t,a,p,o =>
let
subj = np.s ! (case vp.vtype of {
VNormal => RSubj ;
VMedial _ => RSubj ;
VPhrasal c => RObj c}) ;
verb : Bool => Str
= \\q => vpTenses vp ! t ! a ! p ! np.a ! q ! Perf ;
compl = vp.compl ! np.a
in case o of {
Main => compl ++ subj ++ verb ! False ;
Inv => verb ! False ++ compl ++ subj ;
Quest => compl ++ subj ++ verb ! True
}
} ;
CompS s = {s = \\_ => "че" ++ s.s; p = Pos} ;
CompQS qs = {s = \\_ => qs.s ! QIndir; p = Pos} ;
CompVP ant p vp = {s = let p' = case vp.p of {
Neg => Neg;
Pos => p.p
}
in \\agr => ant.s ++ p.s ++
daComplex ant.a p' vp ! Perf ! agr;
p = Pos
} ;
VPSlashVS vs vp =
let vp = insertObj (daComplex Simul Pos vp ! Perf) vp.p (predV vs)
in { s = vp.s;
ad = vp.ad;
compl1 = \\_ => "";
compl2 = vp.compl;
vtype = vp.vtype;
p = vp.p;
c2 = {s=""; c=Acc}
} ;
ApposNP np1 np2 = {
s = \\role => np1.s ! role ++ comma ++ np2.s ! RSubj ;
a = np1.a ;
p = np1.p
} ;
UttAdV adv = adv;
}

View File

@@ -258,6 +258,7 @@ oper
mkV0 : V -> V0 ; --%
mkVS : V -> VS ;
subjVS : V -> VS ;
mkV2S : V -> Prep -> V2S ;
mkVV : V -> VV ; -- plain infinitive: "vull parlar"
deVV : V -> VV ; -- "acabar de parlar"
@@ -448,6 +449,7 @@ oper
mkV0 v = v ** {lock_V0 = <>} ;
mkVS v = v ** {m = \\_ => Indic ; lock_VS = <>} ; ---- more moods
subjVS v = v ** {m = \\_ => Conjunct ; lock_VS = <>} ;
mkV2S v p = mk2V2 v p ** {mn,mp = Indic ; lock_V2S = <>} ;
mkVV v = v ** {c2 = complAcc ; lock_VV = <>} ;
deVV v = v ** {c2 = complGen ; lock_VV = <>} ;

View File

@@ -92,9 +92,9 @@ concrete CatEng of Cat = CommonX - [Pol,SC,CAdv] ** open ResEng, Prelude in {
-- Open lexical classes, e.g. Lexicon
V, VS, VQ, VA = Verb ; -- = {s : VForm => Str} ;
V2, V2A, V2Q, V2S = Verb ** {c2 : Str} ;
V3 = Verb ** {c2, c3 : Str} ;
V, VS, VQ, VA = Verb ;
V2, V2Q, V2S = Verb ** {c2 : Str} ;
V2A,V3 = Verb ** {c2, c3 : Str} ;
VV = {s : VVForm => Str ; p : Str ; typ : VVType} ;
V2V = Verb ** {c2,c3 : Str ; typ : VVType} ;
@@ -114,8 +114,8 @@ concrete CatEng of Cat = CommonX - [Pol,SC,CAdv] ** open ResEng, Prelude in {
VPSlash = \s -> predV {s = \\_ => s; p = ""; isRefl = False} ** {c2 = ""; gapInMiddle = False; missingAdv = False } ;
V, VS, VQ, VA = \s -> {s = \\_ => s; p = ""; isRefl = False} ;
V2, V2A, V2Q, V2S = \s -> {s = \\_ => s; p = ""; isRefl = False; c2=""} ;
V3 = \s -> {s = \\_ => s; p = ""; isRefl = False; c2,c3=""} ;
V2, V2Q, V2S = \s -> {s = \\_ => s; p = ""; isRefl = False; c2=""} ;
V3, V2A = \s -> {s = \\_ => s; p = ""; isRefl = False; c2,c3=""} ;
VV = \s -> {s = \\_ => s; p = ""; isRefl = False; typ = VVInf} ;
V2V = \s -> {s = \\_ => s; p = ""; isRefl = False; c2,c3="" ; typ = VVInf} ;

View File

@@ -1,7 +1,7 @@
--# -path=.:../abstract
concrete ConstructionEng of Construction = CatEng **
open SyntaxEng, SymbolicEng, ParadigmsEng, (L = LexiconEng), (E = ExtendEng), (G = GrammarEng), (R = ResEng), (S = StructuralEng), Prelude in {
open SyntaxEng, SymbolicEng, ParadigmsEng, (L = LexiconEng), (E = ExtendEng), (G = GrammarEng), (R = ResEng), (Sy = SyntaxEng), (S = StructuralEng), Prelude in {
lin
@@ -62,16 +62,62 @@ oper from_where_IAdv : IAdv = lin IAdv (ss "from where") ;
lincat
Timeunit = N ;
Hour = {s : Str ; am : Bool} ;
Weekday = N ;
Monthday = NP ;
Month = N ;
Year = NP ;
lin
lin
timeunitAdv n time =
let n_card : Card = n ;
n_hours_NP : NP = mkNP n_card time ;
in SyntaxEng.mkAdv for_Prep n_hours_NP | mkAdv (n_hours_NP.s ! R.npNom) ;
in Sy.mkAdv for_Prep n_hours_NP | mkAdv (n_hours_NP.s ! R.npNom) ;
timeunitRange l u time = {s = l.s ! True ! R.Nom ++ to_Prep.s ++ u.s ! True ! R.Nom ++ time.s ! R.Pl ! R.Nom} ;
oneHour = mkHour "1" True ;
twoHour = mkHour "2" True ;
threeHour = mkHour "3" True ;
fourHour = mkHour "4" True ;
fiveHour = mkHour "5" True ;
sixHour = mkHour "6" True ;
sevenHour = mkHour "7" True ;
eightHour = mkHour "8" True ;
nineHour = mkHour "9" True ;
tenHour = mkHour "10" True ;
elevenHour = mkHour "11" True ;
twelveHour = mkHour "12" False ;
thirteenHour = mkHour "1" False ;
fourteenHour = mkHour "2" False ;
fifteenHour = mkHour "3" False ;
sixteenHour = mkHour "4" False ;
seventeenHour = mkHour "5" False ;
eighteenHour = mkHour "6" False ;
nineteenHour = mkHour "7" False ;
twentyHour = mkHour "8" False ;
twentyOneHour = mkHour "9" False ;
twentyTwoHour = mkHour "10" False ;
twentyThreeHour = mkHour "11" False ;
twentyFourHour = mkHour "12" True ;
timeHour h = Sy.mkAdv at_Prep (symb (h.s ++ ampm ! h.am)) ;
timeHourMinute h m = let
min = m.s ! True ! R.Nom
in
Sy.mkAdv at_Prep (symb (h.s ++ min ++ ampm ! h.am)) ;
oper
mkHour : Str -> Bool -> {s : Str ; am : Bool} ;
mkHour n am = Sy.mkUtt (Sy.mkCard n) ** {am = am} ;
at_Prep : Prep ;
at_Prep = mkPrep "at" ;
ampm : Bool => Str ;
ampm = table {True => "a.m." ; False => "p.m."} ;
lin
weekdayPunctualAdv w = SyntaxEng.mkAdv on_Prep (mkNP w) ; -- on Sunday
weekdayHabitualAdv w = SyntaxEng.mkAdv on_Prep (mkNP aPl_Det w) ; -- on Sundays
weekdayNextAdv w = SyntaxEng.mkAdv (mkPrep "next") (mkNP w) ; -- next Sunday

View File

@@ -1,11 +1,12 @@
* {"not"} PART neg head
* {"has","had","have","will","would","do","does","did"} AUX aux head
CompAP {"is","are","am","was","been","be"} VERB cop head
CompCN {"is","are","am","was","been","be"} VERB cop head
CompAP {"is","are","am","was","been","be"} VERB cop head
CompAdv {"is","are","am","was","been","be"} VERB cop head
UseV {"not","don't","doesn't","didn't","haven't","hasn't","hadn't","wouldn't","won't"} PART neg head
UseV {"has","had","have","will","would","do","does","did"} AUX aux head
UseComp {"not","don't","doesn't","didn't","haven't","hasn't","hadn't","wouldn't","won't"} PART neg head
UseComp {"has","had","have","will","would","do","does","did"} AUX aux head
UseComp {"is","are","am","was","been","be"} VERB cop head
CompCN {"a","an"} DET det head
ComplVV {"to"} PART mark xcomp
ComplVS {"that"} PART mark xcomp
ComplVS {"not","don't","doesn't","didn't","haven't","hasn't","hadn't","wouldn't","won't"} PART neg head
ComplVS {"has","had","have","will","would","do","does","did"} AUX aux head

View File

@@ -132,7 +132,7 @@ lin
oil_N = regN "oil" ;
old_A = regADeg "old" ;
open_V2 = dirV2 (mkV "open" "opens" "opened" "opened" "opening") ;
paint_V2A = mkV2A (regV "paint") noPrep ;
paint_V2A = mkV2A (regV "paint") ;
paper_N = regN "paper" ;
paris_PN = mkPN (mkN nonhuman (mkN "Paris")) ;
peace_N = regN "peace" ;

View File

@@ -321,7 +321,11 @@ oper
} ;
ingV2V : V -> Prep -> Prep -> V2V ; -- e.g. prevent (noPrep NP) (from VP-ing)
mkVA : V -> VA ; -- e.g. become (AP)
mkV2A : V -> Prep -> V2A ; -- e.g. paint (NP) (AP)
mkV2A : overload {
mkV2A : V -> V2A ; -- e.g. paint (NP) (AP)
mkV2A : V -> Prep -> V2A ; -- backwards compatibility
mkV2A : V -> Prep -> Prep -> V2A ; -- e.g. strike (NP) as (AP)
} ;
mkVQ : V -> VQ ; -- e.g. wonder (QS)
mkV2Q : V -> Prep -> V2Q ; -- e.g. ask (NP) (QS)
@@ -601,7 +605,11 @@ mkInterj : Str -> Interj
ingV2V v p t = lin V2V (prepV2 v p ** {c3 = t.s ; typ = VVPresPart}) ;
mkVA v = lin VA v ;
mkV2A v p = lin V2A (prepV2 v p) ;
mkV2A = overload {
mkV2A : V -> V2A = \v -> lin V2A (dirdirV3 v) ;
mkV2A : V -> Prep -> V2A = \v,p -> lin V2A (dirV3 v p) ;
mkV2A : V -> Prep -> Prep -> V2A = \v,p1,p2 -> lin V2A (prepPrepV3 v p1 p2) ;
} ;
mkV2Q v p = lin V2Q (prepV2 v p) ;
mkAS v = v ;

View File

@@ -1,175 +0,0 @@
--# -path=.:../abstract:../translator
concrete ParseEng of ParseEngAbs =
TenseX - [Pol, PNeg, PPos, SC],
CatEng,
NounEng - [PPartNP],
AdjectiveEng,
NumeralEng,
SymbolEng [PN, Symb, String, CN, Card, NP, MkSymb, SymbPN, CNNumNP],
ConjunctionEng,
VerbEng - [SlashV2V, PassV2, UseCopula, ComplVV, ComplVS],
AdverbEng,
PhraseEng,
SentenceEng - [UseCl], -- replaced by UseCl | ContractedUseCl
QuestionEng,
RelativeEng,
IdiomEng [NP, VP, Tense, Cl, ProgrVP, ExistNP, SelfAdvVP, SelfAdVVP, SelfNP],
ConstructionEng,
DocumentationEng,
ExtraEng [NP, Quant, VPSlash, VP, Tense, GenNP, PassVPSlash, PassAgentVPSlash,
Temp, Pol, Conj, VPS, ListVPS, S, Num, CN, RP, MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS, GenRP,
VPI, VPIForm, VPIInf, VPIPresPart, ListVPI, VV, MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV,
ComplSlashPartLast,
ClSlash, RCl, EmptyRelSlash, VS, V2S, ComplBareVS, SlashBareV2S],
DictionaryEng **
open MorphoEng, ResEng, ParadigmsEng, (G = GrammarEng), (E = ExtraEng), Prelude in {
flags
literal=Symb ;
-- exceptional linearizations
lin
UseCl t p cl = G.UseCl t p cl | E.ContractedUseCl t p cl ;
lin
myself_NP = regNP "myself" singular ;
yourselfSg_NP = regNP "yourself" singular ;
himself_NP = regNP "himself" singular ;
herself_NP = regNP "herself" singular ;
itself_NP = regNP "itself" singular ;
ourselves_NP = regNP "ourselves" plural ;
yourselfPl_NP = regNP "yourself" plural ;
themselves_NP = regNP "themselves" plural ;
CompoundSgCN cn1 cn2 = {
s = \\n,c => cn1.s ! Sg ! Nom ++ cn2.s ! n ! c ;
g = cn2.g
} ;
CompoundPlCN cn1 cn2 = {
s = \\n,c => cn1.s ! Pl ! Nom ++ cn2.s ! n ! c ;
g = cn2.g
} ;
DashSgN n1 n2 = {
s = \\n,c => n1.s ! Sg ! Nom ++ "-" ++ n2.s ! n ! c ;
g = n2.g
} ;
DashPlN n1 n2 = {
s = \\n,c => n1.s ! Pl ! Nom ++ "-" ++ n2.s ! n ! c ;
g = n2.g
} ;
GerundN v = {
s = \\n,c => v.s ! VPresPart ;
g = Neutr
} ;
GerundAP v = {
s = \\agr => v.s ! VPresPart ;
isPre = True
} ;
PastPartAP vp = {
s = \\a => vp.ad ! a ++ vp.ptp ++ vp.p ++ vp.c2 ++ vp.s2 ! a ++ vp.ext ;
isPre = vp.isSimple -- depends on whether there are complements
} ;
OrdCompar a = {s = \\c => a.s ! AAdj Compar c } ;
PositAdVAdj a = {s = a.s ! AAdv} ;
UseQuantPN q pn = {s = \\c => q.s ! False ! Sg ++ pn.s ! npcase2case c ; a = agrgP3 Sg pn.g} ;
SlashV2V v ant p vp = insertObjc (\\a => v.c3 ++ ant.s ++ p.s ++
infVP v.typ vp ant.a p.p a)
(predVc v) ;
SlashSlashV2V v ant p vp = insertObjc (\\a => v.c3 ++ ant.s ++ p.s ++
infVP v.typ vp ant.a p.p a)
(predVc v) ;
SlashVPIV2V v p vpi = insertObjc (\\a => p.s ++
v.c3 ++
vpi.s ! VVAux ! a)
(predVc v) ;
ComplVV v a p vp = insertObj (\\agr => a.s ++ p.s ++
infVP v.typ vp a.a p.p agr)
(predVV v) ;
ComplVS vs s = G.ComplVS vs s | ComplBareVS vs s ;
PredVPosv np vp = {
s = \\t,a,b,o =>
let
verb = vp.s ! t ! a ! b ! o ! np.a ;
compl = vp.s2 ! np.a
in
case o of {
ODir _ => compl ++ frontComma ++ np.s ! npNom ++ verb.aux ++ vp.ad ! np.a ++ verb.fin ++ verb.adv ++ verb.inf ;
OQuest => verb.aux ++ compl ++ frontComma ++ np.s ! npNom ++ verb.adv ++ vp.ad ! np.a ++ verb.fin ++ verb.inf
}
} ;
PredVPovs np vp = {
s = \\t,a,b,o =>
let
verb = vp.s ! t ! a ! b ! o ! np.a ;
compl = vp.s2 ! np.a
in
case o of {
ODir _ => compl ++ frontComma ++ verb.aux ++ verb.adv ++ vp.ad ! np.a ++ verb.fin ++ verb.inf ++ np.s ! npNom ;
OQuest => verb.aux ++ compl ++ verb.adv ++ vp.ad ! np.a ++ verb.fin ++ verb.inf ++ np.s ! npNom
}
} ;
that_RP = {
s = \\_ => "that" ;
a = RNoAg
} ;
who_RP = {
s = \\_ => "who" ;
a = RNoAg
} ;
CompS s = {s = \\_ => "that" ++ s.s} ;
CompQS qs = {s = \\_ => qs.s ! QIndir} ;
CompVP ant p vp = {s = \\a => ant.s ++ p.s ++
infVP VVInf vp ant.a p.p a} ;
VPSlashVS vs vp =
insertObj (\\a => infVP VVInf vp Simul CPos a) (predV vs) **
{c2 = ""; missingAdv = False; gapInMiddle = False} ;
PastPartRS ant pol vps = {
s = \\agr => vps.ad ! agr ++ vps.ptp ++ vps.s2 ! agr ;
c = npNom
} ;
PresPartRS ant pol vp = {
s = \\agr => vp.ad ! agr ++ vp.prp ++ vp.p ++ vp.s2 ! agr;
c = npNom
} ;
ApposNP np1 np2 = {
s = \\c => np1.s ! c ++ frontComma ++ np2.s ! npNom ++ finalComma ;
a = np1.a
} ;
NameCN pn cn = {
s = \\n,c => pn.s ! npcase2case npNom ++ cn.s ! n ! c ;
g = cn.g
} ;
AdAdV = cc2 ;
UttAdV adv = adv;
lin
PPos = {s = [] ; p = CPos} ;
PNeg = {s = [] ; p = CNeg True} | {s = [] ; p = CNeg False} ;
}

View File

@@ -21,7 +21,7 @@ concrete VerbEng of Verb = CatEng ** open ResEng, Prelude in {
SlashV2S v s = insertExtrac (conjThat ++ s.s) (predVc v) ; ---- insertExtra?
--- SlashV2S v s = insertObjc (variants {\\_ => conjThat ++ s.s; \\_ => s.s}) (predVc v) ;
SlashV2Q v q = insertExtrac (q.s ! QIndir) (predVc v) ;
SlashV2A v ap = insertObjc (\\a => ap.s ! a) (predVc v) ; ----
SlashV2A v ap = insertObjc (\\a => v.c3 ++ ap.s ! a) (predVc v) ; ----
ComplSlash vp np =
let vp' = case vp.gapInMiddle of {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -5,54 +5,63 @@ concrete AdjectiveFin of Adjective = CatFin ** open ResFin, StemFin, Prelude in
lin
PositA a = {
PositA a = a ** {
s = \\_ => sAdjFull2nforms Posit a ;
} ;
ComparA a np =
let acomp = sAdjFull2nforms Compar a in {
let acomp = sAdjFull2nforms Compar a in a ** {
s = \\isMod,af => case isMod of {
True => np.s ! NPCase Part ++ acomp ! af ; -- minua isompi
_ => acomp ! af ++ "kuin" ++ np.s ! NPSep -- isompi kuin minä
}
} ;
CAdvAP ad ap np = {
s = \\m,af => ad.s ++ ap.s ! m ! af ++ ad.p ++ np.s ! NPSep
hasPrefix = False
} ;
UseComparA a = {
CAdvAP ad ap np = ap ** {
s = \\m,af => ad.s ++ ap.s ! m ! af ++ ad.p ++ np.s ! NPSep ;
hasPrefix = False
} ;
UseComparA a = a ** {
s = \\_ => sAdjFull2nforms Compar a
} ;
-- $SuperlA$ belongs to determiner syntax in $Noun$.
AdjOrd ord = {
s = \\_ => ord.s
s = \\_ => ord.s ;
p = [] ; hasPrefix = False
} ;
ComplA2 a np = {
s = \\isMod,af =>
preOrPost isMod (appCompl True Pos a.c2 np) (sAdjFull2nforms Posit a ! af)
preOrPost isMod (appCompl True Pos a.c2 np) (sAdjFull2nforms Posit a ! af) ;
p = [] ; hasPrefix = False
} ;
ReflA2 a = {
s = \\isMod,af =>
preOrPost isMod
(appCompl True Pos a.c2 (reflPron (agrP3 Sg))) (sAdjFull2nforms Posit a ! af)
(appCompl True Pos a.c2 (reflPron (agrP3 Sg))) (sAdjFull2nforms Posit a ! af) ;
p = [] ; hasPrefix = False
} ;
SentAP ap sc = {
s = \\b,a => ap.s ! b ! a ++ sc.s
SentAP ap sc = ap ** {
s = \\b,a => ap.s ! b ! a ++ sc.s ;
hasPrefix = False
} ;
AdAP ada ap = {
s = \\b,af => ada.s ++ ap.s ! b ! af
AdAP ada ap = ap ** {
s = \\b,af => ada.s ++ ap.s ! b ! af ;
hasPrefix = False
} ;
AdvAP ap adv = {
s = \\b,af => adv.s ++ ap.s ! b ! af -- luonnostaan vaalea
AdvAP ap adv = ap ** {
s = \\b,af => adv.s ++ ap.s ! b ! af ; -- luonnostaan vaalea
hasPrefix = False
} ;
UseA2 a = {
s = \\_ => sAdjFull2nforms Posit a
s = \\_ => sAdjFull2nforms Posit a ;
p = [] ; hasPrefix = False
} ;
}

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