1
0
forked from GitHub/gf-rgl

Merge remote-tracking branch 'upstream/master' into extendlins

This commit is contained in:
odanoburu
2018-10-29 17:47:18 +00:00
20 changed files with 145 additions and 120 deletions

View File

@@ -99,4 +99,4 @@ for %%m in (%modules%) do (
REM Copy REM Copy
echo Copying to %dest% echo Copying to %dest%
copy %dist% %dest% xcopy %dist% %dest% /d

16
Make.hs
View File

@@ -1,3 +1,7 @@
-- | Main build script for RGL
-- There is no associated cabal file, but these dependencies are known:
-- * directory >= 1.2.3.0
import Data.List (find,isPrefixOf,isSuffixOf,(\\),unfoldr) import Data.List (find,isPrefixOf,isSuffixOf,(\\),unfoldr)
import Data.Maybe (catMaybes) import Data.Maybe (catMaybes)
import System.IO (hPutStrLn,stderr) import System.IO (hPutStrLn,stderr)
@@ -6,7 +10,7 @@ import System.Exit (ExitCode(..),die)
import System.Environment (getArgs,lookupEnv) import System.Environment (getArgs,lookupEnv)
import System.Process (rawSystem) import System.Process (rawSystem)
import System.FilePath ((</>)) -- ,takeFileName,addExtension,dropExtension) import System.FilePath ((</>)) -- ,takeFileName,addExtension,dropExtension)
import System.Directory (createDirectoryIfMissing,copyFile,getDirectoryContents,removeDirectoryRecursive,findFile) import System.Directory (createDirectoryIfMissing,copyFile,getModificationTime,setModificationTime,getDirectoryContents,removeDirectoryRecursive,findFile)
import Control.Monad (when,unless) import Control.Monad (when,unless)
main :: IO () main :: IO ()
@@ -61,14 +65,20 @@ copyOne :: String -> FilePath -> FilePath -> IO ()
copyOne file from to = do copyOne file from to = do
putStrLn $ "Copying [" ++ file ++ "] " ++ to putStrLn $ "Copying [" ++ file ++ "] " ++ to
createDirectoryIfMissing True to createDirectoryIfMissing True to
copyFile (from </> file) (to </> file) copyFileWithModificationTime (from </> file) (to </> file)
-- | Copy all files between directories -- | Copy all files between directories
copyAll :: String -> FilePath -> FilePath -> IO () copyAll :: String -> FilePath -> FilePath -> IO ()
copyAll msg from to = do copyAll msg from to = do
putStrLn $ "Copying [" ++ msg ++ "] " ++ to putStrLn $ "Copying [" ++ msg ++ "] " ++ to
createDirectoryIfMissing True 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
getModificationTime source >>= setModificationTime destination
-- | Remove dist directory -- | Remove dist directory
clean :: IO () clean :: IO ()

View File

