forked from GitHub/gf-rgl
Compare commits
427 Commits
build-acti
...
eleven-nor
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5dde3189e3 | ||
|
|
2340a98507 | ||
|
|
67d5bb9714 | ||
|
|
96717e5785 | ||
|
|
c5606ff55d | ||
|
|
fc1ca4b8f1 | ||
|
|
d953c0f503 | ||
|
|
5645134aa3 | ||
|
|
34300d68bb | ||
|
|
d49405b405 | ||
|
|
c86481df61 | ||
|
|
ff54d2e7ad | ||
|
|
018fe16e2b | ||
|
|
14d090b15f | ||
|
|
04fb507c9a | ||
|
|
1e73c0b2c7 | ||
|
|
40b28cf858 | ||
|
|
9cdb7ec37b | ||
|
|
a6cfe58398 | ||
|
|
81218506d9 | ||
|
|
3bcb34559e | ||
|
|
4beacc0f64 | ||
|
|
444bf51e09 | ||
|
|
9cfc36fc73 | ||
|
|
607f4d68ae | ||
|
|
7fc42192d7 | ||
|
|
43fbf928fd | ||
|
|
afe76e1fe0 | ||
|
|
728bb1faf9 | ||
|
|
df93a21d79 | ||
|
|
de2989d7c6 | ||
|
|
529f315c7a | ||
|
|
1379ba6c77 | ||
|
|
d3de861e86 | ||
|
|
1b5840c89d | ||
|
|
e4a195a777 | ||
|
|
865dadbc64 | ||
|
|
4fec15272c | ||
|
|
ad34d3f209 | ||
|
|
41de2cc021 | ||
|
|
d43be53e18 | ||
|
|
f2c1fede4f | ||
|
|
ef771d62fa | ||
|
|
33ce949606 | ||
|
|
0502797cb0 | ||
|
|
9fe3ffce2b | ||
|
|
08dfe78f2f | ||
|
|
4a2a556162 | ||
|
|
8a87dc210c | ||
|
|
d48cf92359 | ||
|
|
d5e5edb02f | ||
|
|
3026b8b59a | ||
|
|
c4f39c0a74 | ||
|
|
ddf6d0d30d | ||
|
|
4c03a40aef | ||
|
|
8073d2a91b | ||
|
|
6421fb7ee9 | ||
|
|
149407d19b | ||
|
|
20275832ad | ||
|
|
02d3752a26 | ||
|
|
bec96b267d | ||
|
|
6f3a72aa1d | ||
|
|
b7363f9219 | ||
|
|
5c84ce9623 | ||
|
|
edcef16eb1 | ||
|
|
08ac422d9a | ||
|
|
a6e0875878 | ||
|
|
a9c18fc48c | ||
|
|
85960e0416 | ||
|
|
cff79f72c5 | ||
|
|
c712efc8eb | ||
|
|
3e79ab25e1 | ||
|
|
a1c85431be | ||
|
|
967a8fb8a1 | ||
|
|
2418e8cfcf | ||
|
|
5a8eda803d | ||
|
|
bcd7a09864 | ||
|
|
7dd63173f2 | ||
|
|
a59ed0e0e2 | ||
|
|
e80cd82870 | ||
|
|
ee5c842972 | ||
|
|
4e204d66a8 | ||
|
|
0bae53b0b9 | ||
|
|
b2cc67aef5 | ||
|
|
21259015e0 | ||
|
|
e06c3433b9 | ||
|
|
5eb333ce6a | ||
|
|
41d4b7fabd | ||
|
|
46509b93a3 | ||
|
|
cb016ea750 | ||
|
|
58255b27bf | ||
|
|
ccdc04992e | ||
|
|
06593c5fb9 | ||
|
|
c9ee6f3d82 | ||
|
|
9f3b45bf48 | ||
|
|
86fca40ac2 | ||
|
|
f58d0358cc | ||
|
|
c80899e07e | ||
|
|
f67c3ec838 | ||
|
|
f1e14bbd5f | ||
|
|
263ee4319d | ||
|
|
783e2f3831 | ||
|
|
91b0578221 | ||
|
|
8b05843585 | ||
|
|
d14de723d0 | ||
|
|
bc206fcbfe | ||
|
|
d35a709eb7 | ||
|
|
0245dc2d59 | ||
|
|
7fe4fd01f5 | ||
|
|
184497284d | ||
|
|
9400e0ed21 | ||
|
|
bf213bf77e | ||
|
|
828ea2545c | ||
|
|
4db945a500 | ||
|
|
83fed4e812 | ||
|
|
65ddced771 | ||
|
|
c0daf6d0ba | ||
|
|
f9a633ea52 | ||
|
|
5aff25b37f | ||
|
|
95bc972f44 | ||
|
|
bd060578d6 | ||
|
|
e853942d43 | ||
|
|
cc4aef88f9 | ||
|
|
27073a6c0c | ||
|
|
8495ed2f06 | ||
|
|
e1130eb279 | ||
|
|
40caeea67f | ||
|
|
dd5b34492a | ||
|
|
cf9e2cdd7f | ||
|
|
42a6de9803 | ||
|
|
5679eeb1fb | ||
|
|
dd05feeac0 | ||
|
|
916cca5d22 | ||
|
|
613a159591 | ||
|
|
79ea965fc4 | ||
|
|
facd4727cf | ||
|
|
0d4b92a006 | ||
|
|
8b876cf74c | ||
|
|
8b14dcf6ba | ||
|
|
4e8ff8e7fd | ||
|
|
76f23214c1 | ||
|
|
e8503511ca | ||
|
|
b1b752673d | ||
|
|
219de4ca9a | ||
|
|
31c31b3e69 | ||
|
|
983274d239 | ||
|
|
0aaa38e051 | ||
|
|
1f7e16642b | ||
|
|
0e8ac21976 | ||
|
|
b8ddf4304b | ||
|
|
a72600b27c | ||
|
|
b3d1ccbc40 | ||
|
|
5eafffb8fe | ||
|
|
61cb94443a | ||
|
|
7778e6138c | ||
|
|
ffd1f28b42 | ||
|
|
1d033679f2 | ||
|
|
bf33191c88 | ||
|
|
9fa07fb22d | ||
|
|
4df65b593e | ||
|
|
0c659deae3 | ||
|
|
5e308e7aa7 | ||
|
|
e0b4d6940a | ||
|
|
57e6f8f244 | ||
|
|
5c415fc913 | ||
|
|
57490c18d2 | ||
|
|
fe5c124602 | ||
|
|
7f58e8ec8b | ||
|
|
460ec475bd | ||
|
|
4e947e4ce8 | ||
|
|
0dbb5e4ee8 | ||
|
|
734d000b4d | ||
|
|
bbf109a473 | ||
|
|
3aefd51280 | ||
|
|
5f8a21dc08 | ||
|
|
b7b4c08e8a | ||
|
|
92bfa85a49 | ||
|
|
9a6301691d | ||
|
|
1b02447b44 | ||
|
|
565cd8fa61 | ||
|
|
b26e6e1c9f | ||
|
|
e4e304d551 | ||
|
|
33ffc1db48 | ||
|
|
88ae0d5093 | ||
|
|
066a9f6170 | ||
|
|
ce9618b945 | ||
|
|
336c297dc1 | ||
|
|
45d47afc36 | ||
|
|
d021ebd527 | ||
|
|
a435b6b8dc | ||
|
|
4720114c84 | ||
|
|
475d0fb860 | ||
|
|
c2551f5766 | ||
|
|
0c52f9cbed | ||
|
|
83a59f2757 | ||
|
|
c8862b8ed8 | ||
|
|
0ee84ddb7d | ||
|
|
7da1cc310b | ||
|
|
c81edf3fbb | ||
|
|
4c1ff7b3a2 | ||
|
|
8a95b3ffa9 | ||
|
|
021e6e6509 | ||
|
|
bf0e3a58dd | ||
|
|
1a3b3ef796 | ||
|
|
0c55010376 | ||
|
|
a1a5f84708 | ||
|
|
a310e38904 | ||
|
|
4212850c9e | ||
|
|
a71333fc0e | ||
|
|
bcd46433d1 | ||
|
|
0190fe2943 | ||
|
|
43a02443bb | ||
|
|
90a44af861 | ||
|
|
93c78de1f1 | ||
|
|
c4f7875d6a | ||
|
|
ba694f03e8 | ||
|
|
a0d397bed4 | ||
|
|
b8a1a72cca | ||
|
|
23493335bb | ||
|
|
be36e65343 | ||
|
|
97553b080b | ||
|
|
6131fdb41f | ||
|
|
1e761ede38 | ||
|
|
7f9a4dce2b | ||
|
|
049bd8943e | ||
|
|
f09de4661e | ||
|
|
5a5adef0db | ||
|
|
eb7b74578f | ||
|
|
4af32f3570 | ||
|
|
f0b5a89fd4 | ||
|
|
9d56ac6fee | ||
|
|
a181ab36a4 | ||
|
|
2f10c2d769 | ||
|
|
664164e8c1 | ||
|
|
83a16737dc | ||
|
|
7704f6a18c | ||
|
|
4a892e646c | ||
|
|
0abf88324e | ||
|
|
6459c07548 | ||
|
|
c61fe0c314 | ||
|
|
93999cd21e | ||
|
|
984c8deb34 | ||
|
|
1d32508312 | ||
|
|
447926a2ec | ||
|
|
2dd8faaea7 | ||
|
|
7c1de7ba23 | ||
|
|
4054fec0d0 | ||
|
|
e552ceb71d | ||
|
|
82a74d84be | ||
|
|
3770caad33 | ||
|
|
f9dc1695ca | ||
|
|
b086b774bf | ||
|
|
4394c8f979 | ||
|
|
7daf14378d | ||
|
|
27925cd4ce | ||
|
|
7dd56dbb53 | ||
|
|
0eb77f5291 | ||
|
|
32ac7b5fe3 | ||
|
|
373079cf4c | ||
|
|
d97b1ebbce | ||
|
|
a33768ad1a | ||
|
|
b352dcb1a0 | ||
|
|
8a66158961 | ||
|
|
da7309e6b5 | ||
|
|
38cdfc8efe | ||
|
|
99469eeb54 | ||
|
|
258cd95cca | ||
|
|
445c4f5187 | ||
|
|
b8acdddabd | ||
|
|
3c27bbd125 | ||
|
|
354990319d | ||
|
|
ef3270ae29 | ||
|
|
88d0217d10 | ||
|
|
5281c3ba71 | ||
|
|
b696b9e932 | ||
|
|
9620c738c5 | ||
|
|
e421518a36 | ||
|
|
47ea6a6830 | ||
|
|
57390d366c | ||
|
|
862c50e936 | ||
|
|
3d703856a6 | ||
|
|
93945265b8 | ||
|
|
1cc58f5048 | ||
|
|
e85efec7a5 | ||
|
|
62488a2980 | ||
|
|
74b7171842 | ||
|
|
6e6b7b09ad | ||
|
|
c1e12b60ab | ||
|
|
fdc28dfd8a | ||
|
|
e122aea3ad | ||
|
|
c79c113e01 | ||
|
|
d3dd3d668c | ||
|
|
d1322ea14d | ||
|
|
1c98bc22f6 | ||
|
|
2205d5c91c | ||
|
|
ec9dcb92bf | ||
|
|
7f032c511f | ||
|
|
00a72f907b | ||
|
|
afc299308c | ||
|
|
5b28e621b3 | ||
|
|
8208485f48 | ||
|
|
014c3569eb | ||
|
|
20483a23b1 | ||
|
|
61ffe8e9a4 | ||
|
|
bc0fb02f20 | ||
|
|
0e065d8005 | ||
|
|
7927fdae85 | ||
|
|
eaf401eda7 | ||
|
|
6d781d3d02 | ||
|
|
f2cf027f55 | ||
|
|
eafa5e8f7a | ||
|
|
095f11abb7 | ||
|
|
53eb8ab9df | ||
|
|
c98f9a84d8 | ||
|
|
6693a27d6c | ||
|
|
4f821ca621 | ||
|
|
1853365942 | ||
|
|
848e3e5ceb | ||
|
|
ee86e2390c | ||
|
|
decdfac926 | ||
|
|
bd8550b652 | ||
|
|
cb502488d1 | ||
|
|
da443a79af | ||
|
|
7da28a09be | ||
|
|
2f379bf9c6 | ||
|
|
45e99c5e40 | ||
|
|
c4d72d1bae | ||
|
|
969559b45b | ||
|
|
70eee40ae8 | ||
|
|
60533ef002 | ||
|
|
a3701d1a48 | ||
|
|
b6f37abe91 | ||
|
|
0ee2377c99 | ||
|
|
ace36f7129 | ||
|
|
e3c6694019 | ||
|
|
9275d5e720 | ||
|
|
d2d841e949 | ||
|
|
ee34115ce4 | ||
|
|
e7f620fc60 | ||
|
|
7c79aae07f | ||
|
|
0a84fbaf5d | ||
|
|
f9ad041ac1 | ||
|
|
8af91c8836 | ||
|
|
27b39f3431 | ||
|
|
4f70384664 | ||
|
|
38d852a5bb | ||
|
|
7c4546f3c3 | ||
|
|
a0ad410692 | ||
|
|
7fbcb60b87 | ||
|
|
73050c74a1 | ||
|
|
71d7de2577 | ||
|
|
2ade51ecff | ||
|
|
eb50c5a9e3 | ||
|
|
29af125799 | ||
|
|
cc75637704 | ||
|
|
310e143bea | ||
|
|
0b63fb7a69 | ||
|
|
0e5450e792 | ||
|
|
5a2b25ff25 | ||
|
|
7396ed93f7 | ||
|
|
bfa64d477d | ||
|
|
9d657a6f24 | ||
|
|
156e193d47 | ||
|
|
adb1cffb75 | ||
|
|
617cb25f1e | ||
|
|
85282418a7 | ||
|
|
632d4e2ff1 | ||
|
|
b3cc234c14 | ||
|
|
af36eaf077 | ||
|
|
4d3f5be892 | ||
|
|
431ff47824 | ||
|
|
ce08eaf14b | ||
|
|
1ddfe0ac26 | ||
|
|
8bbdfecb26 | ||
|
|
069804581b | ||
|
|
6bf2555a4a | ||
|
|
cb8cc63528 | ||
|
|
8acb3331d1 | ||
|
|
868ea0fc0c | ||
|
|
1131058b68 | ||
|
|
6bbb0e2487 | ||
|
|
ac8322f907 | ||
|
|
e2746d8b81 | ||
|
|
0adc3845e3 | ||
|
|
6e95fbbbb9 | ||
|
|
1dc1530b20 | ||
|
|
89b38c13d4 | ||
|
|
6d1d9d17d1 | ||
|
|
de405c7929 | ||
|
|
fe28bea8ec | ||
|
|
4e39ada69b | ||
|
|
88b3974bee | ||
|
|
9d75eebcc0 | ||
|
|
9d0555f8b8 | ||
|
|
fe45b7ed5c | ||
|
|
f55f5b2d3c | ||
|
|
891bd2f3b1 | ||
|
|
8696b27bee | ||
|
|
4b171129a1 | ||
|
|
ee2bfe6014 | ||
|
|
2bb3630f00 | ||
|
|
24bc84627b | ||
|
|
da1767b18a | ||
|
|
94341f57f9 | ||
|
|
f59a706d45 | ||
|
|
349e537104 | ||
|
|
2b46848d3f | ||
|
|
3836bc2df5 | ||
|
|
c55592cea6 | ||
|
|
ec159d05d4 | ||
|
|
8768dd92f1 | ||
|
|
14338be99a | ||
|
|
f6b44aa57e | ||
|
|
e7fcae8680 | ||
|
|
6740b37cfc | ||
|
|
4c330b7d62 | ||
|
|
eb6a4da33c | ||
|
|
0b1149d509 | ||
|
|
24b94cdeac | ||
|
|
df4ba9eb96 | ||
|
|
8dc5daf664 | ||
|
|
feac50919b | ||
|
|
6fee9d712a | ||
|
|
2f3146441b | ||
|
|
9594ee9cf2 | ||
|
|
eeec3d998e | ||
|
|
0c65539e0c |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,3 +4,4 @@ dist/
|
||||
*.o
|
||||
*.pgf
|
||||
*.tmp
|
||||
*~
|
||||
|
||||
@@ -4,7 +4,7 @@ language: c
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
- windows
|
||||
# - windows
|
||||
|
||||
addons:
|
||||
apt:
|
||||
|
||||
30
Makefile
30
Makefile
@@ -1,16 +1,32 @@
|
||||
# A simple wrapper over the Haskell-based RGL build script
|
||||
# A wrapper over the Haskell and Bash build scripts
|
||||
# Will try and fallback in order:
|
||||
# - runghc Setup.hs
|
||||
# - stack runghc Setup.hs
|
||||
# - ./Setup.sh
|
||||
|
||||
RUNMAKE=runghc Setup.hs
|
||||
ifneq (, $(shell which runghc))
|
||||
RUNGHC=runghc Setup.hs
|
||||
else ifneq (, $(shell which stack))
|
||||
RUNGHC=stack runghc Setup.hs
|
||||
else
|
||||
RUNGHC=
|
||||
endif
|
||||
|
||||
.PHONY: build copy install doc clean
|
||||
|
||||
default: build copy
|
||||
|
||||
build: src/*/*.gf
|
||||
$(RUNMAKE) build
|
||||
ifneq (, $(RUNGHC))
|
||||
$(RUNGHC) build
|
||||
else
|
||||
./Setup.sh
|
||||
endif
|
||||
|
||||
copy:
|
||||
$(RUNMAKE) copy
|
||||
ifneq (, $(RUNGHC))
|
||||
$(RUNGHC) copy
|
||||
endif
|
||||
|
||||
install: build copy
|
||||
|
||||
@@ -18,4 +34,8 @@ doc: build
|
||||
make -C doc GF_LIB_PATH=../dist
|
||||
|
||||
clean:
|
||||
$(RUNMAKE) clean
|
||||
ifneq (, $(RUNGHC))
|
||||
$(RUNGHC) clean
|
||||
else
|
||||
rm -r dist
|
||||
endif
|
||||
|
||||
19
README.md
19
README.md
@@ -2,8 +2,6 @@
|
||||
|
||||
# GF Resource Grammar Library (RGL)
|
||||
|
||||
[](https://travis-ci.org/GrammaticalFramework/gf-rgl)
|
||||
|
||||
The GF Resource Grammar Library is the standard library for Grammatical Framework. It covers the morphology and basic syntax of over 30 languages.
|
||||
|
||||
For more about the RGL, see the [synopsis page](http://www.grammaticalframework.org/lib/doc/synopsis/).
|
||||
@@ -47,12 +45,7 @@ This file should be kept up-to-date and all build methods should read this confi
|
||||
|
||||
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: `Setup.hs`
|
||||
|
||||
This build method gives you most options.
|
||||
You will need Haskell installed on your system.
|
||||
|
||||
### Basic
|
||||
## Using Make
|
||||
|
||||
If you have `Make` installed and don't care about advanced settings,
|
||||
you can compile the RGL and install it to the default location with:
|
||||
@@ -64,9 +57,15 @@ make install
|
||||
This is the same as `make build` followed by `make copy`.
|
||||
There is also `make clean` available.
|
||||
|
||||
### Advanced
|
||||
The Makefile will try to use the Haskell install script,
|
||||
falling back to the shell script if you do not have Haskell installed.
|
||||
|
||||
For more fine-grained control over the build process, you can run the build script directly:
|
||||
## Haskell script: `Setup.hs`
|
||||
|
||||
This build method gives you most options.
|
||||
You will need Haskell installed on your system.
|
||||
|
||||
Run the build script with:
|
||||
|
||||
```
|
||||
runghc Setup.hs ...
|
||||
|
||||
14
Setup.bat
14
Setup.bat
@@ -37,20 +37,6 @@ if "%dest%"=="" (
|
||||
)
|
||||
:BreakLibPath
|
||||
|
||||
set DATA_DIR=..\gf-core\DATA_DIR
|
||||
if "%dest%"=="" (
|
||||
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
|
||||
|
||||
17
Setup.hs
17
Setup.hs
@@ -8,8 +8,8 @@ import System.IO (hPutStrLn,stderr)
|
||||
import System.IO.Error (catchIOError)
|
||||
import System.Exit (ExitCode(..),exitFailure)
|
||||
import System.Environment (getArgs,lookupEnv)
|
||||
import System.Process (rawSystem)
|
||||
import System.FilePath ((</>),splitSearchPath) -- ,takeFileName,addExtension,dropExtension)
|
||||
import System.Process (rawSystem,readProcess)
|
||||
import System.FilePath ((</>),splitSearchPath)
|
||||
import System.Directory (createDirectoryIfMissing,copyFile,getDirectoryContents,removeDirectoryRecursive,findFile)
|
||||
#if __GLASGOW_HASKELL__>=800
|
||||
import System.Directory (getModificationTime,setModificationTime)
|
||||
@@ -61,7 +61,7 @@ errLocation = unlines $
|
||||
[ "Unable to determine where to install the RGL. Please do one of the following:"
|
||||
, " - Pass the " ++ destination_flag ++ "... flag to this script"
|
||||
, " - Set the GF_LIB_PATH environment variable"
|
||||
, " - Compile & install GF from the gf-core repository (must be in same directory as gf-rgl)"
|
||||
, " - Compile & install GF from the gf-core repository"
|
||||
]
|
||||
|
||||
-- | Copy single file between directories
|
||||
@@ -116,10 +116,11 @@ data Info = Info
|
||||
mkInfo :: IO Info
|
||||
mkInfo = do
|
||||
args <- getArgs
|
||||
let gf = maybe default_gf id (getFlag gf_flag args)
|
||||
-- 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" >>= return . fmap (head . splitSearchPath)
|
||||
mbuilt <- catchIOError (readProcess gf ["--version"] "" >>= return . getPath) (\e -> return Nothing)
|
||||
let
|
||||
inst_dir =
|
||||
case catMaybes [mflag,menvar,mbuilt] of
|
||||
@@ -129,12 +130,18 @@ mkInfo = do
|
||||
return $ Info
|
||||
{ infoBuildDir = "dist"
|
||||
, infoInstallDir = inst_dir
|
||||
, infoGFPath = maybe default_gf id (getFlag gf_flag args)
|
||||
, infoGFPath = gf
|
||||
, infoVerbose = verbose
|
||||
}
|
||||
where
|
||||
default_gf = "gf"
|
||||
|
||||
getPath s =
|
||||
let l = last (lines s)
|
||||
in if take 14 l == "Shared folder:"
|
||||
then Just (drop 15 l </> "lib")
|
||||
else Nothing
|
||||
|
||||
getRGLBuildDir :: Info -> Mode -> FilePath
|
||||
getRGLBuildDir info mode = infoBuildDir info </> getRGLBuildSubDir mode
|
||||
|
||||
|
||||
9
Setup.sh
9
Setup.sh
@@ -38,15 +38,15 @@ done
|
||||
if [ -z "$dest" ]; then
|
||||
dest=$(echo "$GF_LIB_PATH" | sed 's/:.*$//')
|
||||
fi
|
||||
if [ -z "$dest" ] && [ -f "../gf-core/DATA_DIR" ]; then
|
||||
dest=$(cat ../gf-core/DATA_DIR)
|
||||
if [ -z "$dest" ] && [ "$(gf --version | tail -1 | cut -c -14)" == "Shared folder:" ]; then
|
||||
dest=$(gf --version | tail -1 | cut -c 16-)
|
||||
if [ -n "$dest" ]; then dest="${dest}/lib"; fi
|
||||
fi
|
||||
if [ -z "$dest" ]; then
|
||||
echo "Unable to determine where to install the RGL. Please do one of the following:"
|
||||
echo " - Pass the --dest=... flag to this script"
|
||||
echo " - Set the GF_LIB_PATH environment variable"
|
||||
echo " - Compile & install GF from the gf-core repository (must be in same directory as gf-rgl)"
|
||||
echo " - Compile & install GF from the gf-core repository"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -72,6 +72,7 @@ for lang in $langs; do
|
||||
for mod in $modules_langs $modules_api; do
|
||||
if [ $mod == "Compatibility" ] && [[ "$langs_compat" != *"$lang"* ]]; then continue; fi
|
||||
if [ $mod == "Try" ] && [[ "$langs_try" != *"$lang"* ]]; then continue; fi
|
||||
if [ $mod == "Symbol" ] && [[ "$langs_try" != *"$lang"* ]]; then continue; fi
|
||||
if [ $mod == "Symbolic" ] && [[ "$langs_symbolic" != *"$lang"* ]]; then continue; fi
|
||||
for file in "${src}"/*/"${mod}${lang}".gf; do
|
||||
if [ ! -f "$file" ]; then continue; fi
|
||||
@@ -96,5 +97,7 @@ for module in $modules_alltenses; do
|
||||
done
|
||||
|
||||
# Copy
|
||||
if [ $dest == $dist ]; then exit 0; fi
|
||||
echo "Copying to ${dest}"
|
||||
mkdir -p "${dest}"
|
||||
cp -R "${dist}"/* "${dest}"
|
||||
|
||||
@@ -27,6 +27,7 @@ Jpn,Japanese,japanese,,,,,,,,y
|
||||
Kor,Korean,korean,,,n,y,y,y,n,n
|
||||
Lat,Latin,latin,,,,,y,y,n,y
|
||||
Lav,Latvian,latvian,,,,,,,y,y
|
||||
May,Malay,malay,,,y,,,,n,y
|
||||
Mlt,Maltese,maltese,,,,,,,,y
|
||||
Mon,Mongolian,mongolian,,,,,,n,,y
|
||||
Nep,Nepali,nepali,,,,,,n,,y
|
||||
@@ -42,9 +43,11 @@ Slo,Slovak,slovak,,,,,,n,,y
|
||||
Slv,Slovenian,slovenian,,,,,n,n,,n
|
||||
Snd,Sindhi,sindhi,,,,,,,,y
|
||||
Spa,Spanish,spanish,Romance,,y,,,,y,y
|
||||
Swa,Swahili,swahili,Bantu,,,n,n,n,n,n
|
||||
Swa,Swahili,swahili,Bantu,,,y,n,n,n,n
|
||||
Swe,Swedish,swedish,Scand,,y,,,,y,y
|
||||
Tam,Tamil,tamil,n,n,n,n,n,n,n,n
|
||||
Tel,Telugu,telugu,,,y,n,n,n,,n
|
||||
Tha,Thai,thai,,to_thai,,,,,,y
|
||||
Tur,Turkish,turkish,,,y,,,n,,n
|
||||
Urd,Urdu,urdu,Hindustani,,,,,,,y
|
||||
Som,Somali,somali,,,,,n,n,,n
|
||||
|
||||
|
BIN
src/FileHierarchy.png
Normal file
BIN
src/FileHierarchy.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
266
src/Lang.labels
266
src/Lang.labels
@@ -1,157 +1,157 @@
|
||||
PredVP nsubj head
|
||||
PredVPS nsubj head
|
||||
DirectComplVQ empty nsubj head ccomp -- Temp argument can only be empty in English
|
||||
DirectComplVS empty nsubj head ccomp -- Temp argument can only be empty in English
|
||||
SlashVP nsubj head
|
||||
SlashVS nsubj head ccomp
|
||||
FocusObjS nsubj head -- again might be wrong; more correct to call it dobj
|
||||
QuestIAdv advmod head -- "where does John sleep" cf. AdvVP
|
||||
QuestIComp head nsubj -- "where is John": John is clearly nsubj, but is where the head?
|
||||
QuestQVP nsubj head
|
||||
QuestSlash obj head
|
||||
QuestVP nsubj head
|
||||
PredVP nsubj head
|
||||
PredVPS nsubj head
|
||||
DirectComplVQ empty nsubj head ccomp -- Temp argument can only be empty in English
|
||||
DirectComplVS empty nsubj head ccomp -- Temp argument can only be empty in English
|
||||
SlashVP nsubj head
|
||||
SlashVS nsubj head ccomp
|
||||
FocusObjS nsubj head -- again might be wrong; more correct to call it obj
|
||||
QuestIAdv advmod head -- "where does John sleep" cf. AdvVP
|
||||
QuestIComp head nsubj -- "where is John": John is clearly nsubj, but is where the head?
|
||||
QuestQVP nsubj head
|
||||
QuestSlash obj head
|
||||
QuestVP nsubj head
|
||||
IdetCN det head
|
||||
|
||||
PredSCVP csubj head
|
||||
PredSCVP csubj head
|
||||
|
||||
ComplSlash head obj
|
||||
ComplSlashIP head obj
|
||||
Slash3V3 head obj
|
||||
SlashV2VNP head obj xcomp
|
||||
PastPartAgentAP head obj
|
||||
AdvQVP head obj
|
||||
ComplSlash head obj
|
||||
ComplSlashIP head obj
|
||||
Slash3V3 head obj
|
||||
SlashV2VNP head obj xcomp
|
||||
PastPartAgentAP head obj
|
||||
AdvQVP head obj
|
||||
|
||||
Slash2V3 head iobj
|
||||
Slash2V3 head iobj
|
||||
|
||||
ComplVS head ccomp
|
||||
ComplVQ head ccomp
|
||||
SlashV2S head ccomp
|
||||
SlashV2Q head ccomp
|
||||
CleftAdv head advcl -- not sure
|
||||
ComplVS head ccomp
|
||||
ComplVQ head ccomp
|
||||
SlashV2S head ccomp
|
||||
SlashV2Q head ccomp
|
||||
CleftAdv head advcl -- not sure
|
||||
|
||||
ComplVA head xcomp
|
||||
ComplVV head xcomp
|
||||
SlashVV head acl
|
||||
SlashV2A head xcomp
|
||||
SlashV2V head xcomp
|
||||
ComplVA head xcomp
|
||||
ComplVV head xcomp
|
||||
SlashVV head acl
|
||||
SlashV2A head xcomp
|
||||
SlashV2V head xcomp
|
||||
|
||||
AdvNP head nmod -- not sure
|
||||
ExtAdvNP head nmod -- not sure
|
||||
PassAgentVPSlash head nmod -- not sure
|
||||
CleftNP head acl -- this cannot be nmod, not with type RS
|
||||
AdvNP head nmod -- not sure
|
||||
ExtAdvNP head nmod -- not sure
|
||||
PassAgentVPSlash head nmod -- not sure
|
||||
CleftNP head acl -- this cannot be nmod, not with type RS
|
||||
|
||||
SSubjS head mark advcl
|
||||
RelS head advcl
|
||||
SSubjS head mark advcl
|
||||
RelS head advcl
|
||||
|
||||
AdNum advmod head
|
||||
AdAP advmod head
|
||||
AdvAP head advmod
|
||||
ComparAdvAdj advmod amod head
|
||||
ComparAdvAdjS advmod amod head
|
||||
AdvIAdv advmod head
|
||||
AdVVP advmod head
|
||||
AdvVP head advmod
|
||||
ExtAdvVP head advmod
|
||||
AddAdvQVP head advmod
|
||||
AdVVPSlash advmod head
|
||||
AdvVPSlash head advmod
|
||||
AdvSlash head advmod
|
||||
ExistIPAdv head advmod
|
||||
AdvS advmod head
|
||||
ExtAdvS advmod head
|
||||
AdNum advmod head
|
||||
AdAP advmod head
|
||||
AdvAP head advmod
|
||||
ComparAdvAdj advmod amod head
|
||||
ComparAdvAdjS advmod amod head
|
||||
AdvIAdv advmod head
|
||||
AdVVP advmod head
|
||||
AdvVP head advmod
|
||||
ExtAdvVP head advmod
|
||||
AddAdvQVP head advmod
|
||||
AdVVPSlash advmod head
|
||||
AdvVPSlash head advmod
|
||||
AdvSlash head advmod
|
||||
ExistIPAdv head advmod
|
||||
AdvS advmod head
|
||||
ExtAdvS advmod head
|
||||
|
||||
SubjS mark head
|
||||
RelVP mark head
|
||||
RelSlash mark head
|
||||
SubjS mark head
|
||||
RelVP mark head
|
||||
RelSlash mark head
|
||||
|
||||
ComplN2 head nmod
|
||||
ComplN3 nmod head
|
||||
AdvCN head nmod
|
||||
PossNP head nmod
|
||||
PartNP head nmod
|
||||
ExistNPAdv head nmod
|
||||
ComplN2 head nmod
|
||||
ComplN3 nmod head
|
||||
AdvCN head nmod
|
||||
PossNP head nmod
|
||||
PartNP head nmod
|
||||
ExistNPAdv head nmod
|
||||
|
||||
OrdNumeralSuperl nummod head -- quite wrong; cannot find relevant details in the documentation; but most probably head lies outside the score of this function
|
||||
DetQuant head nummod -- quite wrong; I think the head lies outside the scope of the function
|
||||
CNNumNP head nummod
|
||||
OrdNumeralSuperl nummod head -- quite wrong; cannot find relevant details in the documentation; but most probably head lies outside the score of this function
|
||||
DetQuant head nummod -- quite wrong; I think the head lies outside the scope of the function
|
||||
CNNumNP head nummod
|
||||
|
||||
ApposCN head appos
|
||||
ApposNP head appos
|
||||
ApposCN head appos
|
||||
ApposNP head appos
|
||||
|
||||
RelNP head acl
|
||||
RelCN head acl
|
||||
SentCN head acl
|
||||
SentAP head acl
|
||||
RelNP head acl
|
||||
RelCN head acl
|
||||
SentCN head acl
|
||||
SentAP head acl
|
||||
|
||||
DetQuantOrd head nummod amod -- quite wrong; again for same reason as DetQuant function
|
||||
DetCN det head
|
||||
IdetCN det head
|
||||
DetQuantOrd head nummod amod -- quite wrong; again for same reason as DetQuant function
|
||||
DetCN det head
|
||||
IdetCN det head
|
||||
IdetQuant head nummod
|
||||
CountNP det head
|
||||
PredetNP det head
|
||||
CountNP det head
|
||||
PredetNP det head
|
||||
PPartNP head amod -- only in core RGL
|
||||
|
||||
AdjCN amod head
|
||||
AdjDAP head amod
|
||||
CAdvAP case amod head
|
||||
ComparA amod head
|
||||
ComplA2 amod head
|
||||
CompoundAP head amod
|
||||
AdAdV amod head
|
||||
AdAdv amod head
|
||||
AdjCN amod head
|
||||
AdjDAP head amod
|
||||
CAdvAP case amod head
|
||||
ComparA amod head
|
||||
ComplA2 amod head
|
||||
CompoundAP head amod
|
||||
AdAdV amod head
|
||||
AdAdv amod head
|
||||
|
||||
CompoundN compound head
|
||||
CompoundN compound head
|
||||
|
||||
IIDig head goeswith
|
||||
IIDig head goeswith
|
||||
|
||||
PrepNP case head
|
||||
PrepIP case head
|
||||
SlashPrep head case
|
||||
VPSlashPrep head case
|
||||
PrepNP case head
|
||||
PrepIP case head
|
||||
SlashPrep head case
|
||||
VPSlashPrep head case
|
||||
|
||||
UttImpPl empty head
|
||||
UttImpPol empty head
|
||||
UttImpSg empty head
|
||||
UttImpPl empty head
|
||||
UttImpPol empty head
|
||||
UttImpSg empty head
|
||||
|
||||
MkVPS empty empty head
|
||||
MkVPS empty empty head
|
||||
|
||||
UseCl empty empty head
|
||||
UseQCl empty empty head
|
||||
UseRCl empty empty head
|
||||
UseSlash empty empty head
|
||||
UseVC empty empty head
|
||||
UseCl empty empty head
|
||||
UseQCl empty empty head
|
||||
UseRCl empty empty head
|
||||
UseSlash empty empty head
|
||||
UseVC empty empty head
|
||||
|
||||
BaseAP head conj
|
||||
BaseAdV head conj
|
||||
BaseAdv head conj
|
||||
BaseCN head conj
|
||||
BaseDAP head conj
|
||||
BaseIAdv head conj
|
||||
BaseNP head conj
|
||||
BaseRS head conj
|
||||
BaseS head conj
|
||||
ConsAP head conj
|
||||
ConsAdV head conj
|
||||
ConsAdv head conj
|
||||
ConsCN head conj
|
||||
ConsDAP head conj
|
||||
ConsIAdv head conj
|
||||
ConsNP head conj
|
||||
ConsRS head conj
|
||||
ConsS head conj
|
||||
ConjAP cc head
|
||||
ConjAdV cc head
|
||||
ConjAdv cc head
|
||||
ConjCN cc head
|
||||
ConjDet cc head
|
||||
ConjIAdv cc head
|
||||
ConjNP cc head
|
||||
ConjRS cc head
|
||||
ConjS cc head
|
||||
PhrUtt cc head discourse
|
||||
BaseAP head conj
|
||||
BaseAdV head conj
|
||||
BaseAdv head conj
|
||||
BaseCN head conj
|
||||
BaseDAP head conj
|
||||
BaseIAdv head conj
|
||||
BaseNP head conj
|
||||
BaseRS head conj
|
||||
BaseS head conj
|
||||
ConsAP head conj
|
||||
ConsAdV head conj
|
||||
ConsAdv head conj
|
||||
ConsCN head conj
|
||||
ConsDAP head conj
|
||||
ConsIAdv head conj
|
||||
ConsNP head conj
|
||||
ConsRS head conj
|
||||
ConsS head conj
|
||||
ConjAP cc head
|
||||
ConjAdV cc head
|
||||
ConjAdv cc head
|
||||
ConjCN cc head
|
||||
ConjDet cc head
|
||||
ConjIAdv cc head
|
||||
ConjNP cc head
|
||||
ConjRS cc head
|
||||
ConjS cc head
|
||||
PhrUtt cc head discourse
|
||||
|
||||
PlusChunk head dep
|
||||
TTAnt empty empty head
|
||||
PlusChunk head dep
|
||||
TTAnt empty empty head
|
||||
|
||||
TExclMark head dep -- punctuation in the middle in these three
|
||||
TFullStop head dep
|
||||
@@ -159,7 +159,7 @@ TQuestMark head dep
|
||||
|
||||
ComplV2 head obj -- shortcuts in App
|
||||
ComplV2V head obj xcomp
|
||||
ComplV3 head iobj obj ---- could be dobj dobj
|
||||
ComplV3 head iobj obj ---- could be obj obj
|
||||
PassAgentV2 head ncomp -- not sure
|
||||
RelV2 mark nsubj head
|
||||
QuestV2 obj nsubj head
|
||||
@@ -181,7 +181,7 @@ AdV ADV
|
||||
Adv ADV
|
||||
CAdv ADV
|
||||
Card NUM
|
||||
Conj CONJ
|
||||
Conj CCONJ
|
||||
Det DET
|
||||
Digits NUM
|
||||
IAdv ADV
|
||||
@@ -194,7 +194,7 @@ N2 NOUN
|
||||
N3 NOUN
|
||||
Numeral NUM
|
||||
Ord NUM
|
||||
PConj CONJ
|
||||
PConj CCONJ
|
||||
PN PROPN
|
||||
Predet DET
|
||||
Prep ADP
|
||||
@@ -214,7 +214,3 @@ VA VERB
|
||||
VQ VERB
|
||||
VS VERB
|
||||
VV VERB
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
78
src/README.md
Normal file
78
src/README.md
Normal file
@@ -0,0 +1,78 @@
|
||||
# Introduction
|
||||
|
||||
## Intended audience of this Readme
|
||||
|
||||
This Readme is designed for new developers who wish to either extend/improve on a resource grammar or create a new one. It provides an overview of the relationships between files and a simple working pipeline for developers to get started.
|
||||
|
||||
Note that while files in this folder are meant to be named with 3 letter suffixes representing the language, e.g. "ResBul" for the Bulgarian resource file, this Readme will use a 4 letter suffix "Lang" to represent a language in general, e.g. "ResLang".
|
||||
|
||||
## Author(s) of this Readme
|
||||
|
||||
This Readme was written by Nemo and edited by Inari on 14th August 2022.
|
||||
|
||||
# Creating a new resource grammar
|
||||
|
||||
If you are working on an RGL for a new language, you will need to run "Clone.hs" in the "src" folder so that you can clone a project from another language to your language to give you a basis to start with.
|
||||
|
||||
As per the instructions, the syntax is "Clone fromdir todir fromlang tolang", e.g. "runghc Clone swedish danish Swe Dan". You may want to add the option --comment-body after the word "Clone" to comment out every line in the body of the files to start fresh.
|
||||
|
||||
This is especially useful if your new language has very little in common with the language you are copying from because they come from different language families.
|
||||
|
||||
# File hierarchy
|
||||
|
||||
The number of files may be overwhelming, but they are related together following the graphic under "Module dependencies" under the rgl-tutorial. In the graphic, an example is that GrammarIta and ResIta are dependent on Prelude as they have arrows pointing towards the Prelude ellipse.
|
||||
|
||||
http://www.grammaticalframework.org/lib/doc/rgl-tutorial/index.html
|
||||
|
||||
The below graphic is an alternative graphic explaining the relations, taken from private correspondence with Inari.
|
||||
|
||||

|
||||
|
||||
CatLang defines the categories, and the modules AdjectiveLang, NounLang, SentenceLang, PhraseLang, and so on, all extend Cat. The Grammar is defined as a collection of all those AdjectiveLang, NounLang, SentenceLang, and so on modules. LangLang is defined as the collection GrammarLang and LexiconLang and is where you will be checking your program. You may ignore:
|
||||
|
||||
- AllLangAbs, AllLang, ExtendLang, ExtraLangAbs, ExtraLang, ConstructionLang, DocumentationLang, MarkupLang, BackwardLang
|
||||
|
||||
If the language you cloned from has any of these resource modules, you can remove them completely:
|
||||
|
||||
- IrregLang (unless you want to populate it with irregular verbs of your own language), MissingLang (see how to generate your own if you need it later: https://inariksit.github.io/gf/2018/08/28/gf-gotchas.html#generating-missingxxx)
|
||||
|
||||
# Relationships between functions in files
|
||||
|
||||
There may be several ways the functions within the files are organised relative to one another. In other words, there may be several schemas depending on the author. More recent RGLs might implement one schema detailed by this blog post by Inari.
|
||||
https://inariksit.github.io/gf/2018/08/28/gf-gotchas.html#my-naming-scheme-for-lincats-and-opers
|
||||
|
||||
# Main goal
|
||||
|
||||
You may think of your long-term goal as eventually implementing all the abstract functions found in the "abstract" folder. In other words, you are somewhat constrained by the available categories in Cat.gf and functions in relevant e.g. Noun.gf, Verb.gf etc. files.
|
||||
|
||||
In the future, if you find that the available functions do not apply to your language, you may search in the Extend.gf file for more optional functions, or in Extra.gf. if it doesn't exist, create your own ExtraLangAbs.gf with the concrete ExtraLang.gf, all in the same directory gf-rgl/src/lang. This blog post contains more information.
|
||||
|
||||
https://inariksit.github.io/gf/2021/02/15/rgl-api-core-extensions.html#language-specific-extra-modules
|
||||
|
||||
There is a prioritised list of RGL functions for new resource grammars written by contributor heatherleaf. You can start by implementing the "+++" functions.
|
||||
|
||||
https://github.com/GrammaticalFramework/gf-rgl/issues/238
|
||||
|
||||
# Working pipeline example
|
||||
|
||||
For a pipeline, You might wish to start with implementing functions that create Noun Phrase like DetCN: Det -> CN -> NP; a function that takes a Determiner and a Common Noun and gives a Noun Phrase. In this case, the workflow is done by editing:
|
||||
|
||||
1. ResLang: Contains the relevant Operations (Opers) for e.g. "Noun", "mkN", "Determiner" and "Quant".
|
||||
2. ParamLang: Contains the language paramters used in ResLang.
|
||||
3. CatLang: CatLang will be defined in terms of Opers found in ResLang. This means that instead of Defining NP in CatLang as, say, {s: Str}, you will define NP as ResLang.NounPhrase, which points to a NounPhrase Oper in ResLang. Then you need to implement the word syntax in NounLang.
|
||||
4. NounLang: Contains the relevant lins in defining sentence structure.
|
||||
5. LexiconLang: Contains the lins that define the Noun words.
|
||||
|
||||
As you will have to define a determiner that is created from a Quant, you will have to look at the following files too.
|
||||
|
||||
6. StructuralLang: Contains the lins that define the Quant/Determiner words.
|
||||
|
||||
Note that you will have to use mkQuant instead of creating Det by mkDet directly.
|
||||
|
||||
# Testing your work
|
||||
|
||||
When you are done with your implementation, you may test that everything works by starting up LangLang and, in this case, writing something like:
|
||||
|
||||
```DetCN (DetQuant xxxx_Quant NumSg) (UseN xxxx_N)```
|
||||
|
||||
Where you replace 'xxxx' with the word in Lang.
|
||||
@@ -13,6 +13,7 @@ fun
|
||||
InflectionN : N -> Inflection ;
|
||||
InflectionN2 : N2 -> Inflection ;
|
||||
InflectionN3 : N3 -> Inflection ;
|
||||
InflectionPN : PN -> Inflection ;
|
||||
InflectionA : A -> Inflection ;
|
||||
InflectionA2 : A2 -> Inflection ;
|
||||
InflectionV : V -> Inflection ;
|
||||
@@ -27,6 +28,9 @@ fun
|
||||
InflectionV2Q : V2Q -> Inflection ;
|
||||
InflectionV2A : V2A -> Inflection ;
|
||||
InflectionAdv : Adv -> Inflection ;
|
||||
InflectionAdV : AdV -> Inflection ;
|
||||
InflectionAdA : AdA -> Inflection ;
|
||||
InflectionAdN : AdN -> Inflection ;
|
||||
InflectionPrep : Prep -> Inflection ;
|
||||
|
||||
fun
|
||||
|
||||
@@ -47,6 +47,7 @@ abstract Extend = Cat ** {
|
||||
PredVPS : NP -> VPS -> S ; -- she [has walked and won't sleep]
|
||||
SQuestVPS : NP -> VPS -> QS ; -- has she walked
|
||||
QuestVPS : IP -> VPS -> QS ; -- who has walked
|
||||
RelVPS : RP -> VPS -> RS ; -- which won't sleep
|
||||
|
||||
-- existentials that work in the absence of Cl
|
||||
ExistS : Temp -> Pol -> NP -> S ; -- there was a party
|
||||
@@ -69,11 +70,20 @@ abstract Extend = Cat ** {
|
||||
MkVPS2 : Temp -> Pol -> VPSlash -> VPS2 ; -- has loved
|
||||
ConjVPS2 : Conj -> [VPS2] -> VPS2 ; -- has loved and now hates
|
||||
ComplVPS2 : VPS2 -> NP -> VPS ; -- has loved and now hates that person
|
||||
ReflVPS2 : VPS2 -> RNP -> VPS ; -- have loved and now hate myself and my car
|
||||
|
||||
MkVPI2 : VPSlash -> VPI2 ; -- to love
|
||||
ConjVPI2 : Conj -> [VPI2] -> VPI2 ; -- to love and hate
|
||||
ComplVPI2 : VPI2 -> NP -> VPI ; -- to love and hate that person
|
||||
|
||||
-- Conjunction of copula complements
|
||||
cat [Comp]{2} ;
|
||||
fun ConjComp : Conj -> ListComp -> Comp ;
|
||||
|
||||
-- Conjunction of imperatives
|
||||
cat [Imp] {2} ;
|
||||
fun ConjImp : Conj -> ListImp -> Imp ;
|
||||
|
||||
fun
|
||||
ProDrop : Pron -> Pron ; -- unstressed subject pronoun becomes empty: "am tired"
|
||||
|
||||
@@ -116,6 +126,11 @@ abstract Extend = Cat ** {
|
||||
|
||||
ProgrVPSlash : VPSlash -> VPSlash;
|
||||
|
||||
-- construct VPSlash from A2 and N2
|
||||
|
||||
A2VPSlash : A2 -> VPSlash ; -- is married to (that person)
|
||||
N2VPSlash : N2 -> VPSlash ; -- is a mother of (that person)
|
||||
|
||||
-- existential for mathematics
|
||||
|
||||
ExistsNP : NP -> Cl ; -- there exists a number / there exist numbers
|
||||
@@ -126,7 +141,7 @@ abstract Extend = Cat ** {
|
||||
ExistMassCN : CN -> Cl ; -- there is beer / there is no beer
|
||||
ExistPluralCN : CN -> Cl ; -- there are trees / there are no trees
|
||||
|
||||
-- generalisation of existential, with adverb as a parameter
|
||||
-- generalisation of existential, with adverb as an argument
|
||||
AdvIsNP : Adv -> NP -> Cl ; -- here is the tree / here are the trees
|
||||
AdvIsNPAP : Adv -> NP -> AP -> Cl ; -- here are the instructions documented
|
||||
|
||||
@@ -184,6 +199,15 @@ abstract Extend = Cat ** {
|
||||
|
||||
PredetRNP : Predet -> RNP -> RNP ; -- all my brothers
|
||||
|
||||
AdvRNP : NP -> Prep -> RNP -> RNP ; -- a dispute with his wife
|
||||
AdvRVP : VP -> Prep -> RNP -> VP ; -- lectured about her travels
|
||||
AdvRAP : AP -> Prep -> RNP -> AP ; -- adamant in his refusal
|
||||
|
||||
ReflA2RNP : A2 -> RNP -> AP ; -- indifferent to their surroundings
|
||||
-- NOTE: generalizes ReflA2
|
||||
|
||||
PossPronRNP : Pron -> Num -> CN -> RNP -> NP ; -- his abandonment of his wife and children
|
||||
|
||||
ConjRNP : Conj -> RNPList -> RNP ; -- my family, John and myself
|
||||
|
||||
Base_rr_RNP : RNP -> RNP -> RNPList ; -- my family, myself
|
||||
@@ -193,6 +217,9 @@ abstract Extend = Cat ** {
|
||||
Cons_nr_RNP : NP -> RNPList -> RNPList ; -- John, my family, myself
|
||||
---- Cons_rn_RNP : RNP -> ListNP -> RNPList ; -- myself, John, Mary
|
||||
|
||||
-- reflexive possessive on its own right, like in Swedish, Czech, Slovak
|
||||
|
||||
ReflPossPron : Quant ; -- Swe sin,sitt,sina
|
||||
|
||||
--- from Extensions
|
||||
|
||||
@@ -251,4 +278,18 @@ abstract Extend = Cat ** {
|
||||
UttDatIP : IP -> Utt ; -- whom (dative)
|
||||
|
||||
|
||||
-- UseDAP replaces DetNP from the RGL which is more limited.
|
||||
-- Instead of (DetNP d) use (UseDAP (DetDAP d)). The advantage
|
||||
-- is that now we can also have an adjective inserted, i.e.
|
||||
-- (UseDAP (AdjDAP (DetDAP d) a). There are also versions of
|
||||
-- UseDAP for different genders.
|
||||
fun UseDAP : DAP -> NP ;
|
||||
UseDAPMasc : DAP -> NP ;
|
||||
UseDAPFem : DAP -> NP ;
|
||||
|
||||
cat X ; -- for words that are difficult to classify, mainly for MorphoDict
|
||||
|
||||
fun
|
||||
CardCNCard : Card -> CN -> Card ; -- three million, four lakh, six dozen etc
|
||||
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ abstract Sentence = Cat ** {
|
||||
-- To fix these parameters, see [Phrase Phrase.html].
|
||||
|
||||
ImpVP : VP -> Imp ; -- love yourselves
|
||||
AdvImp : Adv -> Imp -> Imp ; -- please love yourselves
|
||||
|
||||
--2 Embedded sentences
|
||||
|
||||
|
||||
153
src/afrikaans/DocumentationAfr.gf
Normal file
153
src/afrikaans/DocumentationAfr.gf
Normal file
@@ -0,0 +1,153 @@
|
||||
--# -path=.:../abstract:../common
|
||||
|
||||
concrete DocumentationAfr of Documentation = CatAfr ** open
|
||||
ResAfr,
|
||||
Prelude,
|
||||
HTML
|
||||
in {
|
||||
|
||||
|
||||
lincat
|
||||
Inflection = {t : Str; s1,s2 : Str} ;
|
||||
Definition = {s : Str} ;
|
||||
Document = {s : Str} ;
|
||||
Tag = {s : Str} ;
|
||||
|
||||
lin
|
||||
InflectionN, InflectionN2, InflectionN3 = \noun -> {
|
||||
t = "s" ;
|
||||
s1 = heading1 "Selfstandige Naamwoord" ;
|
||||
s2 = frameTable (
|
||||
tr (th "Enkelvoud" ++ th "Meervoud" ) ++
|
||||
tr (td (noun.s ! NF Sg Nom) ++ td (noun.s ! NF Pl Nom)))
|
||||
} ;
|
||||
|
||||
InflectionPN = \pn -> {
|
||||
t = "pn" ;
|
||||
s1 = heading1 "Naam" ;
|
||||
s2 = paragraph (pn.s ! NPNom)
|
||||
} ;
|
||||
|
||||
InflectionA, InflectionA2 = \adj ->
|
||||
let
|
||||
gforms : AForm -> Str = \a ->
|
||||
td (adj.s ! Posit ! a) ++
|
||||
td (adj.s ! Compar ! a) ++
|
||||
case a of {
|
||||
AGen => td "-" ; -- superlative partitive not used
|
||||
_ => td (adj.s ! Superl ! a)
|
||||
} ;
|
||||
dtable : Str =
|
||||
frameTable (
|
||||
tr (th [] ++ th "Stellend" ++ th "Vergrotend" ++
|
||||
th "Oortreffend") ++
|
||||
tr (th "Predikatief" ++ gforms APred) ++
|
||||
tr (th "Attributief" ++ gforms AAttr) ++
|
||||
tr (th "Partitief" ++ gforms AGen)
|
||||
)
|
||||
in { t = "bv" ;
|
||||
s1 = heading1 "Byvoeglike naamwoord" ;
|
||||
s2 = dtable
|
||||
} ;
|
||||
|
||||
InflectionAdv, InflectionAdV, InflectionAdA, InflectionAdN = \adv -> {
|
||||
t = "bw" ;
|
||||
s1 = heading1 "Bywoord" ;
|
||||
s2 = paragraph adv.s
|
||||
} ;
|
||||
|
||||
InflectionPrep p = {
|
||||
t = "prep" ;
|
||||
s1 = heading1 "Voorsetsel" ;
|
||||
s2 = paragraph p.s
|
||||
} ;
|
||||
|
||||
InflectionV v = {
|
||||
t = "w" ;
|
||||
s1 = heading1 "Werkwoord" ;
|
||||
s2 = inflVerb v
|
||||
} ;
|
||||
|
||||
InflectionV2 v = {
|
||||
t = "v" ;
|
||||
s1 = heading1 "Werkwoord" ;
|
||||
s2 = inflVerb v
|
||||
} ;
|
||||
|
||||
InflectionV3 v = {
|
||||
t = "v" ;
|
||||
s1 = heading1 "Werkwoord" ;
|
||||
s2 = inflVerb v
|
||||
} ;
|
||||
|
||||
InflectionV2V v = {
|
||||
t = "v" ;
|
||||
s1 = heading1 "Werkwoord" ;
|
||||
s2 = inflVerb v
|
||||
} ;
|
||||
|
||||
InflectionV2S v = {
|
||||
t = "v" ;
|
||||
s1 = heading1 "Werkwoord" ;
|
||||
s2 = inflVerb v
|
||||
} ;
|
||||
|
||||
InflectionV2Q v = {
|
||||
t = "v" ;
|
||||
s1 = heading1 "Werkwoord" ;
|
||||
s2 = inflVerb v
|
||||
} ;
|
||||
|
||||
InflectionV2A v = {
|
||||
t = "v" ;
|
||||
s1 = heading1 "Werkwoord" ;
|
||||
s2 = inflVerb v
|
||||
} ;
|
||||
|
||||
InflectionVV v = {
|
||||
t = "v" ;
|
||||
s1 = heading1 "Werkwoord" ;
|
||||
s2 = inflVerb v
|
||||
} ;
|
||||
|
||||
InflectionVS v = {
|
||||
t = "v" ;
|
||||
s1 = heading1 "Werkwoord" ;
|
||||
s2 = inflVerb v
|
||||
} ;
|
||||
|
||||
InflectionVQ v = {
|
||||
t = "v" ;
|
||||
s1 = heading1 "Werkwoord" ;
|
||||
s2 = inflVerb v
|
||||
} ;
|
||||
|
||||
InflectionVA v = {
|
||||
t = "v" ;
|
||||
s1 = heading1 "Werkwoord" ;
|
||||
s2 = inflVerb v
|
||||
} ;
|
||||
|
||||
lin
|
||||
NoDefinition t = {s=t.s};
|
||||
MkDefinition t d = {s="<p><b>Definisie:</b>"++t.s++d.s++"</p>"};
|
||||
MkDefinitionEx t d e = {s="<p><b>Definisie:</b>"++t.s++d.s++"</p><p><b>Voorbeeld:</b>"++e.s++"</p>"};
|
||||
|
||||
MkDocument d i e = ss (i.s1 ++ d.s ++ i.s2 ++ paragraph e.s) ; -- explanation appended in a new paragraph
|
||||
MkTag i = ss i.t ;
|
||||
|
||||
oper
|
||||
inflVerb : VVerb -> Str = \verb ->
|
||||
let
|
||||
vfin : VForm -> Str = \f ->
|
||||
verb.s ! f ++ verb.prefix ;
|
||||
gforms : VForm -> Str = \f ->
|
||||
td (vfin f) ;
|
||||
|
||||
in frameTable (
|
||||
tr (th "Infinitief" ++ td (verb.s ! VInf)) ++
|
||||
tr (th "Teenwoordige Tyd" ++ td (verb.s ! VPres)) ++
|
||||
tr (th "Verlede Tyd" ++ td (verb.s ! VPast)) ++
|
||||
tr (th "Perfectief" ++ td (verb.s ! VPerf))
|
||||
) ;
|
||||
}
|
||||
@@ -2,4 +2,6 @@
|
||||
|
||||
concrete LangAfr of Lang =
|
||||
GrammarAfr,
|
||||
LexiconAfr ;
|
||||
LexiconAfr
|
||||
,DocumentationAfr --# notpresent
|
||||
;
|
||||
|
||||
8
src/api/CombinatorsMay.gf
Normal file
8
src/api/CombinatorsMay.gf
Normal file
@@ -0,0 +1,8 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsMay = Combinators - [ appCN, appCNc ] with
|
||||
(Cat = CatMay),
|
||||
(Structural = StructuralMay),
|
||||
(Noun = NounMay),
|
||||
(Constructors = ConstructorsMay) **
|
||||
{}
|
||||
9
src/api/CombinatorsTam.gf
Normal file
9
src/api/CombinatorsTam.gf
Normal file
@@ -0,0 +1,9 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsTam = Combinators - [ appCN, appCNc ] with
|
||||
(Cat = CatTam),
|
||||
(Structural = StructuralTam),
|
||||
(Noun = NounTam),
|
||||
(Constructors = ConstructorsTam) **
|
||||
{}
|
||||
}
|
||||
4
src/api/ConstructorsMay.gf
Normal file
4
src/api/ConstructorsMay.gf
Normal file
@@ -0,0 +1,4 @@
|
||||
--# -path=.:alltenses:prelude:../malay
|
||||
|
||||
resource ConstructorsMay = Constructors with (Grammar = GrammarMay) **
|
||||
open MissingMay in {} ;
|
||||
5
src/api/ConstructorsTam.gf
Normal file
5
src/api/ConstructorsTam.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:alltenses:prelude:../tamil
|
||||
|
||||
resource ConstructorsTam = Constructors with (Grammar = GrammarTam) **
|
||||
open MissingTam in {} ;
|
||||
}
|
||||
@@ -6,8 +6,9 @@ incomplete resource Symbolic = open Symbol, Grammar, PredefCnc in {
|
||||
symb : overload {
|
||||
symb : Symb -> NP ; -- x
|
||||
symb : Str -> NP ; -- x
|
||||
symb : Int -> NP ; -- 23
|
||||
symb : Int -> NP ; -- 23 (is prime)
|
||||
symb : Float -> NP ; -- 0.99
|
||||
symb : Int -> Card ; -- 23 (houses)
|
||||
symb : N -> Digits -> NP ; -- level 4
|
||||
symb : N -> Card -> NP ; -- level at least four
|
||||
symb : CN -> Card -> NP ; -- advanced level at least four
|
||||
@@ -45,6 +46,8 @@ incomplete resource Symbolic = open Symbol, Grammar, PredefCnc in {
|
||||
= \i -> UsePN (IntPN i) ;
|
||||
symb : Float -> NP
|
||||
= \i -> UsePN (FloatPN i) ;
|
||||
symb : Int -> Card
|
||||
= \s -> SymbNum (mkSymb s.s) ;
|
||||
symb : N -> Digits -> NP
|
||||
= \c,i -> CNNumNP (UseN c) (NumDigits i) ;
|
||||
symb : N -> Card -> NP
|
||||
|
||||
5
src/api/SymbolicMay.gf
Normal file
5
src/api/SymbolicMay.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:../malay:../common:../abstract:../prelude
|
||||
|
||||
resource SymbolicMay = Symbolic with
|
||||
(Symbol = SymbolMay),
|
||||
(Grammar = GrammarMay) ** open MissingMay in {} ;
|
||||
6
src/api/SymbolicTam.gf
Normal file
6
src/api/SymbolicTam.gf
Normal file
@@ -0,0 +1,6 @@
|
||||
--# -path=.:../tamil:../common:../abstract:../prelude
|
||||
|
||||
resource SymbolicTam = Symbolic with
|
||||
(Symbol = SymbolTam),
|
||||
(Grammar = GrammarTam) ** open MissingTam in {} ;
|
||||
}
|
||||
5
src/api/SyntaxMay.gf
Normal file
5
src/api/SyntaxMay.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
instance SyntaxMay of Syntax =
|
||||
ConstructorsMay, CatMay, StructuralMay, CombinatorsMay ;
|
||||
|
||||
6
src/api/SyntaxTam.gf
Normal file
6
src/api/SyntaxTam.gf
Normal file
@@ -0,0 +1,6 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
instance SyntaxTam of Syntax =
|
||||
ConstructorsTam, CatTam, StructuralTam, CombinatorsTam ;
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
--# -path=.:../english:../common:../abstract:../prelude
|
||||
|
||||
resource TryEng = SyntaxEng-[mkAdN], LexiconEng, ParadigmsEng - [mkAdv,mkAdN,mkOrd,mkQuant] **
|
||||
resource TryEng = SyntaxEng-[mkAdN], LexiconEng, ParadigmsEng - [mkAdv,mkAdN,mkOrd,mkQuant,mkVoc] **
|
||||
open (P = ParadigmsEng) in {
|
||||
|
||||
oper
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
--# -path=.:../finnish:../common:../abstract:../prelude
|
||||
|
||||
resource TryFin = SyntaxFin, LexiconFin-[mkOrd], ParadigmsFin - [mkAdv,mkAdN,mkDet,mkQuant,mkPConj] ;
|
||||
resource TryFin =
|
||||
SyntaxFin,
|
||||
LexiconFin-[mkOrd],
|
||||
ParadigmsFin - [mkAdv,mkAdN,mkDet,mkQuant,mkPConj],
|
||||
MakeStructuralFin - [mkDet,mkIDet,mkConj,mkSubj]
|
||||
;
|
||||
|
||||
3
src/api/TryMay.gf
Normal file
3
src/api/TryMay.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:../malay:../common:../abstract:../prelude
|
||||
|
||||
resource TryMay = SyntaxMay, LexiconMay, ParadigmsMay - [mkAdv,mkAdN,mkOrd,mkNum] ;
|
||||
@@ -1,3 +1,3 @@
|
||||
--# -path=.:../russian:../common:../abstract:../prelude
|
||||
|
||||
resource TryRus = SyntaxRus, LexiconRus, ParadigmsRus - [mkAdv,mkIAdv,mkOrd] ;
|
||||
resource TryRus = SyntaxRus, LexiconRus, ParadigmsRus - [mkAdv,mkIAdv,mkOrd,mkAdN] ;
|
||||
|
||||
4
src/api/TryTam.gf
Normal file
4
src/api/TryTam.gf
Normal file
@@ -0,0 +1,4 @@
|
||||
--# -path=.:../tamil :../common:../abstract:../prelude
|
||||
|
||||
resource TryTam = SyntaxTam, LexiconTam, ParadigmsTam - [mkAdv,mkAdN,mkOrd,mkNum] ;
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
--# -path=.:../abstract:../common:../api:../prelude
|
||||
|
||||
concrete AllAra of AllAraAbs = LangAra ;
|
||||
concrete AllAra of AllAraAbs = LangAra, ExtendAra ;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
--# -path=.:../abstract:../common:prelude
|
||||
|
||||
abstract AllAraAbs = Lang ;
|
||||
abstract AllAraAbs = Lang, Extend ;
|
||||
|
||||
@@ -6,7 +6,7 @@ concrete ExtendAra of Extend =
|
||||
EmptyRelSlash, PredAPVP,
|
||||
ComplDirectVS, ComplDirectVQ, -- because of Utt
|
||||
VPS, MkVPS, PredVPS, BaseVPS, ConsVPS, ConjVPS,
|
||||
EmbedSSlash, AdjAsNP
|
||||
EmbedSSlash, AdjAsNP, GerundNP
|
||||
]
|
||||
with (Grammar=GrammarAra)
|
||||
** open
|
||||
@@ -59,6 +59,11 @@ lin
|
||||
-- : SSlash -> SC
|
||||
EmbedSSlash = Grammar.EmbedS ;
|
||||
|
||||
-- : VP -> NP
|
||||
GerundNP vp = emptyNP ** {
|
||||
s = \\_ => uttVP VPGer vp ! Masc ; -- NB. NP should inflect in case, but there are no cases for masdar in the inflection table of VP. If desired, can add here with BIND. /IL
|
||||
} ; -- The Gender param here doesn't make a difference, because the VPGer in VP's inflection table doesn't have gender to start with. So we could equally well choose Fem too.
|
||||
|
||||
lincat
|
||||
VPS = {s : PerGenNum => Str} ; -- finite VP's with tense and polarity
|
||||
[VPS] = {s1,s2 : PerGenNum => Str} ;
|
||||
|
||||
@@ -1,31 +1,28 @@
|
||||
incomplete concrete PhraseBantu of Phrase =
|
||||
CatBantu ** open CommonBantu, ResBantu, Prelude in { }
|
||||
{-}
|
||||
flags optimize = all_subs ;
|
||||
CatBantu ** open CommonBantu, ResBantu, Prelude in {
|
||||
|
||||
lin
|
||||
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
|
||||
|
||||
UttS s = {s = s.s ! Indic} ;
|
||||
UttS s = {s = s.s} ;
|
||||
UttQS qs = {s = qs.s ! QDir} ;
|
||||
UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Sg False ! Fem} ;
|
||||
{- UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Sg False ! Fem} ;
|
||||
UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Pl False ! Fem} ;
|
||||
UttImpPol pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Sg True ! Fem} ;
|
||||
|
||||
UttIP ip = {s = ip.s ! Nom} ; --- Acc also
|
||||
UttIP ip = {s = ip.s ! Nom} ; --- Acc also -}
|
||||
UttIAdv iadv = iadv ;
|
||||
UttNP np = {s = (np.s ! Nom).ton} ;
|
||||
UttVP vp = {s = infVP vp (agrP3 Fem Sg)} ; --- Agr
|
||||
UttNP np = {s = np.s ! npNom} ;
|
||||
{- UttVP vp = {s = infVP vp (agrP3 Fem Sg)} ; --- Agr -}
|
||||
UttAdv adv = adv ;
|
||||
UttCN n = {s = n.s ! Sg} ;
|
||||
UttAP ap = {s = ap.s ! AF Masc Sg} ;
|
||||
UttCard n = {s = n.s ! Masc} ;
|
||||
UttCN n = {s = n.s ! Sg ! Nom} ;
|
||||
{- UttAP ap = {s = ap.s ! AF Masc Sg} ;
|
||||
UttCard n = {s = n.s ! Masc} ;-}
|
||||
UttInterj i = i ;
|
||||
|
||||
NoPConj = {s = []} ;
|
||||
PConjConj conj = {s = conj.s2} ;
|
||||
|
||||
NoVoc = {s = []} ;
|
||||
VocNP np = {s = "," ++ (np.s ! Nom).ton} ;
|
||||
|
||||
-}
|
||||
{- VocNP np = {s = "," ++ (np.s ! Nom).ton} ; -}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ concrete CatBul of Cat = CommonX - [IAdv,AdV] ** open ResBul, Prelude, Predef, (
|
||||
N = {s : NForm => Str; rel : AForm => Str; relType : NRelType; g : AGender} ;
|
||||
N2 = {s : NForm => Str; rel : AForm => Str; relType : NRelType; g : AGender} ** {c2 : Preposition} ;
|
||||
N3 = {s : NForm => Str; rel : AForm => Str; relType : NRelType; g : AGender} ** {c2,c3 : Preposition} ;
|
||||
PN = {s : Str; g : Gender} ;
|
||||
PN = {s : Str; gn : GenNum} ;
|
||||
|
||||
lindef
|
||||
SSlash = \s -> {s = \\_ => s; c2 = {s=""; c=Acc}};
|
||||
|
||||
@@ -79,6 +79,19 @@ lin
|
||||
s3 = ""
|
||||
} ;
|
||||
|
||||
InflectionPN = \pn -> {
|
||||
t = "същ.с." ;
|
||||
s1= heading1 ("Съществително Собствено"++
|
||||
case pn.gn of {
|
||||
GSg Masc => "(м.р.)" ;
|
||||
GSg Fem => "(ж.р.)" ;
|
||||
GSg Neut => "(ср.р.)" ;
|
||||
GPl => "(мн.ч.)"
|
||||
}) ;
|
||||
s2 = pn.s ;
|
||||
s3 = ""
|
||||
} ;
|
||||
|
||||
InflectionA, InflectionA2 = \a -> {
|
||||
t = "пр" ;
|
||||
s1= heading1 ("Прилагателно") ;
|
||||
@@ -104,7 +117,7 @@ lin
|
||||
s3= ""
|
||||
} ;
|
||||
|
||||
InflectionAdv = \adv -> {
|
||||
InflectionAdv, InflectionAdV, InflectionAdA, InflectionAdN = \adv -> {
|
||||
t = "нар" ;
|
||||
s1= heading1 ("Наречие") ;
|
||||
s2= paragraph (adv.s) ;
|
||||
|
||||
@@ -96,6 +96,10 @@ lin
|
||||
lin
|
||||
PassVPSlash vp = insertObj (\\a => vp.ad.s ++ vp.s ! Perf ! VPassive (aform a.gn Indef (RObj Acc)) ++
|
||||
vp.compl1 ! a ++ vp.compl2 ! a) Pos (predV verbBe) ;
|
||||
ProgrVPSlash vp = vp ** {
|
||||
s = \\_ => vp.s ! Imperf ;
|
||||
isSimple = False
|
||||
} ;
|
||||
|
||||
PassAgentVPSlash vp np =
|
||||
insertObj (\\_ => "от" ++ np.s ! RObj CPrep) Pos
|
||||
@@ -119,6 +123,21 @@ lin
|
||||
vp.compl ! agr
|
||||
} ;
|
||||
|
||||
lincat
|
||||
VPI = {s : Agr => Str} ;
|
||||
[VPI] = {s : Agr => Ints 4 => Str} ;
|
||||
|
||||
lin
|
||||
BaseVPI x y = {s = \\a=>table {4 => y.s!a; _ => x.s!a}} ;
|
||||
ConsVPI x xs = {s = \\a=>table {4 => xs.s!a!4; t => x.s!a++linCoord bindComma!t++xs.s!a!t}};
|
||||
|
||||
MkVPI vp = {s = daComplex Simul Pos vp ! Perf} ;
|
||||
ConjVPI conj vpi = {
|
||||
s = \\a => linCoord []!conj.sep ++ vpi.s!a!conj.sep ++ conj.s ++ vpi.s!a!4
|
||||
} ;
|
||||
ComplVPIVV vv vpi =
|
||||
insertObj (\\a => vpi.s ! a) Pos (predV vv) ;
|
||||
|
||||
lincat
|
||||
VPS = {s : Agr => Str} ;
|
||||
[VPS] = {s : Agr => Ints 4 => Str} ;
|
||||
@@ -140,6 +159,25 @@ lin
|
||||
s = \\a => linCoord []!conj.sep ++ vps.s!a!conj.sep ++ conj.s ++ vps.s!a!4
|
||||
} ;
|
||||
|
||||
lincat [Comp] = {s : Agr => Ints 4 => Str} ;
|
||||
lin BaseComp x y =
|
||||
{s = \\agr=>table {4 => y.s!agr; _ => x.s!agr}} ;
|
||||
ConsComp x xs =
|
||||
{s = \\agr=>table {4 => xs.s!agr!4; t => x.s!agr++linCoord bindComma!t++xs.s!agr!t}} ;
|
||||
ConjComp conj ss = {
|
||||
s = \\agr => linCoord [] ! conj.sep ++ ss.s!agr!conj.sep ++ conj.s ++ ss.s!agr!4 ;
|
||||
p = Pos
|
||||
} ;
|
||||
|
||||
lincat ListImp = {s : Polarity => GenNum => Ints 4 => Str} ;
|
||||
lin BaseImp x y =
|
||||
{s = \\p,gn=>table {4 => y.s!p!gn; _ => x.s!p!gn}} ;
|
||||
ConsImp x xs =
|
||||
{s = \\p,gn=>table {4 => xs.s!p!gn!4; t => x.s!p!gn++linCoord bindComma!t++xs.s!p!gn!t}} ;
|
||||
ConjImp conj ss = {
|
||||
s = \\p,gn => linCoord [] ! conj.sep ++ ss.s!p!gn!conj.sep ++ conj.s ++ ss.s!p!gn!4
|
||||
} ;
|
||||
|
||||
lin
|
||||
ComplBareVS = ComplVS ;
|
||||
ComplSlashPartLast = ComplSlash ;
|
||||
@@ -189,6 +227,20 @@ lin
|
||||
gn = rnp.gn
|
||||
} ;
|
||||
|
||||
AdvRNP np prep rnp = {s = \\role => np.s ! role ++ prep.s ++ rnp.s ! RObj prep.c; gn = np.gn; p = np.p} ;
|
||||
AdvRVP vp prep rnp = insertObj (\\a => prep.s ++ rnp.s ! RObj prep.c) Pos vp ;
|
||||
AdvRAP ap prep rnp = {
|
||||
s = \\aform,p => ap.s ! aform ! p ++ prep.s ++ rnp.s ! RObj prep.c ;
|
||||
isPre = False
|
||||
} ;
|
||||
|
||||
ReflA2RNP a rnp = {
|
||||
s = \\aform,_ => a.s ! aform ++ a.c2.s ++ rnp.s ! RObj a.c2.c ;
|
||||
isPre = False
|
||||
} ;
|
||||
|
||||
PossPronRNP pron num cn rnp = DetCN (DetQuant (PossPron pron) num) (PossNP cn (lin NP {s = rnp.s; gn = rnp.gn; p=NounP3 Pos})) ;
|
||||
|
||||
lin
|
||||
ApposNP np1 np2 = {s = \\role => case role of {
|
||||
RObj c => linCase c (personPol np1.p) ++ np1.s ! RObj CPrep ;
|
||||
@@ -218,5 +270,35 @@ lin
|
||||
p = NounP3 det.p
|
||||
} ;
|
||||
|
||||
lin UseDAP dap = {
|
||||
s = \\role => let s = dap.s ! False ! ANeut ! role
|
||||
in case role of {
|
||||
RObj c => linCase c dap.p ++ s;
|
||||
_ => s
|
||||
} ;
|
||||
gn = gennum ANeut (numnnum dap.nn);
|
||||
p = NounP3 dap.p
|
||||
} ;
|
||||
|
||||
UseDAPMasc dap = {
|
||||
s = \\role => let s = dap.s ! False ! (AMasc Human) ! role
|
||||
in case role of {
|
||||
RObj c => linCase c dap.p ++ s;
|
||||
_ => s
|
||||
} ;
|
||||
gn = gennum (AMasc Human) (numnnum dap.nn);
|
||||
p = NounP3 dap.p
|
||||
} ;
|
||||
|
||||
UseDAPFem dap = {
|
||||
s = \\role => let s = dap.s ! False ! AFem ! role
|
||||
in case role of {
|
||||
RObj c => linCase c dap.p ++ s;
|
||||
_ => s
|
||||
} ;
|
||||
gn = gennum AFem (numnnum dap.nn);
|
||||
p = NounP3 dap.p
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -55,21 +55,6 @@ concrete ExtraBul of ExtraBulAbs = CatBul **
|
||||
|
||||
IAdvAdv adv = {s = \\qf => (mkIAdv "колко").s ! qf ++ adv.s} ;
|
||||
|
||||
lincat
|
||||
VPI = {s : Agr => Str} ;
|
||||
[VPI] = {s : Agr => Ints 4 => Str} ;
|
||||
|
||||
lin
|
||||
BaseVPI x y = {s = \\a=>table {4 => y.s!a; _ => x.s!a}} ;
|
||||
ConsVPI x xs = {s = \\a=>table {4 => xs.s!a!4; t => x.s!a++linCoord bindComma!t++xs.s!a!t}};
|
||||
|
||||
MkVPI vp = {s = daComplex Simul Pos vp ! Perf} ;
|
||||
ConjVPI conj vpi = {
|
||||
s = \\a => linCoord []!conj.sep ++ vpi.s!a!conj.sep ++ conj.s ++ vpi.s!a!4
|
||||
} ;
|
||||
ComplVPIVV vv vpi =
|
||||
insertObj (\\a => vpi.s ! a) Pos (predV vv) ;
|
||||
|
||||
lincat
|
||||
VPS = {s : Agr => Str} ;
|
||||
[VPS] = {s : Agr => Ints 4 => Str} ;
|
||||
|
||||
@@ -1,14 +1,6 @@
|
||||
--# -path=.:../../prelude
|
||||
--# -coding=utf8
|
||||
|
||||
--1 A Simple English Resource Morphology
|
||||
--
|
||||
-- Aarne Ranta 2002 -- 2005
|
||||
--
|
||||
-- This resource morphology contains definitions needed in the resource
|
||||
-- syntax. To build a lexicon, it is better to use $ParadigmsEng$, which
|
||||
-- gives a higher-level access to this module.
|
||||
|
||||
resource MorphoBul = ResBul ** open
|
||||
Predef,
|
||||
Prelude,
|
||||
|
||||
@@ -57,12 +57,6 @@ oper
|
||||
dualV : VTable -> VTable -> V ;
|
||||
dualV imperf perf = {
|
||||
s = table {Imperf=>imperf; Perf=>perf};
|
||||
n = let v0 = init (imperf ! (VImperfect Sg P1)) + "н"
|
||||
in (mkNoun (v0+"е")
|
||||
(v0+"ия")
|
||||
(v0+"ия")
|
||||
(v0+"е")
|
||||
ANeut).s;
|
||||
vtype = VNormal;
|
||||
lock_V=<>
|
||||
} ;
|
||||
@@ -72,12 +66,6 @@ oper
|
||||
singleV : VTable -> V ;
|
||||
singleV vtable = {
|
||||
s = \\_=>vtable;
|
||||
n = let v0 = init (vtable ! (VImperfect Sg P1)) + "н"
|
||||
in (mkNoun (v0+"е")
|
||||
(v0+"ия")
|
||||
(v0+"ия")
|
||||
(v0+"е")
|
||||
ANeut).s;
|
||||
vtype = VNormal;
|
||||
lock_V=<>
|
||||
} ;
|
||||
@@ -278,8 +266,18 @@ oper
|
||||
|
||||
--2 Proper Names
|
||||
--
|
||||
mkPN : Str -> Gender -> PN ;
|
||||
mkPN s g = {s = s; g = g ; lock_PN = <>} ;
|
||||
|
||||
masculine : Gender = Masc ;
|
||||
feminine : Gender = Fem ;
|
||||
neutr : Gender = Neut ;
|
||||
|
||||
mkPN = overload {
|
||||
mkPN : Str -> PN = \s -> {s = s; gn = GSg Masc ; lock_PN = <>} ;
|
||||
mkPN : Str -> Gender -> PN =
|
||||
\s,g -> {s = s; gn = GSg g ; lock_PN = <>} ;
|
||||
mkPN : Str -> GenNum -> PN =
|
||||
\s,gn -> {s = s; gn = gn ; lock_PN = <>} ;
|
||||
} ;
|
||||
|
||||
|
||||
--2 IAdv
|
||||
|
||||
@@ -42,7 +42,7 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in {
|
||||
RObj c => linCase c Pos ++ pn.s;
|
||||
_ => pn.s
|
||||
} ;
|
||||
gn = GSg pn.g ;
|
||||
gn = pn.gn ;
|
||||
p = NounP3 Pos
|
||||
} ;
|
||||
UsePron p = p ;
|
||||
|
||||
@@ -978,10 +978,15 @@ oper
|
||||
mkN055 : Str -> N ;
|
||||
mkN055 base = let v0 = tk 1 base;
|
||||
g = ANeut
|
||||
in {s = mkNoun (v0+"о")
|
||||
(v0+"а")
|
||||
(v0+"а")
|
||||
(v0+"о")
|
||||
in {s = variants {
|
||||
mkNoun (v0+"о")
|
||||
(v0+"а")
|
||||
(v0+"а")
|
||||
(v0+"о") ;
|
||||
mkNoun (v0+"о")
|
||||
(v0+"ета")
|
||||
(v0+"ета")
|
||||
(v0+"о")}
|
||||
g ;
|
||||
rel = \\_ => base ; relType = Pref ;
|
||||
g = g ;
|
||||
@@ -990,10 +995,15 @@ oper
|
||||
mkN056 : Str -> N ;
|
||||
mkN056 base = let v0 = tk 1 base;
|
||||
g = ANeut
|
||||
in {s = mkNoun (v0+"о")
|
||||
(v0+"а")
|
||||
(v0+"а")
|
||||
(v0+"о")
|
||||
in {s = variants {
|
||||
mkNoun (v0+"о")
|
||||
(v0+"а")
|
||||
(v0+"а")
|
||||
(v0+"о") ;
|
||||
mkNoun (v0+"о")
|
||||
(v0+"е")
|
||||
(v0+"а")
|
||||
(v0+"о")}
|
||||
g ;
|
||||
rel = \\_ => base ; relType = Pref ;
|
||||
g = g ;
|
||||
@@ -2088,17 +2098,21 @@ oper
|
||||
(v0+"яй")
|
||||
(v0+"яне") ;
|
||||
mkV188 : Str -> VTable ;
|
||||
mkV188 base = let v0 = tk 2 base
|
||||
in mkVerb (v0+"ам")
|
||||
(v0+"ае")
|
||||
(v0+"ах")
|
||||
(v0+"ах")
|
||||
(v0+"ал")
|
||||
(v0+"ал")
|
||||
(v0+"ан")
|
||||
(v0+"ащ")
|
||||
(v0+"ай")
|
||||
(v0+"ане") ;
|
||||
mkV188 base = let v0 = tk 2 base;
|
||||
vt = mkVerb base
|
||||
(v0+"ае")
|
||||
(v0+"аех")
|
||||
(v0+"аех")
|
||||
(v0+"ал")
|
||||
(v0+"ал")
|
||||
(v0+"ан")
|
||||
(v0+"ащ")
|
||||
(v0+"ай")
|
||||
(v0+"ане")
|
||||
in table {
|
||||
VAorist Sg (P2|P3) => v0+"аеше";
|
||||
vform => vt ! vform
|
||||
} ;
|
||||
|
||||
adjAdv : A -> Str -> A =
|
||||
\a,adv -> a ** {adv = adv} ;
|
||||
|
||||
@@ -469,7 +469,7 @@ resource ResBul = ParamX ** open Prelude, Predef in {
|
||||
|
||||
ia2e : Str -> Str = -- to be used when the next syllable has vowel different from "а","ъ","о" or "у"
|
||||
\s -> case s of {
|
||||
x@(_*+_) + "я" + y@(("б"|"в"|"г"|"д"|"ж"|"з"|"к"|"л"|"м"|"н"|"п"|"р"|"с"|"т"|"ф"|"х"|"ц"|"ч"|"ш")*)
|
||||
x + "я" + y@(["бвгджзклмнпрстфхцчш"]*)
|
||||
=> x+"е"+y;
|
||||
_ => s
|
||||
};
|
||||
|
||||
@@ -31,6 +31,10 @@ concrete SentenceBul of Sentence = CatBul ** open Prelude, ResBul in {
|
||||
} ++ compl ;
|
||||
} ;
|
||||
|
||||
AdvImp adv imp = {
|
||||
s = \\pol,gennum => adv.s ++ imp.s ! pol ! gennum
|
||||
} ;
|
||||
|
||||
SlashVP np slash = {
|
||||
s = \\agr => (mkClause (np.s ! RSubj) np.gn np.p {s = slash.s ;
|
||||
ad = slash.ad ;
|
||||
|
||||
@@ -7,10 +7,10 @@ flags
|
||||
coding = utf8 ;
|
||||
|
||||
lin
|
||||
SymbPN i = {s = i.s ; g = Neut} ;
|
||||
IntPN i = {s = i.s ; g = Neut} ;
|
||||
FloatPN i = {s = i.s ; g = Neut} ;
|
||||
NumPN i = {s = i.s ! CFNeut Indef ; g = Neut} ;
|
||||
SymbPN i = {s = i.s ; gn = GSg Neut} ;
|
||||
IntPN i = {s = i.s ; gn = GSg Neut} ;
|
||||
FloatPN i = {s = i.s ; gn = GSg Neut} ;
|
||||
NumPN i = {s = i.s ! CFNeut Indef ; gn = GSg Neut} ;
|
||||
CNIntNP cn i = {
|
||||
s = \\c => cn.s ! NF Sg Indef ++ i.s ;
|
||||
gn = gennum cn.g Sg ;
|
||||
|
||||
@@ -1741,6 +1741,71 @@ VP (Imp Sg P1) => nonExist
|
||||
}
|
||||
} ;
|
||||
|
||||
oper tossir_31b : Str -> Verbum = \tossir ->
|
||||
let t_ = Predef.tk 5 tossir in
|
||||
{s = table {
|
||||
VI Infn => t_ + "ossir" ;
|
||||
VI Ger => t_ + "ossint" ;
|
||||
VP (Pres Ind Pl P1) => t_ + "ossim" ;
|
||||
VP (Pres Ind Sg P1) => t_ + "usso" ;
|
||||
VP (Pres Ind Pl P2) => t_ + "ossiu" ;
|
||||
VP (Pres Ind Sg P2) => t_ + "usses" ;
|
||||
VP (Pres Ind Pl P3) => t_ + "ussen" ;
|
||||
VP (Pres Ind Sg P3) => t_ + "us" ;
|
||||
VP (Pres Sub Pl P1) => t_ + "ossim" ;
|
||||
VP (Pres Sub Sg P1) => t_ + "ussi" ;
|
||||
VP (Pres Sub Pl P2) => t_ + "ossiu" ;
|
||||
VP (Pres Sub Sg P2) => t_ + "ussis" ;
|
||||
VP (Pres Sub Pl P3) => t_ + "ussin" ;
|
||||
VP (Pres Sub Sg P3) => t_ + "ussi" ;
|
||||
VP (Impf Ind Pl P1) => t_ + "ossíem" ;--# notpresent
|
||||
VP (Impf Ind Sg P1) => t_ + "ossia" ;--# notpresent
|
||||
VP (Impf Ind Pl P2) => t_ + "ossíeu" ;--# notpresent
|
||||
VP (Impf Ind Sg P2) => t_ + "ossies" ;--# notpresent
|
||||
VP (Impf Ind Pl P3) => t_ + "ossien" ;--# notpresent
|
||||
VP (Impf Ind Sg P3) => t_ + "ossia" ;--# notpresent
|
||||
VP (Impf Sub Pl P1) => t_ + "ossíssim" ;--# notpresent
|
||||
VP (ImpfSubPlE P1) => t_ + "ossíssem" ;--# notpresent
|
||||
VP (Impf Sub Sg P1) => t_ + "ossís" ;--# notpresent
|
||||
VP (Impf Sub Pl P2) => t_ + "ossíssiu" ;--# notpresent
|
||||
VP (ImpfSubPlE P2) => t_ + "ossísseu" ;--# notpresent
|
||||
VP (Impf Sub Sg P2) => t_ + "ossissis" ;--# notpresent
|
||||
VP ImpfSubSgE => t_ + "ossisses" ;--# notpresent
|
||||
VP (Impf Sub Pl P3) => t_ + "ossissin" ;--# notpresent
|
||||
VP (ImpfSubPlE P3) => t_ + "ossissen" ;--# notpresent
|
||||
VP (Impf Sub Sg P3) => t_ + "ossís" ;--# notpresent
|
||||
VP (Fut Pl P1) => t_ + "ossirem" ;--# notpresent
|
||||
VP (Fut Sg P1) => t_ + "ossiré" ;--# notpresent
|
||||
VP (Fut Pl P2) => t_ + "ossireu" ;--# notpresent
|
||||
VP (Fut Sg P2) => t_ + "ossiràs" ;--# notpresent
|
||||
VP (Fut Pl P3) => t_ + "ossiran" ;--# notpresent
|
||||
VP (Fut Sg P3) => t_ + "ossirà" ;--# notpresent
|
||||
VP (Pret Pl P1) => t_ + "ossírem" ;--# notpresent
|
||||
VP (Pret Sg P1) => t_ + "ossí" ;--# notpresent
|
||||
VP (Pret Pl P2) => t_ + "ossíreu" ;--# notpresent
|
||||
VP (Pret Sg P2) => t_ + "ossires" ;--# notpresent
|
||||
VP (Pret Pl P3) => t_ + "ossiren" ;--# notpresent
|
||||
VP (Pret Sg P3) => t_ + "ossí" ;--# notpresent
|
||||
VP (Cond Pl P1) => t_ + "ossiríem" ;--# notpresent
|
||||
VP (Cond Sg P1) => t_ + "ossiria" ;--# notpresent
|
||||
VP (Cond Pl P2) => t_ + "ossiríeu" ;--# notpresent
|
||||
VP (Cond Sg P2) => t_ + "ossiries" ;--# notpresent
|
||||
VP (Cond Pl P3) => t_ + "ossirien" ;--# notpresent
|
||||
VP (Cond Sg P3) => t_ + "ossiria" ;--# notpresent
|
||||
VP (Imp Pl P1) => t_ + "ossim" ;
|
||||
VP (Imp Pl P2) => t_ + "ossiu" ;
|
||||
VP (Imp Sg P2) => t_ + "us" ;
|
||||
VP (Imp Pl P3) => t_ + "ussin" ;
|
||||
VP (Imp Sg P3) => t_ + "ussi" ;
|
||||
VP (Pass Pl Fem) => t_ + "ossides" ;
|
||||
VP (Pass Sg Fem) => t_ + "ossida" ;
|
||||
VP (Pass Pl Masc) => t_ + "ossits" ;
|
||||
VP (Pass Sg Masc) => t_ + "ossit" ;
|
||||
VP (Imp Sg P1) => nonExist
|
||||
}
|
||||
} ;
|
||||
|
||||
|
||||
oper coure_32 : Str -> Verbum = \coure ->
|
||||
let c_ = Predef.tk 4 coure in
|
||||
{s = table {
|
||||
@@ -5595,7 +5660,6 @@ let t_ = Predef.tk 5 tòrcer in
|
||||
VP (Imp Sg P1) => nonExist
|
||||
}
|
||||
} ;
|
||||
--- tossir-- is not in the used source .
|
||||
|
||||
oper trencar_112 : Str -> Verbum = \trencar ->
|
||||
let tren_ = Predef.tk 3 trencar in
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--# -path=.:../romance:../abstract:../common:prelude
|
||||
instance DiffCat of DiffRomance - [partAgr,stare_V,vpAgrSubj,vpAgrClits] = open CommonRomance, PhonoCat, BeschCat, Prelude in {
|
||||
instance DiffCat of DiffRomance - [partAgr,stare_V,vpAgrSubj,vpAgrClits,AFormSimple] = open CommonRomance, PhonoCat, BeschCat, Prelude in {
|
||||
|
||||
flags optimize=noexpand ;
|
||||
coding=utf8 ;
|
||||
@@ -64,7 +64,22 @@ oper
|
||||
}
|
||||
} ;
|
||||
|
||||
|
||||
-- AForm and comparatives
|
||||
param
|
||||
AFormComplex = AF Gender Number | AAttrMasc | AA ;
|
||||
oper
|
||||
AForm = AFormComplex ;
|
||||
aform2aagr : AForm -> AAgr = \a -> case a of {
|
||||
DiffCat.AF g n => aagr g n ;
|
||||
_ => aagr Masc Sg -- "le plus lentement"
|
||||
} ;
|
||||
genNum2Aform : Gender -> Number -> AForm = DiffCat.AF ;
|
||||
genNumPos2Aform : Gender -> Number -> Bool -> AForm = \g,n,isPre ->
|
||||
case <g,n,isPre> of {
|
||||
<Masc,Sg,True> => AAttrMasc ;
|
||||
_ => genNum2Aform g n
|
||||
} ;
|
||||
piuComp = "més" ;
|
||||
|
||||
possCase = \_,_,c -> prepCase c ;
|
||||
|
||||
|
||||
@@ -45,12 +45,12 @@ lin
|
||||
s1 = heading1 (nounHeading adjective_Category).s ;
|
||||
s2 = frameTable (
|
||||
tr (th "" ++ th (heading singular_Parameter) ++ th (heading plural_Parameter)) ++
|
||||
tr (th (heading masculine_Parameter) ++ td (adj.s ! Posit ! (genNum2Aform Masc Sg)) ++ td (adj.s ! Posit ! (genNum2Aform Masc Pl))) ++
|
||||
tr (th (heading feminine_Parameter) ++ td (adj.s ! Posit ! (genNum2Aform Fem Sg)) ++ td (adj.s ! Posit ! (genNum2Aform Fem Pl)))
|
||||
tr (th (heading masculine_Parameter) ++ td (adj.s ! genNum2Aform Masc Sg) ++ td (adj.s ! genNum2Aform Masc Pl)) ++
|
||||
tr (th (heading feminine_Parameter) ++ td (adj.s ! genNum2Aform Fem Sg) ++ td (adj.s ! genNum2Aform Fem Pl))
|
||||
)
|
||||
} ;
|
||||
|
||||
InflectionAdv adv = {
|
||||
InflectionAdv, InflectionAdV, InflectionAdA, InflectionAdN = \adv -> {
|
||||
t = "adv" ;
|
||||
s1 = heading1 "Adverbi" ;
|
||||
s2 = paragraph adv.s
|
||||
|
||||
@@ -20,6 +20,7 @@ lin escopir_V = verbV (escopir_49 "escopir") ;
|
||||
lin fondre_V = verbV (fondre_57 "fendre") ;
|
||||
lin jeure_V = verbV (jeure_62 "jeure" (True|False)) ;
|
||||
lin omplir_V = verbV (omplir_80 "omplir") ;
|
||||
lin tossir_V = verbV (tossir_31b "tossir") ;
|
||||
lin venir_V = verbV (venir_117 "venir" (True|False)) ;
|
||||
|
||||
}
|
||||
@@ -1102,5 +1102,6 @@ fun escopir_V : V ;
|
||||
fun fondre_V : V ;
|
||||
fun jeure_V : V ;
|
||||
fun omplir_V : V ;
|
||||
fun tossir_V : V ;
|
||||
fun venir_V : V ;
|
||||
}
|
||||
|
||||
@@ -31,8 +31,8 @@ lin
|
||||
big_A = mkA "gros" "grossa" ;
|
||||
bike_N = regFN "bicicleta" ;
|
||||
bird_N = regMN "ocell" ;
|
||||
black_A = compADeg (mkA "negre" "negra" "negres" "negres" "negrament") ;
|
||||
blue_A = compADeg (mkA "blau" "blava" "blaus" "blaves" "blavament") ;
|
||||
black_A = mkA "negre" "negra" "negres" "negres" "negrament" ;
|
||||
blue_A = mkA "blau" "blava" "blaus" "blaves" "blavament" ;
|
||||
boat_N = regFN "barca" ;
|
||||
book_N = regMN "llibre" ;
|
||||
boot_N = regFN "bota" ;
|
||||
@@ -42,7 +42,7 @@ lin
|
||||
break_V2 = dirV2 (verbV (trencar_112 "trencar")) ;
|
||||
broad_A = regADeg "ample" ; -- put it in MorphoCat?: like black_A
|
||||
brother_N2 = deN2 (regMN "germà") ;
|
||||
brown_A = compADeg (mkA "marró" "marrona" "marrons" "marrones" "marronament") ;
|
||||
brown_A = mkA "marró" "marrona" "marrons" "marrones" "marronament" ;
|
||||
butter_N = regFN "mantega" ;
|
||||
buy_V2 = dirV2 (mkV "comprar") ;
|
||||
camera_N = regFN "càmara" ;
|
||||
@@ -75,7 +75,7 @@ lin
|
||||
drink_V2 = dirV2 (verbV (beure_11 "beure")) ;
|
||||
easy_A2V = mkA2V (regA "fácil") dative genitive ;
|
||||
eat_V2 = dirV2 (verbV (envejar_48 "menjar")) ;
|
||||
empty_A = compADeg (mkA "buit" "buida" "buits" "buides" "buidament") ;
|
||||
empty_A = mkA "buit" "buida" "buits" "buides" "buidament" ;
|
||||
enemy_N = regMN "enemic" ; -- enemiga
|
||||
factory_N = regFN "fàbrica" ;
|
||||
father_N2 = deN2 (regMN "pare") ;
|
||||
@@ -92,7 +92,7 @@ lin
|
||||
girl_N = regFN "noia" ;
|
||||
glove_N = regMN "guant" ;
|
||||
gold_N = regMN "or" ;
|
||||
good_A = mkA (prefA "bo" "bon") (mkA "millor") ;
|
||||
good_A = mkA (prefA "bo" "bon" "bé") (mkA "millor") ;
|
||||
go_V = (verbV (anar_4 "anar" 0)) ;
|
||||
green_A = regADeg "verd" ;
|
||||
harbour_N = regMN "port" ;
|
||||
@@ -132,7 +132,7 @@ lin
|
||||
mountain_N = regFN "muntanya" ;
|
||||
music_N = regFN "música" ;
|
||||
narrow_A = regADeg "estret" ;
|
||||
new_A = prefixA (compADeg (mkA "nou" "nova" "nous" "noves" "novament")) ;
|
||||
new_A = prefixA (mkA "nou" "nova" "nous" "noves" "novament") ;
|
||||
newspaper_N = regMN "diari" ; -- periòdic
|
||||
oil_N = regMN "oli" ;
|
||||
old_A = regADeg "vell" ;
|
||||
@@ -195,23 +195,23 @@ lin
|
||||
teacher_N = regMN "mestre" ; -- mestra
|
||||
teach_V2 = dirV2 (mkV "ensenyar") ;
|
||||
television_N = mkN "televisió" "televisions" feminine ; -- televisor masc
|
||||
thick_A = compADeg (mkA "gruixut" "gruixuda" "gruixuts" "gruixudes" "gruixudament") ;
|
||||
thin_A = compADeg (mkA "fi" "fina" "fins" "fines" "finament") ;
|
||||
thick_A = mkA "gruixut" "gruixuda" "gruixuts" "gruixudes" "gruixudament" ;
|
||||
thin_A = mkA "fi" "fina" "fins" "fines" "finament" ;
|
||||
train_N = regMN "tren" ;
|
||||
travel_V = verbV (envejar_48 "viatjar") ;
|
||||
tree_N = regMN "arbre" ;
|
||||
--- trousers_N = regN "pantalón" ; -- masc
|
||||
ugly_A = compADeg (mkA "lleig" "lletja" "lletjos" "lletges" "lletjament") ;
|
||||
ugly_A = mkA "lleig" "lletja" "lletjos" "lletges" "lletjament" ;
|
||||
understand_V2 = dirV2 (verbV (atendre_8 "entendre")) ;
|
||||
university_N = regFN "universitat" ;
|
||||
village_N = regMN "poble" ;
|
||||
wait_V2 = mkV2 (mkV "esperar") dative ;
|
||||
walk_V = mkV "caminar" ;
|
||||
warm_A = compADeg (mkA "tebi" "tèbia" "tebis" "tèbies" "tèbiament") ;
|
||||
warm_A = mkA "tebi" "tèbia" "tebis" "tèbies" "tèbiament" ;
|
||||
war_N = regFN "guerra" ;
|
||||
watch_V2 = dirV2 (mkV "mirar") ;
|
||||
water_N = mkN "aigua" ; -- aigües
|
||||
white_A = compADeg (mkA "blanc" "blanca" "blancs" "blanques" "blancament") ;
|
||||
white_A = mkA "blanc" "blanca" "blancs" "blanques" "blancament" ;
|
||||
window_N = regFN "finestra" ;
|
||||
wine_N = regMN "vi" ;
|
||||
win_V2 = dirV2 (mkV "guanyar") ;
|
||||
@@ -219,8 +219,8 @@ lin
|
||||
wonder_VQ = mkVQ (reflV (mkV "preguntar")) ;
|
||||
wood_N = regFN "fusta" ;
|
||||
write_V2 = dirV2 (verbV (escriure_50 "escriure" True)) ;
|
||||
yellow_A = compADeg (mkA "groc" "groga" "grocs" "grogues" "grogament") ;
|
||||
young_A = compADeg (mkA "jove" "jove" "joves" "joves" "jovement") ;
|
||||
yellow_A = mkA "groc" "groga" "grocs" "grogues" "grogament" ;
|
||||
young_A = mkA "jove" "jove" "joves" "joves" "jovement" ;
|
||||
do_V2 = dirV2 (verbV (fer_56 "fer")) ;
|
||||
now_Adv = mkAdv "ara" ;
|
||||
already_Adv = mkAdv "ja" ;
|
||||
|
||||
@@ -96,11 +96,11 @@ oper
|
||||
|
||||
mkAdjFull : (x1,_,_,_,_,x6 : Str) -> Adj = \bon,bo,prima,prims,primes,primament ->
|
||||
{s = table {
|
||||
ASg Masc AAttr => bon ;
|
||||
ASg Masc APred => bo ;
|
||||
ASg Fem _ => prima ;
|
||||
APl Masc => prims ;
|
||||
APl Fem => primes ;
|
||||
AAttrMasc => bon ;
|
||||
AF Masc Sg => bo ;
|
||||
AF Fem Sg => prima ;
|
||||
AF Masc Pl => prims ;
|
||||
AF Fem Pl => primes ;
|
||||
AA => primament
|
||||
}
|
||||
} ;
|
||||
@@ -121,8 +121,8 @@ oper
|
||||
let fond = Predef.tk 1 fondo
|
||||
in adjBlau fondo (fond + "a") ;
|
||||
|
||||
adjBo : (bo,bon : Str) -> Adj = \bo,bon ->
|
||||
mkAdjFull bon bo (bon + "a") (bon + "s") (bon + "es") (bon + "ament") ;
|
||||
adjBo : (bo,bon,be : Str) -> Adj = \bo,bon,be ->
|
||||
mkAdjFull bon bo (bon + "a") (bon + "s") (bon + "es") be ;
|
||||
|
||||
adjFidel : Str -> Adj = \fidel ->
|
||||
let fidels : Str = case (last fidel) of {
|
||||
|
||||
@@ -334,25 +334,31 @@ oper
|
||||
|
||||
makeNP x g n = {s = (pn2np (mk2PN x g)).s; a = agrP3 g n ; hasClit = False ; isPol = False ; isNeg = False} ** {lock_NP = <>} ;
|
||||
|
||||
mk5A a b c d e =
|
||||
compADeg {s = \\_ => (mkAdj a b c d e).s ; isPre = False ; copTyp = serCopula ; lock_A = <>} ;
|
||||
mk2A a b = compADeg {s = \\_ => (mkAdj2Reg a b).s ; isPre = False ; copTyp = serCopula ; lock_A = <>} ;
|
||||
regA a = compADeg {s = \\_ => (mkAdjReg a).s ; isPre = False ; copTyp = serCopula ; lock_A = <>} ;
|
||||
mk5A a b c d e = compADeg (mkAdj a b c d e) ;
|
||||
mk2A a b = compADeg (mkAdj2Reg a b) ;
|
||||
regA a = compADeg (mkAdjReg a) ;
|
||||
prefA = overload {
|
||||
prefA : A -> A = \a -> a ** {isPre = True} ;
|
||||
prefA : Str -> Str -> A = \bo,bon ->
|
||||
compADeg (lin A {s = \\_ => (adjBo bo bon).s ; isPre = True ; copTyp = serCopula}) ;
|
||||
let adj : A = compADeg (adjBo bo bon (bon+"ament")) ; -- not sure if there is any actual adjective that behaves like this /IL
|
||||
in adj ** {isPre = True} ;
|
||||
prefA : (bo,bon,be : Str) -> A = \bo,bon,be ->
|
||||
let adj : A = compADeg (adjBo bo bon be) ;
|
||||
in adj ** {isPre = True} ;
|
||||
} ;
|
||||
|
||||
mkA2 a p = a ** {c2 = p ; lock_A2 = <>} ;
|
||||
|
||||
mkADeg a b =
|
||||
{s = table {Posit => a.s ! Posit ; _ => b.s ! Posit} ;
|
||||
isPre = a.isPre ; copTyp = serCopula ; lock_A = <>} ;
|
||||
compADeg a =
|
||||
{s = table {Posit => a.s ! Posit ; _ => \\f => "més" ++ a.s ! Posit ! f} ;
|
||||
isPre = a.isPre ; copTyp = a.copTyp ;
|
||||
lock_A = <>} ;
|
||||
mkADeg a b = a ** {
|
||||
compar = \\num => b.s ! AF Masc num ; -- millor, millors
|
||||
isDeg = True } ;
|
||||
compADeg a = lin A
|
||||
{s = a.s ;
|
||||
compar = \\_ => nonExist ;
|
||||
isPre = False ; -- default values
|
||||
copTyp = serCopula ;
|
||||
isDeg = False
|
||||
} ;
|
||||
regADeg a = compADeg (regA a) ;
|
||||
|
||||
mkAdv x = ss x ** {lock_Adv = <>} ;
|
||||
@@ -440,7 +446,7 @@ oper
|
||||
|
||||
special_ppV ve pa = {
|
||||
s = table {
|
||||
VPart g n => (regA pa).s ! Posit ! genNum2Aform g n ;
|
||||
VPart g n => (regA pa).s ! genNum2Aform g n ;
|
||||
p => ve.s ! p
|
||||
} ;
|
||||
lock_V = <> ;
|
||||
@@ -518,7 +524,7 @@ oper
|
||||
mk2A : (lleig,lletja : Str) -> A ;
|
||||
regA : Str -> A ;
|
||||
mkADeg : A -> A -> A ;
|
||||
compADeg : A -> A ;
|
||||
compADeg : Adj -> A ;
|
||||
regADeg : Str -> A ;
|
||||
prefA : overload {
|
||||
prefA : A -> A ; -- gran
|
||||
|
||||
@@ -4,26 +4,58 @@ concrete AdjectiveChi of Adjective = CatChi ** open ResChi, Prelude in {
|
||||
|
||||
PositA a = a ** {hasAdA = False} ;
|
||||
|
||||
--ComparA a np = complexAP (a.s ++ than_s ++ np.s) ;
|
||||
ComparA a np = complexAP (than_s ++ np.s ++ a.s) ;
|
||||
ComparA a np = a ** {
|
||||
s = table {_=> than_s ++ np.s ++ a.s!Attr};
|
||||
hasAdA = False
|
||||
|
||||
UseComparA a = complexAP (geng_s ++ a.s) ;
|
||||
};
|
||||
|
||||
AdjOrd ord = complexAP ord.s ;
|
||||
UseComparA a = a ** {
|
||||
s = table { _=> geng_s ++ a.s!Attr};
|
||||
hasAdA = False
|
||||
};
|
||||
|
||||
-- CAdvAP ad ap np = complexAP (ap.s ++ ad.s ++ ad.p ++ np.s) ;
|
||||
CAdvAP ad ap np = complexAP (ad.s++ np.s++ad.p++ap.s ) ; --modified by ChenPeng 11.24
|
||||
AdjOrd ord = ord ** {
|
||||
s = table {
|
||||
adjPlace => ord.s
|
||||
-- Attr => ord.s; --"first is he" ;
|
||||
-- Pred => ord.s --"he is first"
|
||||
} ;
|
||||
hasAdA = False;
|
||||
monoSyl = True -- to do and figure out in relation to Ord = {s : Str}
|
||||
};
|
||||
|
||||
ComplA2 a np = complexAP (appPrep a.c2 np.s ++ a.s) ;
|
||||
CAdvAP ad ap np = ap ** {
|
||||
s = table {adjPlace => ad.s ++ np.s ++ ad.p ++ ap.s!adjPlace}
|
||||
};
|
||||
|
||||
ReflA2 a = complexAP (a.s ++ appPrep a.c2 reflPron) ;
|
||||
ComplA2 a np = a ** {
|
||||
s= table { adjPlace => appPrep a.c2 np.s ++ a.s!adjPlace};
|
||||
hasAdA = False
|
||||
};
|
||||
|
||||
SentAP ap sc = complexAP (ap.s ++ sc.s) ;
|
||||
|
||||
AdAP ada ap = {s = ada.s ++ ap.s ; monoSyl = False ; hasAdA = True} ;
|
||||
ReflA2 a = a ** {
|
||||
s = table {adjPlace => a.s!adjPlace ++ appPrep a.c2 reflPron};
|
||||
hasAdA = False
|
||||
};
|
||||
|
||||
|
||||
SentAP ap sc = ap ** {
|
||||
s = table { adjPlace => ap.s ! adjPlace ++ sc.s }
|
||||
} ;
|
||||
|
||||
-- AdAP ada ap = {s = ada.s ++ ap.s ; monoSyl = False ; hasAdA = True} ;
|
||||
AdAP ada ap = ap ** {
|
||||
s = table { adjPlace => ada.s ++ ap.s ! adjPlace };
|
||||
monoSyl = False;
|
||||
hasAdA = True
|
||||
};
|
||||
|
||||
UseA2 a = a ** {hasAdA = False} ;
|
||||
|
||||
AdvAP ap adv = complexAP (adv.s ++ ap.s) ; ----
|
||||
AdvAP ap adv = ap ** {
|
||||
s = table { adjPlace => adv.s ++ ap.s ! adjPlace }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -2,20 +2,20 @@ concrete AdverbChi of Adverb = CatChi **
|
||||
open ResChi, Prelude in {
|
||||
|
||||
lin
|
||||
PositAdvAdj a = {s = a.s ++ "地" ; advType = ATManner ; hasDe = False} ; ---- for all adjs?
|
||||
PositAdvAdj a = {s = a.s!Attr ++ "地" ; advType = ATManner ; hasDe = False} ; ---- for all adjs?
|
||||
|
||||
PrepNP prep np = ss (appPrep prep np.s) ** {advType = prep.advType ; hasDe = prep.hasDe} ; --- should depend on np too ?
|
||||
|
||||
ComparAdvAdj cadv a np = ss (a.s ++ cadv.s ++ cadv.p ++ np.s) ** {advType = ATManner ; hasDe = False} ;
|
||||
ComparAdvAdj cadv a np = ss (a.s!Attr ++ cadv.s ++ cadv.p ++ np.s) ** {advType = ATManner ; hasDe = False} ;
|
||||
|
||||
ComparAdvAdjS cadv a s = ss (a.s ++ cadv.s ++ cadv.p ++ s.s) ** {advType = ATManner ; hasDe = False} ;
|
||||
ComparAdvAdjS cadv a s = ss (a.s!Attr ++ cadv.s ++ cadv.p ++ linS s) ** {advType = ATManner ; hasDe = False} ;
|
||||
|
||||
AdAdv ad adv = adv ** {s = ad.s ++ adv.s} ;
|
||||
|
||||
SubjS subj s = ss (subj.prePart ++ s.s ++ subj.sufPart) ** {advType = ATTime ; hasDe = False} ;
|
||||
SubjS subj s = ss (subj.prePart ++ linS s ++ subj.sufPart) ** {advType = ATTime ; hasDe = False} ;
|
||||
|
||||
AdnCAdv cadv = ss (cadv.s ++ conjThat) ** {advType = ATManner ; hasDe = False} ; -----
|
||||
|
||||
PositAdAAdj a = {s = a.s} ; ----
|
||||
PositAdAAdj a = {s = a.s!Attr} ; ----
|
||||
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ concrete CatChi of Cat = CommonX - [Tense, Temp, Ant, Adv] ** open ResChi, Prelu
|
||||
|
||||
-- Tensed/Untensed
|
||||
|
||||
S = {s : Str} ;
|
||||
S = Sentence ;
|
||||
QS = {s : Bool => Str} ; -- True = direct question (with ma for sentential questions)
|
||||
RS = {s : Str} ;
|
||||
SSlash = {s : Str ; c2 : Preposition} ;
|
||||
@@ -59,7 +59,10 @@ concrete CatChi of Cat = CommonX - [Tense, Temp, Ant, Adv] ** open ResChi, Prelu
|
||||
|
||||
-- Structural
|
||||
|
||||
Conj = {s : ConjForm => {s1,s2 : Str}} ;
|
||||
Conj = {
|
||||
s : ConjForm => {s1,s2 : Str} ; -- different form whether it's used for S, A, N, ...
|
||||
conjType : ConjType -- different placement whether it's and,or,... or if-then
|
||||
} ;
|
||||
Subj = {prePart : Str ; sufPart : Str} ;
|
||||
Prep = Preposition ;
|
||||
|
||||
@@ -84,4 +87,6 @@ concrete CatChi of Cat = CommonX - [Tense, Temp, Ant, Adv] ** open ResChi, Prelu
|
||||
Tense = {s : Str ; t : Aspect} ;
|
||||
Ant = {s : Str ; t : Aspect} ;
|
||||
|
||||
linref
|
||||
S = linS ;
|
||||
}
|
||||
|
||||
@@ -2,33 +2,47 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin
|
||||
|
||||
lin
|
||||
|
||||
ConjS c = conjunctDistrSS (c.s ! CSent) ;
|
||||
ConjS c ss =
|
||||
let conj = c.s ! CSent
|
||||
in case c.conjType of {
|
||||
Jiu => {preJiu = conj.s1 ++ ss.s1 ++ comma ++ ss.preJiu ;
|
||||
postJiu = conj.s2 ++ ss.postJiu} ;
|
||||
NotJiu => {preJiu = conj.s1 ++ ss.s1 ++ conj.s2 ++ ss.preJiu ;
|
||||
postJiu = ss.postJiu}
|
||||
} ;
|
||||
ConjAdv c as = conjunctDistrSS (c.s ! CSent) as ** {advType = as.advType ; hasDe = as.hasDe} ; ---- ??
|
||||
ConjNP c = conjunctDistrSS (c.s ! CPhr CNPhrase) ;
|
||||
ConjAP c as = conjunctDistrSS (c.s ! CPhr CAPhrase) as ** {monoSyl = notB as.monoSyl ; hasAdA = True} ; ---- add de iff as doesn't
|
||||
ConjAP c as = conjunctDistrTable AdjPlace (c.s ! CPhr CAPhrase) as ** {monoSyl = notB as.monoSyl ; hasAdA = True} ; ---- add de iff as doesn't
|
||||
ConjRS c = conjunctDistrSS (c.s ! CSent) ;
|
||||
ConjCN c ns = conjunctDistrSS (c.s ! CPhr CNPhrase) ns ** {c = ns.c} ;
|
||||
|
||||
-- These fun's are generated from the list cat's.
|
||||
|
||||
BaseS = twoSS ;
|
||||
ConsS = consrSS duncomma ;
|
||||
BaseS s t = t ** {
|
||||
s1 = linS s
|
||||
} ;
|
||||
|
||||
ConsS s ss = -- here we do the same thing actually, the crucial split has happened in BaseS
|
||||
ss ** {s1 = linS s ++ comma ++ ss.s1};
|
||||
|
||||
|
||||
BaseAdv x y = twoSS x y ** {advType = x.advType ; hasDe = y.hasDe} ; ---- ??
|
||||
ConsAdv x xs = consrSS duncomma x xs ** {advType = x.advType ; hasDe = xs.hasDe} ; ---- ??
|
||||
BaseNP = twoSS ;
|
||||
ConsNP = consrSS duncomma ;
|
||||
BaseAP x y = twoSS x y ** {monoSyl = y.monoSyl} ;
|
||||
ConsAP x xs = consrSS duncomma x xs ** {monoSyl = xs.monoSyl} ;
|
||||
BaseAP x y = twoTable AdjPlace x y ** {monoSyl = y.monoSyl} ;
|
||||
ConsAP x xs = consrTable AdjPlace duncomma x xs ** {monoSyl = xs.monoSyl} ;
|
||||
BaseRS = twoSS ;
|
||||
ConsRS = consrSS duncomma ;
|
||||
BaseCN x y = twoSS x y ** {c = x.c} ; --- classified comes from first part ; should it rather be ge?
|
||||
ConsCN x xs = consrSS duncomma x xs ** {c = x.c} ;
|
||||
|
||||
lincat
|
||||
[S] = {s1,s2 : Str} ;
|
||||
--[S] = ConjType => {s1,s2 : Str} ;
|
||||
[S] = {s1,preJiu,postJiu : Str} ;
|
||||
[Adv] = {s1,s2 : Str ; advType : AdvType ; hasDe : Bool} ;
|
||||
[NP] = {s1,s2 : Str} ;
|
||||
[AP] = {s1,s2 : Str ; monoSyl : Bool} ;
|
||||
[AP] = {s1,s2 : AdjPlace => Str ; monoSyl : Bool} ;
|
||||
[RS] = {s1,s2 : Str} ;
|
||||
[CN] = {s1,s2 : Str ; c : Str} ;
|
||||
|
||||
|
||||
@@ -19,10 +19,10 @@ lin
|
||||
InflectionA, InflectionA2 = \adj -> {
|
||||
t = "a" ;
|
||||
s1 = heading1 "Adjective" ;
|
||||
s2 = adj.s
|
||||
s2 = adj.s!Attr
|
||||
} ;
|
||||
|
||||
InflectionAdv adv = {
|
||||
InflectionAdv, InflectionAdV, InflectionAdA, InflectionAdN = \adv -> {
|
||||
t = "adv" ;
|
||||
s1 = heading1 "Adverb" ;
|
||||
s2 = paragraph adv.s
|
||||
|
||||
19
src/chinese/ExtendChi.gf
Normal file
19
src/chinese/ExtendChi.gf
Normal file
@@ -0,0 +1,19 @@
|
||||
--# -path=alltenses:../common:../abstract
|
||||
|
||||
concrete ExtendChi of Extend = CatChi **
|
||||
ExtendFunctor - [ProDrop,ComplDirectVS, ComplDirectVQ]
|
||||
with (Grammar=GrammarChi) ** open Prelude, ResChi in {
|
||||
|
||||
lin
|
||||
ProDrop pron = pron ** {s = []} ;
|
||||
ComplDirectVS vs utt =
|
||||
AdvVP (UseV <lin V vs : V>)
|
||||
(mkAdv (":" ++ quoted utt.s)) ; -- DEFAULT complement added as Adv in quotes
|
||||
ComplDirectVQ vq utt =
|
||||
AdvVP (UseV <lin V vq : V>)
|
||||
(mkAdv (":" ++ quoted utt.s)) ; -- DEFAULT complement added as Adv in quotes
|
||||
|
||||
oper
|
||||
mkAdv : Str -> Adv ;
|
||||
mkAdv str = lin Adv {s = str ; advType = ATManner ; hasDe = False} ;
|
||||
};
|
||||
@@ -18,7 +18,7 @@ concrete ExtraChi of ExtraChiAbs = CatChi **
|
||||
BaseVPS = twoSS ;
|
||||
ConsVPS = consrSS duncomma ;
|
||||
|
||||
PredVPS np vps = {s = np.s ++ vps.s} ;
|
||||
PredVPS np vps = {preJiu = np.s ; postJiu = vps.s} ;
|
||||
|
||||
MkVPI vp = {s = (mkClause [] vp).s ! Pos ! APlain} ; --- ?? almost just a copy of VPS
|
||||
ConjVPI c = conjunctDistrSS (c.s ! CSent) ;
|
||||
@@ -37,8 +37,8 @@ concrete ExtraChi of ExtraChiAbs = CatChi **
|
||||
Aspect = {s : Str ; a : ResChi.Aspect} ;
|
||||
lin
|
||||
CompBareAP ap = case ap.hasAdA of {
|
||||
True => insertObj (mkNP ap.s) (predV nocopula []) ;
|
||||
False => insertObj (mkNP ap.s) (predV hen_copula [])
|
||||
True => insertObj (mkNP (ap.s!Pred)) (predV nocopula []) ;
|
||||
False => insertObj (mkNP (ap.s!Pred)) (predV hen_copula [])
|
||||
} ;
|
||||
QuestRepV cl = {
|
||||
s = \\_,p,a => ---- also for indirect questions?
|
||||
@@ -49,7 +49,8 @@ concrete ExtraChi of ExtraChiAbs = CatChi **
|
||||
APerf => v.s ++ "不" ++ v.sn ++ v.pp ;
|
||||
ADurStat => v.s ++ "不" ++ v.sn ;
|
||||
ADurProg => v.s ++ v.neg ++ v.dp ++ v.sn ; -- mei or bu
|
||||
AExper => v.s ++ v.neg ++ v.sn ++ v.ep
|
||||
AExper => v.s ++ v.neg ++ v.sn ++ v.ep ;
|
||||
AFut => jiu_s ++ v.s ++ v.neg ++ v.sn ++ v.ep -- TODO check placement of jiang
|
||||
}
|
||||
in
|
||||
cl.np ++ cl.vp.prePart ++ verb ++ cl.vp.compl
|
||||
|
||||
@@ -12,7 +12,7 @@ concrete IdiomChi of Idiom = CatChi ** open Prelude, ResChi in {
|
||||
---- it is John who did it
|
||||
CleftNP np rs = mkClause rs.s copula np.s ; -- did it + de + is I
|
||||
|
||||
CleftAdv ad s = mkClause (s.s ++ possessive_s) copula ad.s ; -- she sleeps + de + is here
|
||||
CleftAdv ad s = mkClause (linS s ++ possessive_s) copula ad.s ; -- she sleeps + de + is here
|
||||
|
||||
ExistNP np = mkClause [] (regVerb you_s) np.s ; ---- infl of you
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ lin
|
||||
tree_N = mkN "树" "棵"; -- "shu" "ke"
|
||||
big_A = mkA "大" ; -- "da"
|
||||
small_A = mkA "小" ; -- "xiao"
|
||||
green_A = mkA "绿" ; -- "lv"
|
||||
green_A = colourA "绿" ; -- "lv"
|
||||
walk_V = mkV "走" ; -- "zou"
|
||||
sleep_V = mkV "睡觉" ; -- "shui"
|
||||
love_V2 = mkV2 "爱" ; -- "ai"
|
||||
@@ -159,10 +159,10 @@ ashes_N = mkN "灰" [];
|
||||
burn_V = mkV "烧" ;
|
||||
road_N = mkN "路" "条";
|
||||
mountain_N = mkN "山" "座";
|
||||
red_A = mkA "红" ;
|
||||
yellow_A = mkA "黄" ;
|
||||
white_A = mkA "白" ;
|
||||
black_A = mkA "黑" ;
|
||||
red_A = colourA "红" ;
|
||||
yellow_A = colourA "黄" ;
|
||||
white_A = colourA "白" ;
|
||||
black_A = colourA "黑" ;
|
||||
night_N = mkN "夜晚" ; -- [mark] "夜晚" 's classifier is "个"
|
||||
day_N = mkN "白天" []; -- [mark] "白天" -> "天", "天" itself is classifier
|
||||
year_N = mkN "年" [] ; -- [mark] "年" itself is classifier
|
||||
@@ -357,7 +357,7 @@ lin
|
||||
beg_V2V = mkV2V (mkV "乞求") ; -- beg him to do something
|
||||
break_V2 = mkV2 "打破" ;
|
||||
broad_A = mkA "宽" ;
|
||||
brown_A = mkA "棕" ;
|
||||
brown_A = colourA "棕" ;
|
||||
clever_A = mkA "聪明" ;
|
||||
close_V2 = mkV2 "关闭" ;
|
||||
easy_A2V = mkA2 "简单" ;
|
||||
@@ -376,6 +376,4 @@ lin
|
||||
ugly_A = mkA "丑" ;
|
||||
uncertain_A = mkA "不确定" ; -- [mark] "不确定": 不("un-") + 确定("certain")
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -12,6 +12,7 @@ concrete NounChi of Noun = CatChi ** open ResChi, Prelude in {
|
||||
|
||||
DetNP det = {s = case det.detType of {
|
||||
DTFull Pl => det.s ++ xie_s ;
|
||||
DTPoss => det.s ;
|
||||
_ => det.s ++ ge_s
|
||||
} ;
|
||||
} ; ----
|
||||
@@ -63,8 +64,8 @@ concrete NounChi of Noun = CatChi ** open ResChi, Prelude in {
|
||||
|
||||
AdNum adn num = {s = adn.s ++ num.s ; hasC = True} ;
|
||||
|
||||
OrdSuperl a = {s = superlative_s ++ a.s} ;
|
||||
OrdNumeralSuperl n a = {s = ordinal_s ++ n.s ++ superlative_s ++ a.s} ; ---- to check AR 24/8/2014
|
||||
OrdSuperl a = {s = superlative_s ++ a.s ! Attr} ;
|
||||
OrdNumeralSuperl n a = {s = ordinal_s ++ n.s ++ superlative_s ++ a.s ! Attr} ; ---- to check AR 24/8/2014
|
||||
|
||||
DefArt = mkQuant [] [] DTPoss ; -- use that_Quant if you want the_s
|
||||
IndefArt = mkQuant yi_s [] DTNum ; -- (DTFull Sg) ; -- empty in the plural
|
||||
@@ -80,8 +81,8 @@ concrete NounChi of Noun = CatChi ** open ResChi, Prelude in {
|
||||
ComplN3 f x = {s = appPrep f.c2 x.s ++ f.s ; c = f.c ; c2 = f.c3} ;
|
||||
|
||||
AdjCN ap cn = case ap.monoSyl of {
|
||||
True => {s = ap.s ++ cn.s ; c = cn.c} ;
|
||||
False => {s = ap.s ++ possessive_s ++ cn.s ; c = cn.c}
|
||||
True => {s = ap.s ! Attr ++ cn.s ; c = cn.c} ;
|
||||
False => {s = ap.s ! Attr ++ possessive_s ++ cn.s ; c = cn.c}
|
||||
} ;
|
||||
|
||||
RelCN cn rs = {s = rs.s ++ cn.s ; c = cn.c} ;
|
||||
|
||||
@@ -35,6 +35,9 @@ oper
|
||||
= \a,b -> lin A (mkAdj a b) ;
|
||||
} ;
|
||||
|
||||
colourA : Str -> A ; -- colour Adjectives have a "色" when used as predicative
|
||||
colourA colour = lin A (colourAdj colour);
|
||||
|
||||
mkA2 = overload {
|
||||
mkA2 : Str -> A2
|
||||
= \a -> lin A2 (simpleAdj a ** {c2 = emptyPrep}) ;
|
||||
@@ -190,9 +193,9 @@ oper
|
||||
= \s -> lin Subj (ResChi.mkSubj s []) ;
|
||||
mkConj = overload {
|
||||
mkConj : Str -> Conj
|
||||
= \s -> lin Conj {s = \\_ => mkConjForm s} ;
|
||||
= \s -> lin Conj {s = \\_ => mkConjForm s ; conjType = NotJiu} ;
|
||||
mkConj : (both,and : Str) -> Conj
|
||||
= \s,t -> lin Conj {s = \\_ => mkConjForm2 s t} ;
|
||||
= \s,t -> lin Conj {s = \\_ => mkConjForm2 s t ; conjType = NotJiu} ;
|
||||
} ;
|
||||
mkpDet : Str -> Det
|
||||
= \s -> lin Det {s = word s ; detType = DTFull Sg} ;
|
||||
|
||||
@@ -3,7 +3,7 @@ concrete PhraseChi of Phrase = CatChi ** open Prelude, ResChi in {
|
||||
lin
|
||||
PhrUtt pconj utt voc = {s = pconj.s ++ voc.s ++ utt.s} ;
|
||||
|
||||
UttS s = s ;
|
||||
UttS s = ss (linS s) ;
|
||||
UttQS qs = ss (qs.s ! True) ;
|
||||
UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p} ;
|
||||
UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p} ;
|
||||
@@ -13,7 +13,7 @@ concrete PhraseChi of Phrase = CatChi ** open Prelude, ResChi in {
|
||||
UttIAdv iadv = iadv ;
|
||||
UttNP np = np ;
|
||||
UttCN cn = cn ;
|
||||
UttAP ap = ap ;
|
||||
UttAP ap = {s = ap.s!Attr} ;
|
||||
UttCard x = x ;
|
||||
UttVP vp = ss (infVP vp) ;
|
||||
UttAdv adv = adv ;
|
||||
|
||||
@@ -7,21 +7,7 @@ concrete QuestionChi of Question = CatChi **
|
||||
lin
|
||||
|
||||
QuestCl cl = {
|
||||
s = table {
|
||||
True => \\p,a => cl.s ! p ! a ++ question_s ; -- redup question as variant in ExtraChi
|
||||
False => \\p,a => --- code copied from ExtraChi
|
||||
let
|
||||
v = cl.vp.verb ;
|
||||
verb = case a of {
|
||||
APlain => v.s ++ v.neg ++ v.sn ;
|
||||
APerf => v.s ++ neg_s ++ v.sn ++ v.pp ;
|
||||
ADurStat => v.s ++ neg_s ++ v.sn ;
|
||||
ADurProg => v.s ++ v.neg ++ v.dp ++ v.sn ; -- mei or bu
|
||||
AExper => v.s ++ v.neg ++ v.sn ++ v.ep
|
||||
}
|
||||
in
|
||||
cl.np ++ cl.vp.prePart ++ verb ++ cl.vp.compl
|
||||
}
|
||||
s = \\b,p,a => cl.s ! p ! a ++ question_s ; -- redup question as variant in ExtraChi
|
||||
} ;
|
||||
|
||||
QuestVP ip vp = {
|
||||
|
||||
@@ -42,6 +42,8 @@ resource ResChi = ParamX ** open Prelude in {
|
||||
geng_s = "更" ; -- more, in comparison
|
||||
hen_s = "很" ; -- very, or predicating a monosyllabic adjective
|
||||
taN_s = "它" ;
|
||||
jiu_s = "就" ;
|
||||
hui_s = "会" ;
|
||||
|
||||
zai_V = mkVerb "在" [] [] [] [] "不" ;
|
||||
fullstop_s = "。" ;
|
||||
@@ -89,15 +91,17 @@ resource ResChi = ParamX ** open Prelude in {
|
||||
-- parameters
|
||||
|
||||
param
|
||||
Aspect = APlain | APerf | ADurStat | ADurProg | AExper ; ---- APlain added by AR
|
||||
Aspect = APlain | APerf | ADurStat | ADurProg | AExper | AFut ; ---- APlain added by AR
|
||||
ConjForm = CPhr CPosType | CSent;
|
||||
ConjType = Jiu | NotJiu ; -- to put conjunction in the right place in ConjS: "I sleep *and* she walks" vs. "if I sleep, she *then* walks"
|
||||
CPosType = CAPhrase | CNPhrase | CVPhrase ;
|
||||
DeForm = DeNoun | NdNoun ; -- parameter created for noun with/out partical "de"
|
||||
|
||||
AdvType = ATPlace Bool | ATTime | ATManner | ATPoss ; -- ATPlace True = has zai_s already
|
||||
|
||||
-- parts of speech
|
||||
AdjPlace = Attr | Pred ; -- a green cat / the cat is green colour
|
||||
|
||||
-- parts of speech
|
||||
oper
|
||||
|
||||
VP = {
|
||||
@@ -113,21 +117,35 @@ oper
|
||||
-- for morphology
|
||||
|
||||
Noun : Type = {s : Str ; c : Str} ;
|
||||
Adj : Type = {s : Str ; monoSyl: Bool} ;
|
||||
Adj : Type = {s : AdjPlace => Str ; monoSyl: Bool} ;
|
||||
Verb : Type = {s,sn : Str ; pp,ds,dp,ep : Str ; neg : Str} ; --- sn=[] needed for "hen" as copula
|
||||
|
||||
regNoun : Str -> Str -> Noun = \s,c -> {s = word s ; c = word c};
|
||||
|
||||
mkAdj : Str -> Bool -> Adj = \s,b -> {s = word s ; monoSyl = b};
|
||||
mkAdj : Str -> Bool -> Adj = \s,b -> {s =
|
||||
table {
|
||||
_ => word s
|
||||
};
|
||||
monoSyl = b};
|
||||
|
||||
complexAP : Str -> Adj ** {hasAdA : Bool} =
|
||||
\s -> {s = s ; monoSyl = False ; hasAdA = False} ; --- not used for adding AdA
|
||||
\s -> mkAdj s False ** {hasAdA = False} ; --- not used for adding AdA
|
||||
|
||||
simpleAdj : Str -> Adj = \s -> case s of {
|
||||
? => mkAdj s True ; -- monosyllabic
|
||||
_ => mkAdj s False
|
||||
} ;
|
||||
|
||||
colourAdj : Str -> Adj = \s -> {
|
||||
s = table {
|
||||
Attr => word s ;
|
||||
Pred => word s ++ "色"
|
||||
};
|
||||
monoSyl = case s of {
|
||||
? => True ;
|
||||
_ => False }
|
||||
};
|
||||
|
||||
copula : Verb = mkVerb "是" [] [] [] [] "不" ;
|
||||
hen_copula : Verb =
|
||||
{s = hen_s ; sn = [] ; pp = [] ; ds = [] ; dp = [] ; ep = [] ; neg = "不"} ; ---
|
||||
@@ -151,14 +169,16 @@ oper
|
||||
APerf => v.s ++ v.pp ;
|
||||
ADurStat => v.s ++ v.ds ;
|
||||
ADurProg => v.dp ++ v.s ;
|
||||
AExper => v.s ++ v.ep
|
||||
AExper => v.s ++ v.ep ;
|
||||
AFut => hui_s ++ v.s
|
||||
} ;
|
||||
Neg => table {
|
||||
APlain => v.neg ++ v.sn ; --- neg?
|
||||
APerf => "不" ++ v.sn ++ v.pp ;
|
||||
ADurStat => "不" ++ v.sn ;
|
||||
ADurProg => v.neg ++ v.dp ++ v.sn ; -- mei or bu
|
||||
AExper => v.neg ++ v.sn ++ v.ep
|
||||
AExper => v.neg ++ v.sn ++ v.ep ;
|
||||
AFut => "不" ++ hui_s ++ v.s
|
||||
}
|
||||
} ;
|
||||
|
||||
@@ -199,12 +219,22 @@ oper
|
||||
|
||||
-- clauses: keep np and vp separate to enable insertion of IAdv
|
||||
|
||||
Clause : Type = {
|
||||
Clause : Type = {
|
||||
s : Polarity => Aspect => Str ;
|
||||
np : Str;
|
||||
vp : VP
|
||||
np : Str ;
|
||||
vp : VP ;
|
||||
postJiu : Polarity => Aspect => Str ;
|
||||
} ;
|
||||
|
||||
Sentence : Type = {
|
||||
preJiu, -- everything until the subject
|
||||
postJiu -- everything after the subject
|
||||
: Str
|
||||
} ;
|
||||
|
||||
linS : Sentence -> Str = \s -> s.preJiu ++ s.postJiu ;
|
||||
simpleS : Str -> Sentence = \s -> {preJiu=s ; postJiu=[]} ;
|
||||
|
||||
|
||||
mkClause = overload {
|
||||
mkClause : Str -> Verb -> Clause = \np,v ->
|
||||
@@ -221,6 +251,7 @@ oper
|
||||
s = \\p,a => vp.topic ++ np ++ vp.prePart ++ useVerb vp.verb ! p ! a ++ vp.compl ++ compl ;
|
||||
np = vp.topic ++ np ;
|
||||
vp = insertObj (ss compl) vp ;
|
||||
postJiu = \\p,a => vp.prePart ++ useVerb vp.verb ! p ! a ++ vp.compl ++ compl ;
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
@@ -31,20 +31,36 @@ concrete SentenceChi of Sentence = CatChi **
|
||||
|
||||
SlashPrep cl prep = cl ** {c2 = prep} ;
|
||||
|
||||
EmbedS s = ss (conjThat ++ s.s) ;
|
||||
EmbedS s = ss (conjThat ++ linS s) ;
|
||||
EmbedQS qs = ss (qs.s ! False) ;
|
||||
EmbedVP vp = ss (infVP vp) ;
|
||||
|
||||
UseCl t p cl = {s = t.s ++ p.s ++ cl.s ! p.p ! t.t} ;
|
||||
UseCl t p cl = {
|
||||
preJiu = cl.np ;
|
||||
postJiu = t.s ++ p.s ++ cl.postJiu ! p.p ! t.t} ;
|
||||
|
||||
UseQCl t p cl = {s = \\isDir => t.s ++ p.s ++ cl.s ! isDir ! p.p ! t.t} ;
|
||||
UseRCl t p cl = {s = t.s ++ p.s ++ cl.s ! p.p ! t.t} ;
|
||||
UseSlash t p cl = {s = t.s ++ p.s ++ cl.s ! p.p ! t.t ; c2 = cl.c2} ;
|
||||
|
||||
AdvS a s = ss (a.s ++ s.s) ;
|
||||
ExtAdvS a s = ss (a.s ++ chcomma ++ s.s) ;
|
||||
AdvS a s = s ** {
|
||||
preJiu = a.s ++ s.preJiu -- tomorrow she
|
||||
} ;
|
||||
|
||||
RelS s r = ss (s.s ++ r.s) ;
|
||||
ExtAdvS a s = s ** {
|
||||
preJiu = a.s ++ chcomma ++ s.preJiu -- tomorrow, she
|
||||
} ;
|
||||
|
||||
SSubjS a subj b = ss (a.s ++ subj.prePart ++ b.s ++ subj.sufPart) ;
|
||||
RelS s r = s ** {
|
||||
postJiu = s.postJiu ++ r.s ;
|
||||
} ;
|
||||
|
||||
-- a="she walks", b="I die"
|
||||
-- result: preJiu="if she walks, I", postJiu="die"
|
||||
SSubjS a subj b = {
|
||||
preJiu = linS a ++ subj.prePart -- if she walks,
|
||||
++ b.preJiu ; -- I
|
||||
postJiu = b.postJiu ++ subj.sufPart -- die
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -30,13 +30,15 @@ and_Conj = {s = table {
|
||||
CPhr CNPhrase => mkConjForm "和" ;
|
||||
CPhr CAPhrase => mkConjForm "而" ;
|
||||
CPhr CVPhrase => mkConjForm "又" ;
|
||||
CSent => mkConjForm "并且" --modified by chenpneg 11.19
|
||||
}
|
||||
CSent => mkConjForm "而" --modified by chenpneg 11.19
|
||||
} ;
|
||||
conjType = NotJiu ;
|
||||
} ;
|
||||
or_Conj = {s = table {
|
||||
CPhr _ => mkConjForm "或" ;
|
||||
CSent => mkConjForm "还是"
|
||||
}
|
||||
} ;
|
||||
conjType = NotJiu ;
|
||||
} ;
|
||||
|
||||
although_Subj = mkSubj "虽然" "但";
|
||||
@@ -52,8 +54,8 @@ when_IAdv = mkIAdvL "什么时候" ;
|
||||
how_IAdv = mkIAdvL "如何" ;
|
||||
all_Predet = ssword "所有" ;
|
||||
many_Det = mkDet (word "很多") DTPoss ;
|
||||
someSg_Det = mkDet (word "一些") Sg ;
|
||||
somePl_Det = mkDet (word "一些") Sg ;
|
||||
someSg_Det = mkDet (word "一些") DTPoss ;
|
||||
somePl_Det = mkDet (word "一些") DTPoss ;
|
||||
few_Det = mkDet "少" Pl ;
|
||||
other_A = mkA "其他" ;
|
||||
|
||||
@@ -122,7 +124,8 @@ both7and_DConj = {s = table { -- modified by chenpeng 11.19
|
||||
CPhr CAPhrase => mkConjForm2 "即" "又" ;
|
||||
CPhr CVPhrase => mkConjForm2 "不但" "而且" ;
|
||||
CSent => mkConjForm2 "不但" "而且"
|
||||
}
|
||||
} ;
|
||||
conjType = NotJiu ;
|
||||
} ;
|
||||
|
||||
by8agent_Prep = mkPrep "被" [] mannerAdvType; -- by for agent in passive
|
||||
@@ -135,7 +138,8 @@ either7or_DConj = {s = table { -- modified by chenpeng 11.19
|
||||
CPhr CAPhrase => mkConjForm2 "要么" "要么" ;
|
||||
CPhr CVPhrase => mkConjForm2 "要么" "要么" ;
|
||||
CSent => mkConjForm2 "要么" "要么"
|
||||
}
|
||||
} ;
|
||||
conjType = NotJiu ;
|
||||
} ;
|
||||
|
||||
everybody_NP = ssword "每个人" ; -- [mark] "每个人": 每(every)+个(classifier)+人(person)
|
||||
@@ -152,11 +156,10 @@ less_CAdv = {s = than_s ; p = word "没更"} ; -- modified by chenpeng 11.24
|
||||
more_CAdv = {s = than_s ; p = word "更"} ; -- modified by chenpeng 11.24
|
||||
most_Predet = ssword "大多数" ;
|
||||
if_then_Conj = {s = table { -- added by chenpeng 11.19
|
||||
CPhr CNPhrase => mkConjForm [] ;
|
||||
CPhr CAPhrase => mkConjForm [] ;
|
||||
CPhr CVPhrase => mkConjForm [] ;
|
||||
CSent => mkConjForm2 "如果" "那么"
|
||||
}
|
||||
CSent => mkConjForm2 "如果" "就" ; -- if she walks, I then sleep
|
||||
CPhr _ => mkConjForm2 "如果" "那么" -- if fish , then rice
|
||||
} ;
|
||||
conjType = Jiu ;
|
||||
} ;
|
||||
nobody_NP = ssword "没人" ;
|
||||
nothing_NP = ssword "没有什么" ;
|
||||
|
||||
@@ -19,7 +19,7 @@ concrete SymbolChi of Symbol = CatChi ** open Prelude, ResChi in {
|
||||
c = cn.c
|
||||
} ;
|
||||
|
||||
SymbS sy = sy ;
|
||||
SymbS sy = simpleS sy.s ;
|
||||
SymbNum sy = sy ;
|
||||
SymbOrd sy = sy ;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ concrete TenseChi of Tense =
|
||||
---- ??
|
||||
TPres = {s = [] ; t = APlain} ;
|
||||
TPast = {s = [] ; t = APerf} ;
|
||||
TFut = {s = [] ; t = ADurProg} ;
|
||||
TFut = {s = [] ; t = AFut} ;
|
||||
TCond = {s = [] ; t = ADurStat} ;
|
||||
|
||||
ASimul = {s = [] ; t = APlain} ;
|
||||
|
||||
@@ -10,10 +10,10 @@ concrete VerbChi of Verb = CatChi ** open ResChi, Prelude in {
|
||||
Slash2V3 v np = insertAdv (mkNP (ba_s ++ np.s)) (predV v v.part) ** {c2 = v.c3 ; isPre = v.hasPrep} ; -- slot for third argument
|
||||
Slash3V3 v np = insertObj (mkNP (appPrep v.c3 np.s)) (predV v v.part) ** {c2 = v.c2 ; isPre = True} ; -- slot for ba object
|
||||
|
||||
SlashV2A v ap = insertObj ap (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
||||
SlashV2A v ap = insertObj {s = ap.s ! Pred} (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
||||
|
||||
SlashV2V v vp = insertObj (mkNP (infVP vp)) (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
||||
SlashV2S v s = insertObj (ss (say_s ++ s.s)) (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
||||
SlashV2S v s = insertObj (ss (say_s ++ linS s)) (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
||||
SlashV2Q v q = insertObj (ss (say_s ++ q.s ! False)) (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
||||
|
||||
ComplVV v vp = {
|
||||
@@ -23,9 +23,9 @@ concrete VerbChi of Verb = CatChi ** open ResChi, Prelude in {
|
||||
isAdj = False ;
|
||||
} ;
|
||||
|
||||
ComplVS v s = insertObj s (predV v []) ;
|
||||
ComplVS v s = insertObj (ss (linS s)) (predV v []) ;
|
||||
ComplVQ v q = insertObj (ss (q.s ! False)) (predV v []) ;
|
||||
ComplVA v ap = insertObj ap (predV v []) ;
|
||||
ComplVA v ap = insertObj {s = ap.s ! Pred} (predV v []) ;
|
||||
|
||||
ComplSlash vp np = case vp.isPre of {
|
||||
--- True => insertAdv (mkNP (ba_s ++ np.s)) vp ; --- ba or vp.c2 ?
|
||||
@@ -62,7 +62,7 @@ concrete VerbChi of Verb = CatChi ** open ResChi, Prelude in {
|
||||
|
||||
PassV2 v = insertAdv (mkNP passive_s) (predV v v.part) ; ----
|
||||
|
||||
CompAP ap = insertObj (mkNP (ap.s ++ de_s)) (predV copula []) ** {isAdj = True} ;
|
||||
CompAP ap = insertObj (mkNP (ap.s ! Pred ++ de_s)) (predV copula []) ** {isAdj = True} ;
|
||||
|
||||
{-
|
||||
CompAP ap = case ap.hasAdA of {
|
||||
|
||||
3
src/chinese/unittest/adjectives.gftest
Normal file
3
src/chinese/unittest/adjectives.gftest
Normal file
@@ -0,0 +1,3 @@
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant that_Quant NumSg) (AdjCN (PositA green_A) (UseN cat_N))) (UseComp (CompAP (PositA green_A))))
|
||||
LangChi: 那 只 绿 猫 是 绿 色 的
|
||||
LangEng: that green cat is green
|
||||
12
src/chinese/unittest/adverbial.gftest
Normal file
12
src/chinese/unittest/adverbial.gftest
Normal file
@@ -0,0 +1,12 @@
|
||||
-- These are not ideal output. TODO: Add new constructor for semantic contexts to achieve the correct output for "地" vs "得"
|
||||
|
||||
Lang: PredVP (AdvNP (UsePron it_Pron) (PositAdvAdj beautiful_A)) (UseV walk_V)
|
||||
LangChi: 漂 亮 地 的 它 走
|
||||
LangEng: it beautifully walks
|
||||
-- Correct LangChi: 它 漂 亮 地 走
|
||||
|
||||
|
||||
Lang: PredVP (UsePron it_Pron) (AdvVP (UseV walk_V) (PositAdvAdj beautiful_A))
|
||||
LangChi: 它 走 得 漂 亮 地
|
||||
LangEng: it walks beautifully
|
||||
-- Correct LangChi: 它 走 得 漂 亮
|
||||
3
src/chinese/unittest/complements.gftest
Normal file
3
src/chinese/unittest/complements.gftest
Normal file
@@ -0,0 +1,3 @@
|
||||
-- One way of saying "he/she gives me a cat"
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron he_Pron) (ComplSlash (Slash2V3 give_V3 (DetCN (DetQuant DefArt NumSg) (UseN cat_N))) (UsePron i_Pron)))
|
||||
LangChi: 他 把 猫 给 我
|
||||
47
src/chinese/unittest/conjunctions.gftest
Normal file
47
src/chinese/unittest/conjunctions.gftest
Normal file
@@ -0,0 +1,47 @@
|
||||
-- Basic conjunctions, no jiu
|
||||
Lang: ConjS and_Conj (BaseS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV sleep_V))) (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron she_Pron) (UseV walk_V))))
|
||||
LangChi: 我 睡 觉 而 她 走
|
||||
LangEng: I sleep and she walks
|
||||
|
||||
Lang: ConjS or_Conj (BaseS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV go_V))) (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron she_Pron) (UseV go_V))))
|
||||
LangChi: 我 去 还 是 她 去
|
||||
LangEng: I go or she goes
|
||||
|
||||
Lang: ConjS either7or_DConj (BaseS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV go_V))) (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron she_Pron) (UseV go_V))))
|
||||
LangChi: 要 么 我 去 要 么 她 去
|
||||
LangEng: either I go or she goes
|
||||
|
||||
-- If-then in different tenses
|
||||
Lang: ConjS if_then_Conj (BaseS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV sleep_V))) (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron she_Pron) (UseV die_V))))
|
||||
LangChi: 如 果 我 睡 觉 , 她 就 死
|
||||
LangEng: if I sleep then she dies
|
||||
|
||||
Lang: ConjS if_then_Conj (BaseS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV sleep_V))) (UseCl (TTAnt TFut ASimul) PPos (PredVP (UsePron she_Pron) (UseV die_V))))
|
||||
LangChi: 如 果 我 睡 觉 , 她 就 会 死
|
||||
LangEng: if I sleep then she will die
|
||||
|
||||
-- contrast: if_Subj, not if_then_Conj
|
||||
Lang: ExtAdvS (SubjS if_Subj (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV sleep_V)))) (UseCl (TTAnt TFut ASimul) PPos (PredVP (UsePron she_Pron) (UseV die_V)))
|
||||
LangChi: 如 果 我 睡 觉 , 她 会 死
|
||||
LangEng: if I sleep , she will die
|
||||
|
||||
-- back to if_then_Conj, now with negations
|
||||
Lang: ConjS if_then_Conj (BaseS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV sleep_V))) (UseCl (TTAnt TPres ASimul) PNeg (PredVP (UsePron she_Pron) (UseV die_V))))
|
||||
LangChi: 如 果 我 睡 觉 , 她 就 不 死
|
||||
LangEng: if I sleep then she doesn't die
|
||||
|
||||
Lang: ConjS if_then_Conj (BaseS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV sleep_V))) (UseCl (TTAnt TFut ASimul) PNeg (PredVP (UsePron she_Pron) (UseV die_V))))
|
||||
LangChi: 如 果 我 睡 觉 , 她 就 不 会 死
|
||||
LangEng: if I sleep then she won't die
|
||||
|
||||
|
||||
|
||||
-- NP conjunctions
|
||||
Lang: ConjNP or_Conj (BaseNP (MassNP (UseN fish_N)) (MassNP (UseN beer_N)))
|
||||
LangChi: 鱼 或 啤 酒
|
||||
LangEng: fish or beer
|
||||
|
||||
--NB: unnatural non-empty strings just for testing purpose
|
||||
Lang: ConjNP if_then_Conj (BaseNP (MassNP (UseN fish_N)) (MassNP (UseN beer_N)))
|
||||
LangChi: 如 果 鱼 那 么 啤 酒
|
||||
LangEng: if fish then beer
|
||||
32
src/chinese/unittest/future.gftest
Normal file
32
src/chinese/unittest/future.gftest
Normal file
@@ -0,0 +1,32 @@
|
||||
Lang: UseCl (TTAnt TFut ASimul) PPos (PredVP (UsePron i_Pron) (UseV die_V))
|
||||
LangChi: 我 会 死
|
||||
LangEng: I will die
|
||||
|
||||
Lang: ExtAdvS (SubjS if_Subj (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV sleep_V)))) (UseCl (TTAnt TFut ASimul) PPos (PredVP (UsePron she_Pron) (UseV walk_V)))
|
||||
LangChi: 如 果 我 睡 觉 , 她 会 走
|
||||
LangEng: if I sleep , she will walk
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ProgrVP (UseV die_V)))
|
||||
LangChi: 我 在 死
|
||||
LangEng: I am dying
|
||||
|
||||
Lang: UseCl (TTAnt TFut ASimul) PNeg (PredVP (UsePron i_Pron) (UseV die_V))
|
||||
LangChi: 我 不 会 死
|
||||
LangEng: I won't die
|
||||
|
||||
Lang: UseQCl (TTAnt TFut ASimul) PPos (QuestCl (PredVP (UsePron i_Pron) (UseV die_V)))
|
||||
-- LangChi: 我 会 不 会 死
|
||||
LangChi: 我 会 死 吗
|
||||
LangEng: will I die
|
||||
|
||||
Lang: UseQCl (TTAnt TFut ASimul) PNeg (QuestCl (PredVP (UsePron i_Pron) (UseV die_V)))
|
||||
LangChi: 我 不 会 死 吗
|
||||
LangEng: won't I die
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (UsePron i_Pron) (ComplVQ know_VQ (UseQCl (TTAnt TFut ASimul) PPos (QuestCl (PredVP (UsePron i_Pron) (UseV die_V))))))
|
||||
LangChi: 我 不 知 道 我 会 死 吗
|
||||
LangEng: I don't know if I will die
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (UsePron i_Pron) (ComplVQ know_VQ (UseQCl (TTAnt TFut ASimul) PNeg (QuestCl (PredVP (UsePron i_Pron) (UseV die_V))))))
|
||||
LangChi: 我 不 知 道 我 不 会 死 吗
|
||||
LangEng: I don't know if I won't die
|
||||
30
src/chinese/unittest/negation.gftest
Normal file
30
src/chinese/unittest/negation.gftest
Normal file
@@ -0,0 +1,30 @@
|
||||
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (MassNP (UseN cat_N)) (UseComp (CompCN (UseN dog_N))))
|
||||
LangEng: cat isn't a dog
|
||||
LangChi: 猫 不 是 狗
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (DetCN (DetQuant this_Quant NumPl) (UseN cat_N)) (UseComp (CompAP (PositA green_A))))
|
||||
LangEng: these cats aren't green
|
||||
LangChi: 这 些 猫 不 是 绿 色 的
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (DetCN (DetQuant that_Quant NumPl) (UseN cat_N)) (UseComp (CompAdv (PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN house_N))))))
|
||||
LangEng: those cats aren't in the house
|
||||
LangChi: 那 些 猫 不 在 房 子 中
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (DetCN (DetQuant this_Quant NumPl) (UseN cat_N)) (ComplVV can8know_VV (UseV walk_V)))
|
||||
LangChi: 这 些 猫 不 会 走
|
||||
LangEng: these cats can't walk
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (DetCN (DetQuant this_Quant NumPl) (UseN cat_N)) (ComplVV can_VV (UseV walk_V)))
|
||||
LangChi: 这 些 猫 不 能 走
|
||||
LangEng: these cats can't walk
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (DetCN (DetQuant this_Quant NumPl) (UseN cat_N)) (ComplVV want_VV (UseV walk_V)))
|
||||
LangChi: 这 些 猫 不 想 走
|
||||
LangEng: these cats don't want to walk
|
||||
|
||||
-- this tree does not make semantic sense in chinese but is compositionally correct due to the direct word for word translation for "must"
|
||||
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (DetCN (DetQuant that_Quant NumPl) (UseN cat_N)) (ComplVV must_VV (UseV walk_V)))
|
||||
LangChi: 那 些 猫 不 必 须 走
|
||||
LangEng: those cats mustn't walk
|
||||
|
||||
-- 没有 and must not , bu ke yi
|
||||
11
src/chinese/unittest/numerals.gftest
Normal file
11
src/chinese/unittest/numerals.gftest
Normal file
@@ -0,0 +1,11 @@
|
||||
Lang: DetCN (DetQuant IndefArt (NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01))))))) (UseN cat_N)
|
||||
LangEng: one cat
|
||||
LangChi: 一 只 猫
|
||||
|
||||
Lang: DetCN (DetQuant this_Quant (NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n5)))))))) (UseN cat_N)
|
||||
LangEng: these five cats
|
||||
LangChi: 这 五 只 猫
|
||||
|
||||
Lang: DetCN (DetQuant (PossPron i_Pron) (NumCard (NumNumeral (num (pot2as3 (pot2 (pot0 n7))))))) (UseN cat_N)
|
||||
LangEng: my seven hundred cats
|
||||
LangChi: 我 的 七 百 只 猫
|
||||
11
src/chinese/unittest/passive.gftest
Normal file
11
src/chinese/unittest/passive.gftest
Normal file
@@ -0,0 +1,11 @@
|
||||
Lang: PredVP (DetCN (DetQuant that_Quant NumSg) (UseN boy_N)) (PassV2 kill_V2)
|
||||
LangEng: that boy is killed
|
||||
LangChi: 那 个 男 孩 被 杀
|
||||
|
||||
Lang: PredVP (DetCN (DetQuant DefArt NumSg) (UseN chair_N)) (PassV2 split_V2)
|
||||
LangEng: the chair is split
|
||||
LangChi: 椅 子 被 劈 开
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (DetCN (DetQuant that_Quant NumSg) (UseN boy_N)) (ComplVV want_VV (PassV2 kill_V2)))
|
||||
LangEng: that boy doesn't want to be killed
|
||||
LangChi: 那 个 男 孩 不 想 被 杀
|
||||
117
src/chinese/unittest/pronouns.gftest
Normal file
117
src/chinese/unittest/pronouns.gftest
Normal file
@@ -0,0 +1,117 @@
|
||||
----------
|
||||
-- Objects
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (ComplSlash (VPSlashPrep (ComplSlash (VPSlashPrep (UseV go_V) with_Prep) (UsePron i_Pron)) to_Prep) (DetCN (DetQuant DefArt NumSg) (UseN moon_N))))
|
||||
LangEng: the cat goes with me to the moon
|
||||
LangChi: 猫 和 我 一 起 往 月 亮 去
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant (PossPron i_Pron) NumPl) (UseN cat_N)) (UseComp (CompAdv (PrepNP with_Prep (DetCN (DetQuant that_Quant NumSg) (UseN person_N))))))
|
||||
LangEng: my cats are with that person
|
||||
LangChi: 我 的 猫 和 那 个 人 一 起
|
||||
|
||||
Lang: UseCl (TTAnt TPast ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a hit_V2) (UsePron he_Pron)))
|
||||
LangEng: I hit him
|
||||
LangChi: 我 打 了 他
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a hit_V2) (UsePron he_Pron)))
|
||||
LangEng: I hit him
|
||||
LangChi: 我 打 他
|
||||
|
||||
-------------
|
||||
-- Possession
|
||||
Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN cat_N)
|
||||
LangEng: my cat
|
||||
LangChi: 我 的 猫
|
||||
|
||||
-- that is my cat
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetNP (DetQuant that_Quant NumSg)) (UseComp (CompNP (DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN cat_N)))))
|
||||
LangEng: that is my cat
|
||||
LangChi: 那 个 是 我 的 猫
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant that_Quant NumSg) (UseN cat_N)) (UseComp (CompNP (DetNP (DetQuant (PossPron i_Pron) NumSg)))))
|
||||
LangEng: that cat is mine
|
||||
LangChi: 那 只 猫 是 我 的
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant (PossPron she_Pron) NumSg) (UseN cat_N)) (UseComp (CompAP (PositA green_A))))
|
||||
LangEng: her cat is green
|
||||
LangChi: 她 的 猫 是 绿 色 的
|
||||
|
||||
-- two variants, different trees
|
||||
-- read a book
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron he_Pron) (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant IndefArt NumSg) (PossNP (UseN book_N) (UsePron she_Pron)))))
|
||||
LangEng: he reads a book of hers
|
||||
LangChi: 他 读 一 本 她 的 书
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron he_Pron) (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant (PossPron she_Pron) NumSg) (UseN book_N))))
|
||||
LangEng: he reads her book
|
||||
LangChi: 他 读 她 的 书
|
||||
|
||||
-- I read his/her father's book
|
||||
Lang: UseCl (TTAnt TPast ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant DefArt NumSg) (PossNP (UseN book_N) (DetCN (DetQuant DefArt NumSg) (PossNP (UseN2 father_N2) (UsePron she_Pron)))))))
|
||||
LangEng: I read the book of the father of hers
|
||||
LangChi: 我 读 了 她 的 父 亲 的 书
|
||||
|
||||
-- Only the noun phrase
|
||||
Lang: MassNP (PossNP (UseN book_N) (UsePron he_Pron))
|
||||
LangEng: book of his
|
||||
LangChi: 他 的 书
|
||||
|
||||
Lang: DetCN (DetQuant (PossPron he_Pron) NumSg) (UseN book_N)
|
||||
LangEng: his book
|
||||
LangChi: 他 的 书
|
||||
|
||||
-- For non-pronoun NPs, multiple trees
|
||||
Lang: AdvNP (MassNP (UseN book_N)) (PrepNP part_Prep (DetCN (DetQuant DefArt NumSg) (UseN cat_N)))
|
||||
LangEng: book of the cat
|
||||
LangChi: 猫 的 书
|
||||
|
||||
Lang: AdvNP (MassNP (UseN book_N)) (PrepNP possess_Prep (DetCN (DetQuant DefArt NumSg) (UseN cat_N)))
|
||||
LangEng: book of the cat
|
||||
LangChi: 猫 的 书
|
||||
|
||||
Lang: MassNP (AdvCN (UseN book_N) (PrepNP part_Prep (DetCN (DetQuant DefArt NumSg) (UseN cat_N))))
|
||||
LangEng: book of the cat
|
||||
LangChi: 猫 的 书
|
||||
|
||||
Lang: MassNP (AdvCN (UseN book_N) (PrepNP possess_Prep (DetCN (DetQuant DefArt NumSg) (UseN cat_N))))
|
||||
LangEng: book of the cat
|
||||
LangChi: 猫 的 书
|
||||
|
||||
Lang: MassNP (ApposCN (AdvCN (UseN book_N) (PrepNP part_Prep (DetNP (DetQuant DefArt NumPl)))) (MassNP (UseN cat_N)))
|
||||
LangEng: book of the cat
|
||||
LangChi: 猫 的 书
|
||||
|
||||
Lang: MassNP (ApposCN (AdvCN (UseN book_N) (PrepNP possess_Prep (DetNP (DetQuant DefArt NumPl)))) (MassNP (UseN cat_N)))
|
||||
LangEng: book of the cat
|
||||
LangChi: 猫 的 书
|
||||
|
||||
Lang: MassNP (ApposCN (PartNP (UseN book_N) (DetNP (DetQuant DefArt NumPl))) (MassNP (UseN cat_N)))
|
||||
LangEng: book of the cat
|
||||
LangChi: 猫 的 书
|
||||
|
||||
Lang: MassNP (ApposCN (PossNP (UseN book_N) (DetNP (DetQuant DefArt NumPl))) (MassNP (UseN cat_N)))
|
||||
LangEng: book of the cat
|
||||
LangChi: 猫 的 书
|
||||
|
||||
Lang: MassNP (PartNP (UseN book_N) (DetCN (DetQuant DefArt NumSg) (UseN cat_N)))
|
||||
LangEng: book of the cat
|
||||
LangChi: 猫 的 书
|
||||
|
||||
Lang: MassNP (PossNP (UseN book_N) (DetCN (DetQuant DefArt NumSg) (UseN cat_N)))
|
||||
LangEng: book of the cat
|
||||
LangChi: 猫 的 书
|
||||
|
||||
-- You can also produce nonsensical variants, in all languages.
|
||||
-- The point of RGL is to be a collection of syntactic structures,
|
||||
-- and application grammarians can choose to use them in any combinations.
|
||||
-- So the following English linearizations aren't *wrong*, they just don't make sense.
|
||||
|
||||
-- If theese Chinese linearizations are merely weird, like the English ones, then they are correct.
|
||||
-- If they feel wrong in the same way as "his cat of my" would in English, then they are wrong.
|
||||
Lang: DetCN (DetQuant (PossPron he_Pron) NumSg) (PossNP (UseN cat_N) (UsePron i_Pron))
|
||||
LangEng: his cat of mine
|
||||
LangChi: 他 的 我 的 猫
|
||||
|
||||
Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (PossNP (UseN cat_N) (UsePron she_Pron))
|
||||
LangEng: my cat of hers
|
||||
LangChi: 我 的 她 的 猫
|
||||
63
src/chinese/unittest/quantifier.gftest
Normal file
63
src/chinese/unittest/quantifier.gftest
Normal file
@@ -0,0 +1,63 @@
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a have_V2) (DetCN somePl_Det (UseN cat_N))))
|
||||
--LangChi: 我 有 一 些 只 猫
|
||||
LangChi: 我 有 一 些 猫
|
||||
LangEng: I have some cats
|
||||
|
||||
Lang: DetCN someSg_Det (UseN water_N)
|
||||
--LangChi: 一 些 滴 水
|
||||
LangChi: 一 些 水
|
||||
LangEng: some water
|
||||
|
||||
Lang: DetCN someSg_Det (UseN beer_N)
|
||||
--LangChi: 一 些 杯 啤 酒
|
||||
LangChi: 一 些 啤 酒
|
||||
LangEng: some beer
|
||||
|
||||
--LangChi: 我 有 几 只 猫
|
||||
--LangEng: I have a few cats
|
||||
|
||||
|
||||
Lang: DetCN (DetQuant IndefArt (NumCard (NumNumeral (num (pot2as3 (pot1as2 pot111)))))) (UseN cat_N)
|
||||
LangChi: 十 一 只 猫
|
||||
LangEng: eleven cats
|
||||
|
||||
Lang: DetCN many_Det (UseN cat_N)
|
||||
LangChi: 很 多 猫
|
||||
LangEng: many cats
|
||||
|
||||
Lang: PredVP (UsePron i_Pron) (ComplVV want_VV (ComplSlash (SlashV2a have_V2) (DetCN many_Det (UseN child_N))))
|
||||
LangChi: 我 想 有 很 多 孩 子
|
||||
LangEng: I want to have many children
|
||||
|
||||
|
||||
Lang: DetCN (DetQuant this_Quant NumPl) (UseN cat_N)
|
||||
LangChi: 这 些 猫
|
||||
LangEng: these cats
|
||||
|
||||
Lang: DetCN (DetQuant this_Quant NumSg) (UseN cat_N)
|
||||
LangChi: 这 只 猫
|
||||
LangEng: this cat
|
||||
|
||||
Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a like_V2) (DetCN (DetQuant that_Quant NumPl) (UseN cat_N)))
|
||||
LangChi: 我 喜 欢 那 些 猫
|
||||
LangEng: I like those cats
|
||||
|
||||
Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a like_V2) (DetCN (DetQuant that_Quant NumSg) (UseN cat_N)))
|
||||
LangChi: 我 喜 欢 那 只 猫
|
||||
LangEng: I like that cat
|
||||
|
||||
Lang: DetCN every_Det (UseN rule_N)
|
||||
LangChi: 每 项 规 则
|
||||
LangEng: every rule
|
||||
|
||||
Lang: DetCN few_Det (UseN child_N)
|
||||
LangChi: 少 些 孩 子
|
||||
LangEng: few children
|
||||
|
||||
Lang: PredVP (UsePron i_Pron) (ComplVV want_VV (ComplSlash (SlashV2a have_V2) (DetCN few_Det (UseN child_N))))
|
||||
LangChi: 我 想 有 少 些 孩 子
|
||||
LangEng: I want to have few children
|
||||
|
||||
Lang: DetCN much_Det (UseN beer_N)
|
||||
LangChi: 多 杯 啤 酒
|
||||
LangEng: much beer
|
||||
57
src/chinese/unittest/relative.gftest
Normal file
57
src/chinese/unittest/relative.gftest
Normal file
@@ -0,0 +1,57 @@
|
||||
--------------------------------------------------------------
|
||||
-- Basics
|
||||
|
||||
Lang: DetCN (DetQuant IndefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV walk_V))))
|
||||
LangEng: a cat that walks
|
||||
LangChi: 一 只 走 的 猫
|
||||
|
||||
Lang: DetCN (DetQuant IndefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a drink_V2) (MassNP (UseN milk_N))))))
|
||||
LangEng: a cat that drinks milk
|
||||
LangChi: 一 只 喝 牛 奶 的 猫
|
||||
|
||||
Lang: MassNP (RelCN (UseN milk_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (SlashV2a drink_V2)))))
|
||||
LangEng: milk that the cat drinks
|
||||
LangChi: 猫 喝 的 牛 奶
|
||||
|
||||
|
||||
Lang: DetCN (DetQuant DefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (VPSlashPrep (UseV walk_V) with_Prep) (DetCN (DetQuant DefArt NumSg) (UseN dog_N))))))
|
||||
LangChi: 和 狗 一 起 走 的 猫
|
||||
LangEng: the cat that walks with the dog
|
||||
|
||||
--------------------------------------------------------------
|
||||
-- Determiner placement
|
||||
|
||||
Lang: DetCN (DetQuant this_Quant NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV walk_V))))
|
||||
LangEng: this cat that walks
|
||||
LangChi: 这 只 走 的 猫
|
||||
|
||||
Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a drink_V2) (MassNP (UseN milk_N))))))
|
||||
LangEng: my cat that drinks milk
|
||||
LangChi: 我 的 喝 牛 奶 的 猫
|
||||
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetNP (DetQuant this_Quant NumSg)) (UseComp (CompNP (DetCN (DetQuant DefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV walk_V))))))))
|
||||
LangEng: this is the cat that walks
|
||||
LangChi: 这 个 是 走 的 猫
|
||||
|
||||
|
||||
--------------------------------------------------------------
|
||||
-- Complex example: "the book that his/her father gave him/her"
|
||||
|
||||
-- 1. His father gave him a book
|
||||
Lang: UseCl (TTAnt TPast ASimul) PPos (PredVP (MassNP (ComplN2 father_N2 (UsePron he_Pron))) (ComplSlash (Slash2V3 give_V3 (MassNP (UseN book_N))) (UsePron he_Pron)))
|
||||
LangChi: 他 父 亲 把 书 给 了 他
|
||||
|
||||
-- 2. the book that the father of her gave her
|
||||
Lang: DetCN (DetQuant DefArt NumSg) (RelCN (UseN book_N) (UseRCl (TTAnt TPast ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (ComplN2 father_N2 (UsePron she_Pron))) (Slash3V3 give_V3 (UsePron she_Pron))))))
|
||||
LangChi: 她 父 亲 给 了 她 的 书
|
||||
LangEng: the book that the father of her gave her
|
||||
|
||||
-- I want to read the book that my father gave me
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplVV want_VV (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN book_N) (UseRCl (TTAnt TPast ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN2 father_N2)) (Slash3V3 give_V3 (UsePron i_Pron))))))))))
|
||||
LangChi: 我 想 读 我 的 父 亲 给 了 我 的 书
|
||||
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplVV want_VV (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN book_N) (UseRCl (TTAnt TPast ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN2 father_N2)) (SlashV2a read_V2)))))))))
|
||||
LangChi: 我 想 读 我 的 父 亲 读 了 的 书
|
||||
LangEng: I want to read the book that my father read
|
||||
44
src/chinese/unittest/tenses.gftest
Normal file
44
src/chinese/unittest/tenses.gftest
Normal file
@@ -0,0 +1,44 @@
|
||||
-------------
|
||||
-- Basics
|
||||
|
||||
Lang: UseCl (TTAnt TPres AAnter) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (UseV walk_V))
|
||||
LangEng: the cat has walked
|
||||
LangChi: 猫 走 了
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant this_Quant NumSg) (UseN cat_N)) (UseV walk_V))
|
||||
LangEng: this cat walks
|
||||
LangChi: 这 只 猫 走
|
||||
|
||||
Lang: UseCl (TTAnt TFut ASimul) PPos (PredVP (DetCN (DetQuant this_Quant NumSg) (UseN cat_N)) (UseV walk_V))
|
||||
LangEng: this cat will walk
|
||||
LangChi: 这 只 猫 会 走
|
||||
|
||||
Lang: PredVP (DetCN (DetQuant this_Quant NumSg) (UseN cat_N)) (ComplVV can8know_VV (UseV walk_V))
|
||||
LangChi: 这 只 猫 会 走
|
||||
LangEng: this cat can walk
|
||||
|
||||
Lang: PredVP (DetCN (DetQuant this_Quant NumSg) (UseN cat_N)) (ComplVV can_VV (UseV walk_V))
|
||||
LangChi: 这 只 猫 能 走
|
||||
LangEng: this cat can walk
|
||||
|
||||
-- As a verbal complement
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN cat_N)) (ComplVV want_VV (UseV walk_V)))
|
||||
LangChi: 我 的 猫 想 走
|
||||
LangEng: my cat wants to walk
|
||||
|
||||
-- Transitive verbs
|
||||
|
||||
Lang: UseCl (TTAnt TPres AAnter) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a eat_V2) (DetCN (DetQuant IndefArt NumSg) (UseN fish_N))))
|
||||
LangChi: 我 吃 了 一 条 鱼
|
||||
LangEng: I have eaten a fish
|
||||
|
||||
-------------
|
||||
-- Conditions
|
||||
|
||||
Lang: AdvS (SubjS if_Subj (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV walk_V)))) (UseCl (TTAnt TFut ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (UseV walk_V)))
|
||||
LangEng: if I walk the cat will walk
|
||||
LangChi: 如 果 我 走 猫 会 走
|
||||
|
||||
Lang: ExtAdvS (SubjS when_Subj (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV walk_V)))) (UseCl (TTAnt TFut ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (UseV walk_V)))
|
||||
LangEng: when I walk , the cat will walk
|
||||
LangChi: 我 走 的 时 候 , 猫 会 走
|
||||
@@ -4,6 +4,8 @@ lincat
|
||||
RNP = Grammar.NP ;
|
||||
RNPList = Grammar.ListNP ;
|
||||
|
||||
X = {s : Str} ; -- for words that are difficult to classify, mainly for MorphoDict
|
||||
|
||||
lin
|
||||
BaseVPS = variants {} ;
|
||||
ConsVPS = variants {} ;
|
||||
@@ -26,12 +28,14 @@ lin
|
||||
MkVPS vp = variants {} ; -- Temp -> Pol -> VP -> VPS ; -- hasn't slept
|
||||
ConjVPS = variants {} ; -- Conj -> [VPS] -> VPS ; -- has walked and won't sleep
|
||||
PredVPS = variants {} ; -- NP -> VPS -> S ; -- has walked and won't sleep
|
||||
RelVPS = variants {} ; -- RP -> VPS -> RS ; -- which won't sleep
|
||||
MkVPI vp = variants {} ; -- Temp -> Pol -> VP -> VPI ; -- to sleep / hasn't slept
|
||||
ConjVPI = variants {} ; -- Conj -> [VPI] -> VPI ; -- has walked and won't sleep
|
||||
ComplVPIVV = variants {} ; -- VV -> VPI -> VP ; -- want to sleep and to walk
|
||||
MkVPS2 = variants {} ; -- : Temp -> Pol -> VPSlash -> VPS2 ; -- has loved
|
||||
ConjVPS2 = variants {} ; -- : Conj -> [VPS2] -> VPS2 ; -- has loved and now hates
|
||||
ComplVPS2 = variants {} ; -- : VPS2 -> NP -> VPS ; -- has loved and now hates that person
|
||||
ReflVPS2 = variants {} ; -- : VPS2 -> RNP -> VPS ; -- have loved and now hate myself and my car
|
||||
MkVPI2 = variants {} ; -- : Ant -> Pol -> VPSlash -> VPI2 ; -- to have loved
|
||||
ConjVPI2 = variants {} ; -- : Conj -> [VPI2] -> VPI2 ; -- to love and have hated
|
||||
ComplVPI2 = variants {} ; -- : VPI2 -> NP -> VPI ; -- to love and hate that person
|
||||
@@ -51,6 +55,8 @@ lin
|
||||
PastPartAgentAP = variants {} ; -- VPSlash -> NP -> AP ; -- (opportunity) lost by the company
|
||||
NominalizeVPSlashNP = variants {} ; -- VPSlash -> NP -> NP ;
|
||||
ProgrVPSlash = variants {} ; -- VPSlash -> VPSlash ;
|
||||
A2VPSlash = variants {} ; -- A2 -> VPSlash ;
|
||||
N2VPSlash = variants {} ; -- N2 -> VPSlash ;
|
||||
ExistsNP = ExistNP ; -- NP -> Cl ; -- there exists a number / there exist numbers
|
||||
ExistCN cn = ExistNP (DetCN (DetQuant IndefArt NumSg) cn) ;
|
||||
ExistMassCN cn = ExistNP (MassNP cn) ;
|
||||
@@ -79,6 +85,7 @@ lin
|
||||
Base_rn_RNP = variants {} ; -- RNP -> NP -> RNPList ; -- myself, John
|
||||
Cons_rr_RNP = variants {} ; -- RNP -> RNPList -> RNPList ; -- my family, myself, John
|
||||
Cons_nr_RNP = variants {} ; -- NP -> RNPList -> RNPList ; -- John, my family, myself
|
||||
ReflPossPron = PossPron he_Pron ; -- : Quant ; -- Swe sin,sitt,sina
|
||||
ComplGenVV = variants {} ; -- VV -> Ant -> Pol -> VP -> VP ; -- want not to have slept
|
||||
ComplSlashPartLast = ComplSlash ;
|
||||
--SlashV2V = variants {} ; -- V2V -> Ant -> Pol -> VPS -> VPSlash ; -- force (her) not to have slept
|
||||
@@ -125,6 +132,12 @@ lin
|
||||
ExistNPQS t p np = UseQCl t p (QuestCl (ExistNP np)) ;
|
||||
ExistIPQS t p np = UseQCl t p (ExistIP np) ;
|
||||
|
||||
lincat
|
||||
X = {s : Str} ;
|
||||
|
||||
lin
|
||||
CardCNCard = variants {} ;
|
||||
|
||||
oper
|
||||
quoted : Str -> Str = \s -> "\"" ++ s ++ "\"" ; ---- TODO bind ; move to Prelude?
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
--# -path=.:../abstract:../common:../api
|
||||
|
||||
concrete AllCze of AllCzeAbs =
|
||||
LangCze
|
||||
LangCze,
|
||||
ExtendCze
|
||||
;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
--# -path=.:../abstract:../common:prelude
|
||||
|
||||
abstract AllCzeAbs =
|
||||
Lang
|
||||
Lang,
|
||||
Extend
|
||||
;
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ concrete CatCze of Cat =
|
||||
VPSlash = {verb : VerbForms ; clit,compl : Agr => Str ; c : ComplementCase} ; ----
|
||||
V = ResCze.VerbForms ;
|
||||
V2 = ResCze.VerbForms ** {c : ComplementCase} ;
|
||||
VS,VQ = ResCze.VerbForms ;
|
||||
|
||||
A = ResCze.AdjForms ;
|
||||
AP = ResCze.Adjective ** {isPost : Bool} ; -- {s : Gender => Number => Case => Str}
|
||||
|
||||
38
src/czech/ExtendCze.gf
Normal file
38
src/czech/ExtendCze.gf
Normal file
@@ -0,0 +1,38 @@
|
||||
concrete ExtendCze of Extend = CatCze **
|
||||
ExtendFunctor - [
|
||||
ReflPossPron
|
||||
---- constant not found (yet)
|
||||
,youPolFem_Pron
|
||||
,UttVPShort
|
||||
,UttAccIP
|
||||
,UttDatIP
|
||||
,SubjRelNP
|
||||
,StrandRelSlash
|
||||
,StrandQuestSlash
|
||||
,SlashBareV2S
|
||||
,PredIAdvVP
|
||||
,PredAPVP
|
||||
,ExistsNP
|
||||
,ExistS
|
||||
,ExistPluralCN
|
||||
,ExistNPQS
|
||||
,ExistMassCN
|
||||
,ExistIPQS
|
||||
,ExistCN
|
||||
,EmptyRelSlash
|
||||
,DetNPMasc
|
||||
,DetNPFem
|
||||
,ComplBareVS
|
||||
,CompIQuant
|
||||
,CompBareCN
|
||||
]
|
||||
with (Grammar = GrammarCze)
|
||||
**
|
||||
open
|
||||
ResCze
|
||||
in {
|
||||
|
||||
lin ReflPossPron = justDemPronFormsAdjective reflPossessivePron ;
|
||||
|
||||
|
||||
}
|
||||
@@ -632,8 +632,6 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> {
|
||||
a : Agr
|
||||
} ;
|
||||
|
||||
---- TODO: possessives
|
||||
|
||||
personalPron : Agr -> PronForms = \a ->
|
||||
{a = a ; cnom = []} **
|
||||
case a of {
|
||||
@@ -753,6 +751,7 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> {
|
||||
|
||||
} ;
|
||||
|
||||
reflPossessivePron : DemPronForms = mladyAdjForms "svy" ** {msnom = "svůj" ; pdat = "svým"} ;
|
||||
|
||||
mkPron : Agr -> PronForms ** {poss : DemPronForms} = \a ->
|
||||
personalPron a ** {poss = possessivePron a} ;
|
||||
|
||||
@@ -23,6 +23,7 @@ lin
|
||||
youSg_Pron = mkPron (Ag (Masc Anim) Sg P2) ;
|
||||
he_Pron = mkPron (Ag (Masc Anim) Sg P3) ;
|
||||
she_Pron = mkPron (Ag Fem Sg P3) ;
|
||||
it_Pron = mkPron (Ag Neutr Sg P3) ;
|
||||
we_Pron = mkPron (Ag (Masc Anim) Pl P1) ;
|
||||
youPl_Pron = mkPron (Ag (Masc Anim) Pl P2) ;
|
||||
they_Pron = mkPron (Ag (Masc Anim) Pl P3) ;
|
||||
|
||||
@@ -56,4 +56,6 @@ concrete AdjectiveDut of Adjective = CatDut ** open ResDut, Prelude in
|
||||
isPre = True
|
||||
} ;
|
||||
|
||||
AdvAP ap adv = {s = \\agr,af => ap.s ! agr ! af ++ adv.s ; isPre = False} ; -- KA: guessed
|
||||
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ concrete CatDut of Cat =
|
||||
|
||||
Pron = Pronoun ;
|
||||
|
||||
Det = Determiner ;
|
||||
Det, DAP = Determiner ;
|
||||
Quant = Quantifier ;
|
||||
Predet = {s : Number => Gender => Str} ;
|
||||
Num = {s : Str ; n : Number ; isNum : Bool} ;
|
||||
|
||||
@@ -59,7 +59,7 @@ lin
|
||||
s2 = dtable
|
||||
} ;
|
||||
|
||||
InflectionAdv adv = {
|
||||
InflectionAdv, InflectionAdV, InflectionAdA, InflectionAdN = \adv -> {
|
||||
t = "adv" ;
|
||||
s1 = heading1 (heading preposition_Category) ;
|
||||
s2 = paragraph adv.s
|
||||
|
||||
@@ -2,7 +2,11 @@
|
||||
|
||||
concrete ExtendDut of Extend =
|
||||
CatDut ** ExtendFunctor
|
||||
- [PastPartAP,ICompAP,IAdvAdv]
|
||||
- [PastPartAP,ICompAP,IAdvAdv,
|
||||
VPS,
|
||||
BaseVPS, ConsVPS,
|
||||
MkVPS, ConjVPS, PredVPS
|
||||
]
|
||||
with
|
||||
(Grammar = GrammarDut) **
|
||||
open
|
||||
@@ -12,8 +16,7 @@ concrete ExtendDut of Extend =
|
||||
Prelude,
|
||||
ParadigmsDut in {
|
||||
|
||||
lin
|
||||
|
||||
lin --# notpresent
|
||||
PastPartAP vp = { --# notpresent
|
||||
s = \\agr,af => let aForm = case vp.isHeavy of { --# notpresent
|
||||
True => APred ; --# notpresent
|
||||
@@ -22,7 +25,94 @@ lin
|
||||
isPre = notB vp.isHeavy ; --# notpresent
|
||||
} ; --# notpresent
|
||||
|
||||
lincat
|
||||
VPS = {s : Order => Agr => Str} ;
|
||||
[VPS] = {s1,s2 : Order => Agr => Str} ;
|
||||
|
||||
lin
|
||||
BaseVPS = twoTable2 Order Agr ;
|
||||
ConsVPS = consrTable2 Order Agr comma ;
|
||||
|
||||
PredVPS np vpi =
|
||||
let
|
||||
subj = np.s ! NPNom ;
|
||||
agr = np.a ;
|
||||
in {
|
||||
s = \\o =>
|
||||
let verb = vpi.s ! o ! agr
|
||||
in case o of {
|
||||
Main => subj ++ verb ;
|
||||
Inv => verb ++ subj ; ---- älskar henne och sover jag
|
||||
Sub => subj ++ verb
|
||||
}
|
||||
} ;
|
||||
|
||||
MkVPS tm p vp = {
|
||||
s = \\o,agr =>
|
||||
let
|
||||
ord = case o of {
|
||||
Sub => True ; -- glue prefix to verb
|
||||
_ => False
|
||||
} ;
|
||||
subj = [] ;
|
||||
t = tm.t ;
|
||||
a = tm.a ;
|
||||
b = p.p ;
|
||||
vform = vForm t agr.g agr.n agr.p o ;
|
||||
auxv = (auxVerb vp.s.aux).s ;
|
||||
vperf = vp.s.s ! VPerf APred ;
|
||||
verb : Str * Str = case <t,a> of {
|
||||
<Fut|Cond,Simul> => <zullen_V.s ! vform, vp.s.s ! VInf> ; --# notpresent
|
||||
<Fut|Cond,Anter> => <zullen_V.s ! vform, vperf ++ auxv ! VInf> ; --# notpresent
|
||||
<_, Anter> => <auxv ! vform, vperf> ; --# notpresent
|
||||
<_, Simul> => <vp.s.s ! vform, []>
|
||||
} ;
|
||||
fin = verb.p1 ;
|
||||
neg = vp.a1 ! b ;
|
||||
obj0 = vp.n0 ! agr ;
|
||||
obj = vp.n2 ! agr ;
|
||||
compl = obj0 ++ neg ++ obj ++ vp.a2 ++ vp.s.prefix ;
|
||||
inf =
|
||||
case <vp.isAux, vp.inf.p2, a> of { --# notpresent
|
||||
<True,True,Anter> => vp.s.s ! VInf ++ vp.inf.p1 ; --# notpresent
|
||||
_ => --# notpresent
|
||||
vp.inf.p1 ++ verb.p2
|
||||
} --# notpresent
|
||||
;
|
||||
extra = vp.ext ;
|
||||
inffin =
|
||||
case <a,vp.isAux> of { --# notpresent
|
||||
<Anter,True> => fin ++ inf ; -- double inf --# notpresent
|
||||
_ => --# notpresent
|
||||
inf ++ fin --- or just auxiliary vp
|
||||
} --# notpresent
|
||||
in
|
||||
tm.s ++ p.s ++
|
||||
case o of {
|
||||
Main => subj ++ fin ++ compl ++ inf ++ extra ;
|
||||
Inv => fin ++ subj ++ compl ++ inf ++ extra ;
|
||||
Sub => subj ++ compl ++ inffin ++ extra
|
||||
}
|
||||
} ;
|
||||
|
||||
lin
|
||||
ConjVPS = conjunctDistrTable2 Order Agr ;
|
||||
|
||||
ICompAP ap = {s = \\agr => "hoe" ++ ap.s ! agr ! APred} ;
|
||||
|
||||
IAdvAdv adv = {s = "hoe" ++ adv.s} ;
|
||||
|
||||
lin
|
||||
UseDAP dap = dap ** {
|
||||
s = \\_ => dap.sp ! Neutr ;
|
||||
a = agrP3 dap.n ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
UseDAPMasc, UseDAPFem = \dap -> dap ** {
|
||||
s = \\_ => dap.sp ! Utr ;
|
||||
a = agrP3 dap.n ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
}
|
||||
@@ -197,4 +197,6 @@ concrete NounDut of Noun = CatDut ** open ResDut, Prelude in {
|
||||
g = cn.g
|
||||
} ;
|
||||
|
||||
DetDAP det = det ;
|
||||
|
||||
}
|
||||
|
||||
@@ -7,11 +7,11 @@ concrete AdjectiveEng of Adjective = CatEng ** open ResEng, Prelude in {
|
||||
isPre = a.isPre
|
||||
} ;
|
||||
ComparA a np = {
|
||||
s = \\_ => a.s ! AAdj Compar Nom ++ "than" ++ np.s ! npNom ;
|
||||
s = \\_ => getCompar Nom a ++ "than" ++ np.s ! npNom ;
|
||||
isPre = False
|
||||
} ;
|
||||
UseComparA a = {
|
||||
s = \\_ => a.s ! AAdj Compar Nom ;
|
||||
s = \\_ => getCompar Nom a ;
|
||||
isPre = a.isPre
|
||||
} ;
|
||||
|
||||
|
||||
@@ -86,7 +86,10 @@ concrete CatEng of Cat = CommonX - [Pol,CAdv] ** open ResEng, Prelude in {
|
||||
|
||||
Conj = {s1,s2 : Str ; n : Number} ;
|
||||
Subj = {s : Str} ;
|
||||
Prep = {s : Str; isPre : Bool} ;
|
||||
Prep = {
|
||||
s : Str ; -- "with", "ago"
|
||||
isPre : Bool ; -- whether it's pre- or postposition: "with"=True, "ago"=False
|
||||
} ;
|
||||
CAdv = {s : Polarity => Str; p : Str} ;
|
||||
|
||||
-- Open lexical classes, e.g. Lexicon
|
||||
@@ -97,8 +100,8 @@ concrete CatEng of Cat = CommonX - [Pol,CAdv] ** open ResEng, Prelude in {
|
||||
VV = {s : VVForm => Str ; p : Str ; typ : VVType} ;
|
||||
V2V = Verb ** {c2,c3 : Str ; typ : VVType} ;
|
||||
|
||||
A = {s : AForm => Str ; isPre : Bool} ;
|
||||
A2 = {s : AForm => Str ; c2 : Str ; isPre : Bool} ;
|
||||
A = ResEng.Adjective ;
|
||||
A2 = ResEng.Adjective ** {c2 : Str} ;
|
||||
|
||||
N = {s : Number => Case => Str ; g : Gender} ;
|
||||
N2 = {s : Number => Case => Str ; g : Gender} ** {c2 : Str} ;
|
||||
@@ -118,8 +121,8 @@ concrete CatEng of Cat = CommonX - [Pol,CAdv] ** open ResEng, Prelude in {
|
||||
VV = \s -> {s = \\_ => s; p = ""; isRefl = False; typ = VVInf} ;
|
||||
V2V = \s -> {s = \\_ => s; p = ""; isRefl = False; c2,c3="" ; typ = VVInf} ;
|
||||
|
||||
A = \s -> {s = \\_ => s; isPre = True} ;
|
||||
A2 = \s -> {s = \\_ => s; c2 = ""; isPre = True} ;
|
||||
A = \s -> {s = \\_ => s; isPre = True ; isMost = False} ;
|
||||
A2 = \s -> {s = \\_ => s; c2 = ""; isPre = True ; isMost = False} ;
|
||||
|
||||
N = \s -> {s = \\_,_ => s; g = Neutr} ;
|
||||
N2 = \s -> {s = \\_,_ => s; c2 = ""; g = Neutr} ;
|
||||
|
||||
@@ -24,20 +24,34 @@ lin
|
||||
)
|
||||
} ;
|
||||
|
||||
InflectionPN = \pn -> {
|
||||
t = "pn" ;
|
||||
s1 = heading1 ("Proper Name" ++
|
||||
case pn.g of {
|
||||
Neutr => "";
|
||||
Masc => "(masc)";
|
||||
Fem => "(fem)"
|
||||
}) ;
|
||||
s2 = frameTable (
|
||||
tr (th "nom" ++ th "gen") ++
|
||||
tr (td (pn.s ! Nom) ++ td (pn.s ! Gen))
|
||||
)
|
||||
} ;
|
||||
|
||||
InflectionA, InflectionA2 = \adj -> {
|
||||
t = "a" ;
|
||||
s1 = heading1 "Adjective" ;
|
||||
s2 = frameTable (
|
||||
tr (th "" ++ th "nom" ++ th "gen") ++
|
||||
tr (th "posit" ++ td (adj.s ! AAdj Posit Nom) ++ td (adj.s ! AAdj Posit Gen)) ++
|
||||
tr (th "compar" ++ td (adj.s ! AAdj Compar Nom) ++ td (adj.s ! AAdj Compar Gen)) ++
|
||||
tr (th "superl" ++ td (adj.s ! AAdj Superl Nom) ++ td (adj.s ! AAdj Superl Gen))
|
||||
tr (th "compar" ++ td (getCompar Nom adj) ++ td (getCompar Gen adj)) ++
|
||||
tr (th "superl" ++ td (getSuperl Nom adj) ++ td (getSuperl Gen adj))
|
||||
) ++
|
||||
heading1 "Adverb" ++
|
||||
paragraph (adj.s ! AAdv)
|
||||
} ;
|
||||
|
||||
InflectionAdv = \adv -> {
|
||||
InflectionAdv, InflectionAdV, InflectionAdA, InflectionAdN = \adv -> {
|
||||
t = "adv" ;
|
||||
s1= heading1 "Adverb" ;
|
||||
s2= paragraph (adv.s) ;
|
||||
|
||||
@@ -35,8 +35,8 @@ lin
|
||||
s1 = heading1 (heading adjective_Category) ;
|
||||
s2 = frameTable (
|
||||
tr (th (heading positive_Parameter) ++ tdf (adj.s ! AAdj Posit Nom)) ++
|
||||
tr (th (heading comparative_Parameter) ++ tdf (adj.s ! AAdj Compar Nom)) ++
|
||||
tr (th (heading superlative_Parameter) ++ tdf (adj.s ! AAdj Superl Nom)) ++
|
||||
tr (th (heading comparative_Parameter) ++ tdf (getCompar Nom adj)) ++
|
||||
tr (th (heading superlative_Parameter) ++ tdf (getSuperl Nom adj)) ++
|
||||
tr (th (heading adverb_Category) ++ tdf (adj.s ! AAdv))
|
||||
)
|
||||
} ;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user