@@ -97,4 +97,4 @@ done
# Copy # Copy
echo "Copying to ${dest}" echo "Copying to ${dest}"
cp -R "${dist}"/* "${dest}" cp -R -p "${dist}"/* "${dest}"

View File

@@ -2,7 +2,7 @@
RUNMAKE=runghc Make.hs RUNMAKE=runghc Make.hs
.PHONY: build copy install clean .PHONY: build copy install doc clean
default: build copy default: build copy
@@ -14,5 +14,8 @@ copy:
install: build copy install: build copy
doc: build
make -C doc GF_LIB_PATH=../dist
clean: clean:
$(RUNMAKE) clean $(RUNMAKE) clean

View File

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

View File

@@ -1,56 +1,53 @@
.PHONY: abstract synopsis .PHONY: abstract synopsis index status
all: exx synopsis all: synopsis
GF_alltenses=$(GF_LIB_PATH)/alltenses GF_alltenses=$(GF_LIB_PATH)/alltenses
GF=gf
GFDOC=gfdoc
index: index:
txt2tags -thtml index.txt txt2tags -thtml index.txt
status: status:
txt2tags -thtml status.txt txt2tags -thtml status.txt
synopsis:
synopsis: synopsis.html
S=../src
# List of languages extracted from MkSynopsis.hs
LANGS=Afr Ara 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 Por Ron Rus Snd Spa Swe Tha Urd
# 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=synopsis-intro.txt categories-intro.txt categories-imagemap.html synopsis-additional.txt synopsis-browse.txt synopsis-example.txt
synopsis.html: MkSynopsis.hs MkExxTable.hs $(INCLUDES) $(EXAMPLES_OUT) $(SRC_FILES)
runghc MkSynopsis.hs runghc MkSynopsis.hs
categories.png: categories.dot
dot -Tpng $^ > $@
categories-imagemap.html: categories.dot categories-imagemap.html: categories.dot
dot -Tcmapx $^ > $@ dot -Tcmapx $^ > $@
abstract: abstract:
gfdoc -txthtml ../src/abstract/*.gf $(GFDOC) -txthtml $S/abstract/*.gf
mv ../src/abstract/*.html abstract mv $S/abstract/*.html abstract
exx-script:
runghc MkExx.hs <api-examples.txt >api-examples.gfs api-examples.gfs: api-examples.txt MkExx.hs
exx: exx-script runghc MkExx.hs < $< > $@
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 # Since .gfo files aren't self-contained, the dependencies given here are
gf -retain -s $(GF_alltenses)/TryChi.gfo <api-examples.gfs >api-examples-Chi.txt # incomplete. But I am thinking that the Try%.gfo file will always be newer
gf -retain -s $(GF_alltenses)/TryDan.gfo <api-examples.gfs >api-examples-Dan.txt # than any other files it depends on, so the rule will trigger when
gf -retain -s $(GF_alltenses)/TryDut.gfo <api-examples.gfs >api-examples-Dut.txt # needed anyway. //TH 2018-10-22
gf -retain -s $(GF_alltenses)/TryEng.gfo <api-examples.gfs >api-examples-Eng.txt api-examples-%.txt: $(GF_alltenses)/Try%.gfo api-examples.gfs
gf -retain -s $(GF_alltenses)/TryEst.gfo <api-examples.gfs >api-examples-Est.txt GF_LIB_PATH=$(GF_LIB_PATH) $(GF) -retain -s $< <api-examples.gfs >$@
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 clean:
gf -retain -s $(GF_alltenses)/TryFre.gfo <api-examples.gfs >api-examples-Fre.txt rm -rf synopsis.txt api-examples.gfs $(EXAMPLES_OUT)
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

View File

@@ -52,6 +52,7 @@ langsCoding = [
(("norwegian","Nor"),"Scand"), (("norwegian","Nor"),"Scand"),
(("polish", "Pol"),""), (("polish", "Pol"),""),
(("punjabi", "Pnb"),""), (("punjabi", "Pnb"),""),
(("portuguese", "Por"), "Romance"),
(("romanian", "Ron"),""), (("romanian", "Ron"),""),
(("russian", "Rus"),""), (("russian", "Rus"),""),
(("spanish", "Spa"),"Romance"), (("spanish", "Spa"),"Romance"),

View File

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

View File

@@ -1,6 +1,6 @@
import MkExxTable import MkExxTable
import System.Cmd import System.Process(system)
import System.Environment import System.Environment(getArgs)
import Data.Char import Data.Char
import Data.List import Data.List
import qualified Data.ByteString.Char8 as BS import qualified Data.ByteString.Char8 as BS
@@ -16,10 +16,10 @@ synopsis = "synopsis.txt"
-- the language in which revealed examples are shown -- the language in which revealed examples are shown
revealedLang = "Eng" revealedLang = "Eng"
-- all languages shown -- all languages shown (a copy of this list appears in Makefile)
apiExxFiles = ["api-examples-" ++ lang ++ ".txt" | lang <- words apiExxFiles = ["api-examples-" ++ lang ++ ".txt" | lang <- words
-- "Eng Chi" -- "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" "Afr Ara 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 Por Ron Rus Snd Spa Swe Tha Urd"
] ]
main = do main = do
@@ -244,6 +244,7 @@ syntaxAPI = srcPath "/api/Constructors.gf"
structuralAPI = srcPath "/abstract/Structural.gf" structuralAPI = srcPath "/abstract/Structural.gf"
paradigmFiles = [ paradigmFiles = [
("Afrikaans", srcPath "/afrikaans/ParadigmsAfr.gf"), ("Afrikaans", srcPath "/afrikaans/ParadigmsAfr.gf"),
("Arabic", srcPath "/arabic/ParadigmsAra.gf"),
("Basque", srcPath "/basque/ParadigmsEus.gf"), ("Basque", srcPath "/basque/ParadigmsEus.gf"),
("Bulgarian", srcPath "/bulgarian/ParadigmsBul.gf"), ("Bulgarian", srcPath "/bulgarian/ParadigmsBul.gf"),
("Catalan", srcPath "/catalan/ParadigmsCat.gf"), ("Catalan", srcPath "/catalan/ParadigmsCat.gf"),
@@ -269,6 +270,7 @@ paradigmFiles = [
("Nynorsk", srcPath "/nynorsk/ParadigmsNno.gf"), ("Nynorsk", srcPath "/nynorsk/ParadigmsNno.gf"),
("Polish", srcPath "/polish/ParadigmsPol.gf"), ("Polish", srcPath "/polish/ParadigmsPol.gf"),
("Punjabi", srcPath "/punjabi/ParadigmsPnb.gf"), ("Punjabi", srcPath "/punjabi/ParadigmsPnb.gf"),
("Portuguese", srcPath "/portuguese/ParadigmsPor.gf"),
("Romanian", srcPath "/romanian/ParadigmsRon.gf"), ("Romanian", srcPath "/romanian/ParadigmsRon.gf"),
("Russian", srcPath "/russian/ParadigmsRus.gf"), ("Russian", srcPath "/russian/ParadigmsRus.gf"),
("Sindhi", srcPath "/sindhi/ParadigmsSnd.gf"), ("Sindhi", srcPath "/sindhi/ParadigmsSnd.gf"),

View File

@@ -24,6 +24,9 @@ table { border-collapse: collapse; }
td, th { padding: 5px; } td, th { padding: 5px; }
th { background: #9df; } th { background: #9df; }
td { background: white } 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 */ /* Quick links */

View File

@@ -1,15 +1,14 @@
Versions: [3.9 ./synopsis-v3.9.html] | latest (this one)
=Introduction= =Introduction=
The GF Resource Grammar Library is the standard library for Grammatical Framework. The GF Resource Grammar Library is the standard library for Grammatical Framework.
It covers the morphology and basic syntax of currently 32 languages: It covers the morphology and basic syntax of currently 34 languages:
Afrikaans, Afrikaans,
Arabic,
Bulgarian, Bulgarian,
Catalan, Catalan,
Chinese (simplified), Chinese (simplified),
@@ -33,6 +32,7 @@ Norwegian (bokmål),
Norwegial (nynorsk), Norwegial (nynorsk),
Persian, Persian,
Polish, Polish,
Portuguese,
Punjabi, Punjabi,
Romanian, Romanian,
Russian, Russian,
@@ -54,13 +54,13 @@ The main contents are:
constructing trees in them. constructing trees in them.
- [Chapter 2 #toc5]: syntactic construction functions, with cross-links and - [Chapter 2 #toc5]: syntactic construction functions, with cross-links and
examples. examples.
- [Chapter 3 #toc84]: morphological paradigms. - [Chapter 3 #toc85]: morphological paradigms.
- [Chapter 4 #toc116]: additional libraries. - [Chapter 4 #toc120]: additional libraries.
- [Chapter 5 #toc122]: how to "browse" the library by - [Chapter 5 #toc126]: how to "browse" the library by
loading the grammars into the ``gf`` command editor. 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. use the resource modules.
- [Detailed table of contents #toc124]. - [Detailed table of contents #toc128].
Other relevant documents: Other relevant documents:

View File

@@ -5,26 +5,28 @@ flags optimize=noexpand ;
lin lin
DetCN det cn = let { DetCN det cn = let {
cas : Case -> Case = if_then_else Case det.is1sg Bare ;
number = sizeToNumber det.n ; number = sizeToNumber det.n ;
state = possState det.d;
determiner : Case -> Str = \c -> determiner : Case -> Str = \c ->
det.s ! cn.h ! (detGender cn.g det.n) ! c ; det.s ! cn.h ! (detGender cn.g det.n) ! c ;
noun : Case -> NTable -> Str = \c,nt -> noun : Case -> Str = \c ->
let cas = if_then_else Case det.is1sg Bare c -- no case vowel with 1sg poss. suff. cn.s ! number
in nt ! number
! nounState det.d number ! nounState det.d number
! nounCase cas det.n det.d ! nounCase c det.n det.d ;
adj : Case -> Str = \c ->
cn.adj ! number
! (definite ! det.d) -- Indef remains Indef, rest become Def
! c
} in { } in {
s = \\c => s = \\c =>
case cnB4det det.isPron det.isNum det.n det.d of { case cnB4det det.isPron det.isNum det.n det.d of {
False => determiner c False => determiner c
++ noun c cn.s -- deal with poss. suffix ++ noun c
++ cn.adj ! number ! state ! c -- normal case+state ++ adj c
++ cn.np ! c ; ++ cn.np ! c ;
True => noun c cn.s -- deal with poss. suffix True => noun (cas c) -- deal with possessive suffix
-- ++ determiner c -- or this? ++ determiner c
++ det.s ! cn.h ! cn.g ! c ++ adj c
++ cn.adj ! number ! state ! c -- normal case+state
++ cn.np ! c ++ cn.np ! c
}; };
a = { pgn = agrP3 cn.h cn.g number; a = { pgn = agrP3 cn.h cn.g number;
@@ -45,23 +47,20 @@ lin
}; };
a = np.a a = np.a
} ; } ;
{- {-
--should compile.. not working :( wierd error message.. bug?
PPartNP np v2 = PPartNP np v2 =
let x = case np.a.pgn of { let x = case np.a.pgn of {
Per3 g n => ( positAdj (v2.s ! VPPart) ) ! g ! n ! Indef ; Per3 g n => positAdj (v2.s ! VPPart) ) ! g ! n ! Indef ; -- doesn't work because trying to glue runtime tokens
_ => \\_ => [] -- not occuring anyway Per2 g n => \\_ => [] ;
} in { _ => \\_ => []
s = \\c => np.s ! c ++ x ! c ; } in np ** {
a = np.a s = \\c => np.s ! c ++ v2.s ! VPPart ---- TODO: agreement
}; };
-} -}
-- FIXME try parsing something like "this house now" and you'll get AdvNP np adv = np ** {
-- an internal compiler error, but it still works.. wierd.. s = \\c => np.s ! c ++ adv.s
AdvNP np adv = {
s = \\c => np.s ! c ++ adv.s;
a = np.a
}; };
{- {-
DetSg quant ord = { DetSg quant ord = {
@@ -104,7 +103,7 @@ lin
PossPron p = { PossPron p = {
s = \\_,_,_,_ => p.s ! Gen; s = \\_,_,_,_ => p.s ! Gen;
d = Poss; d = Poss;
is1sg = case p.a.pgn of { Per1 _ => True ; _ => False } ; is1sg = case p.a.pgn of { Per1 Sing => True ; _ => False } ;
isPron = True; isPron = True;
isNum = False } ; isNum = False } ;

View File

@@ -435,8 +435,8 @@ resource ParadigmsAra = open
mkPron : (_,_,_ : Str) -> PerGenNum -> NP = \ana,nI,I,pgn -> mkPron : (_,_,_ : Str) -> PerGenNum -> NP = \ana,nI,I,pgn ->
{ s = { s =
table { table {
Acc => nI; Acc => BIND ++ nI; -- object suffix
Gen => I; Gen => BIND ++ I; -- possessive suffix
_ => ana _ => ana
}; };
a = {pgn = pgn; isPron = True }; a = {pgn = pgn; isPron = True };

View File

@@ -48,8 +48,6 @@ resource ResAra = PatternsAra ** open Prelude, Predef, OrthoAra, ParamX in {
--for roots with 2 consonants (works also for assimilated strs, like fc~, --for roots with 2 consonants (works also for assimilated strs, like fc~,
--because the function discards anything after the first two characters --because the function discards anything after the first two characters
mkRoot2 : Str -> Root2 = \fcl -> mkRoot2 : Str -> Root2 = \fcl ->
-- let { cl = drop 2 fcl} in --drop 1 fcl
-- {f = take 2 fcl; c = take 2 cl}; --take 1
case fcl of { case fcl of {
f@? + c@? + _ => { f = f ; c = c } ; f@? + c@? + _ => { f = f ; c = c } ;
_ => error ("mkRoot2: too short root" ++ fcl) _ => error ("mkRoot2: too short root" ++ fcl)
@@ -138,7 +136,7 @@ resource ResAra = PatternsAra ** open Prelude, Predef, OrthoAra, ParamX in {
VPerf Voice PerGenNum VPerf Voice PerGenNum
| VImpf Mood Voice PerGenNum | VImpf Mood Voice PerGenNum
| VImp Gender Number | VImp Gender Number
| VPPart ; | VPPart ; -- TODO: add gender and number (or check if easy to use BIND)
PerGenNum = PerGenNum =
Per3 Gender Number Per3 Gender Number
@@ -956,7 +954,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
--dual suffixes --dual suffixes
dl : State => Case => Str = dl : State => Case => Str =
table { table {
Const => (Const|Poss) =>
table { table {
Nom => "َا"; Nom => "َا";
_ => "َيْ" _ => "َيْ"
@@ -972,7 +970,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
--sound masculine plural suffixes --sound masculine plural suffixes
m_pl : State => Case => Str = m_pl : State => Case => Str =
table { table {
Const => (Const|Poss) =>
table { table {
Nom => "ُو"; Nom => "ُو";
_ => "ِي" _ => "ِي"
@@ -1045,9 +1043,6 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
_ => Def --Lkitaabu _ => Def --Lkitaabu
}; };
possState : State -> State = \s ->
case s of { Poss => Def ;
x => x } ;
--FIXME needs testing --FIXME needs testing
nounCase : Case -> Size -> State -> Case = nounCase : Case -> Size -> State -> Case =
\c,size,s -> \c,size,s ->
@@ -1271,7 +1266,10 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
mkNum : Str -> Str -> Str -> mkNum : Str -> Str -> Str ->
{s : DForm => CardOrd => Gender => State => Case => Str} = {s : DForm => CardOrd => Gender => State => Case => Str} =
\wAhid,awwal,Ula -> \wAhid,awwal,Ula ->
let { wAhida = wAhid + "َة"} in let wAhida : Str = case wAhid of {
x + "ة" => mkAt wAhid ;
_ => wAhid + "َة" }
in
{ s= table { { s= table {
unit => table { unit => table {
NCard => table { NCard => table {

View File

@@ -43,9 +43,9 @@ concrete StructuralAra of Structural = CatAra **
-- how8many_IDet = mkDet "كَمْ" Pl Const ; -- IL: check (was ["هْو مَني"]) ; -- how8many_IDet = mkDet "كَمْ" Pl Const ; -- IL: check (was ["هْو مَني"]) ;
-- if_Subj = ss "ِف" ; -- if_Subj = ss "ِف" ;
in8front_Prep = ss "مُقَابِلَ" ; in8front_Prep = ss "مُقَابِلَ" ;
i_Pron = mkPron "أَنَا" "نِي" "ِي" (Per1 Sing); i_Pron = mkPron "أَنَا" "نِي" "ي" (Per1 Sing);
in_Prep = ss "فِي" ; in_Prep = ss "فِي" ;
it_Pron = mkPron "ِت" "ِت" "ِتس" (Per3 Masc Sg); -- IL: check it_Pron = he_Pron ; -- was: it_Pron = mkPron "ِت" "ِت" "ِتس" (Per3 Masc Sg);
-- less_CAdv = ss "لسّ" ; -- less_CAdv = ss "لسّ" ;
many_Det = mkDet "جَمِيع" Pl Const ; many_Det = mkDet "جَمِيع" Pl Const ;
-- more_CAdv = ss "مْري" ; -- more_CAdv = ss "مْري" ;

View File

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

View File

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

View File

@@ -321,7 +321,11 @@ oper
} ; } ;
ingV2V : V -> Prep -> Prep -> V2V ; -- e.g. prevent (noPrep NP) (from VP-ing) ingV2V : V -> Prep -> Prep -> V2V ; -- e.g. prevent (noPrep NP) (from VP-ing)
mkVA : V -> VA ; -- e.g. become (AP) 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) mkVQ : V -> VQ ; -- e.g. wonder (QS)
mkV2Q : V -> Prep -> V2Q ; -- e.g. ask (NP) (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}) ; ingV2V v p t = lin V2V (prepV2 v p ** {c3 = t.s ; typ = VVPresPart}) ;
mkVA v = lin VA v ; 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) ; mkV2Q v p = lin V2Q (prepV2 v p) ;
mkAS v = v ; mkAS v = v ;

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 = insertExtrac (conjThat ++ s.s) (predVc v) ; ---- insertExtra?
--- SlashV2S v s = insertObjc (variants {\\_ => conjThat ++ s.s; \\_ => s.s}) (predVc v) ; --- SlashV2S v s = insertObjc (variants {\\_ => conjThat ++ s.s; \\_ => s.s}) (predVc v) ;
SlashV2Q v q = insertExtrac (q.s ! QIndir) (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 = ComplSlash vp np =
let vp' = case vp.gapInMiddle of { let vp' = case vp.gapInMiddle of {