mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 17:08:54 -06:00
Compare commits
501 Commits
optimise-l
...
toki-pona
| Author | SHA1 | Date | |
|---|---|---|---|
| 0e5b224f5c | |||
| 7a1d1412fb | |||
| 19e35edf09 | |||
| 43979ed054 | |||
| 786340192f | |||
| ecdc0a85f6 | |||
| 0bd3506e1b | |||
| fc2b2a0954 | |||
| eccbdcfb97 | |||
| d2568cf869 | |||
| bcb16ae376 | |||
|
|
deb9d40b7e | ||
|
|
25f422f5ca | ||
|
|
f0abf5deff | ||
|
|
e825d92233 | ||
|
|
1e436d84a1 | ||
|
|
84e0e2c08f | ||
|
|
4c55592af4 | ||
|
|
28be4fb450 | ||
|
|
74848d304e | ||
|
|
928889b2aa | ||
|
|
1d7b717866 | ||
|
|
9d18d316c5 | ||
|
|
c8a4c28a51 | ||
|
|
eeca67e787 | ||
|
|
e8005bf071 | ||
|
|
cc1168634b | ||
|
|
76cbf0b75b | ||
|
|
ce2f785f92 | ||
|
|
0cd3450e08 | ||
|
|
62c5030be1 | ||
|
|
bd41b3ccb7 | ||
|
|
53571672e3 | ||
|
|
761597ad8c | ||
|
|
8e780d6263 | ||
|
|
ec4bc75a64 | ||
|
|
dbe6eba30a | ||
|
|
066133bbae | ||
|
|
e9ecb1a8d6 | ||
|
|
090a6ea33d | ||
|
|
dceb5252a2 | ||
|
|
73fa89103b | ||
|
|
115ad31e2d | ||
|
|
f715e393cb | ||
|
|
5e6ee94baa | ||
|
|
a73b6ad6ed | ||
|
|
06f3602e00 | ||
|
|
c7fe453c12 | ||
|
|
48658e3689 | ||
|
|
ffc10a32c9 | ||
|
|
fff1c40f24 | ||
|
|
fd817f80d6 | ||
|
|
b84d05034d | ||
|
|
d589cedc6b | ||
|
|
d833b24509 | ||
|
|
071b2af9c3 | ||
|
|
1f5615c0bb | ||
|
|
fda1f49d17 | ||
|
|
6b93e87363 | ||
|
|
f4aae6a61a | ||
|
|
066d6f9c85 | ||
|
|
3e51c585ce | ||
|
|
bba1de3605 | ||
|
|
4514ebfc00 | ||
|
|
cf947426dc | ||
|
|
7383b30cee | ||
|
|
c604bd3b77 | ||
|
|
8e63f9b32d | ||
|
|
1aed4c3b5f | ||
|
|
78564236b9 | ||
|
|
35a650141e | ||
|
|
5146748f37 | ||
|
|
4bf528a429 | ||
|
|
4a0cc4ec40 | ||
|
|
a5f4679405 | ||
|
|
cad17e8404 | ||
|
|
c9182284e7 | ||
|
|
9649f348b2 | ||
|
|
3e066bd7ec | ||
|
|
7d4e40bac1 | ||
|
|
7e52a4759c | ||
|
|
f01d509376 | ||
|
|
153ad8b41a | ||
|
|
5375cda243 | ||
|
|
e76e11e566 | ||
|
|
bc41082247 | ||
|
|
0e5bb779cc | ||
|
|
08aa91cdbb | ||
|
|
7d695a6d49 | ||
|
|
febd99be26 | ||
|
|
7016ce8a32 | ||
|
|
1b57ef7fee | ||
|
|
cd581dc6ac | ||
|
|
5b588daf85 | ||
|
|
35a6456524 | ||
|
|
141074bec3 | ||
|
|
e78497e46d | ||
|
|
52b6305cf2 | ||
|
|
1cd582a322 | ||
|
|
2ff33ea968 | ||
|
|
b2e2b570e1 | ||
|
|
4644ef0229 | ||
|
|
f546600fd2 | ||
|
|
9c951e244c | ||
|
|
5cb67dadbf | ||
|
|
39f6a43717 | ||
|
|
81f3531136 | ||
|
|
9f21a3d103 | ||
|
|
e14833217e | ||
|
|
8c25bdeacc | ||
|
|
d652c81fa7 | ||
|
|
ed745708b2 | ||
|
|
625ddf1e1e | ||
|
|
512412b4bb | ||
|
|
d4056e7db3 | ||
|
|
c85e7a514b | ||
|
|
a539db3d55 | ||
|
|
b8d9098aaa | ||
|
|
1c87e5ac78 | ||
|
|
4f5e67a581 | ||
|
|
cabf56aea9 | ||
|
|
4b78bd6c67 | ||
|
|
c9c1723090 | ||
|
|
1f3a35a95c | ||
|
|
3aeb0707f5 | ||
|
|
94472bc4ab | ||
|
|
e3c9a0045e | ||
|
|
97227181fe | ||
|
|
f2afe03303 | ||
|
|
75d291d26a | ||
|
|
338c347d7c | ||
|
|
e24e0cc7ce | ||
|
|
51cb9c3091 | ||
|
|
b84cbcfc28 | ||
|
|
de5468e40a | ||
|
|
b93fd7f051 | ||
|
|
5aa5718ca5 | ||
|
|
fd0706fbc1 | ||
|
|
145e1affe9 | ||
|
|
3d0aa460c5 | ||
|
|
a0a8d99872 | ||
|
|
cdc1108a36 | ||
|
|
1308eb85d9 | ||
|
|
42d06dfafd | ||
|
|
04df53a17a | ||
|
|
41906a31c4 | ||
|
|
2d22802af4 | ||
|
|
76f09c2464 | ||
|
|
1825904f4d | ||
|
|
3f4fd4565a | ||
|
|
11d4f0c770 | ||
|
|
574ed858bc | ||
|
|
176d63f0ac | ||
|
|
607d9240c2 | ||
|
|
35f3b5e206 | ||
|
|
ababe72fb8 | ||
|
|
693cd88f7b | ||
|
|
44eec8629b | ||
|
|
ebba8b5894 | ||
|
|
1633d11e06 | ||
|
|
9e91511724 | ||
|
|
777e572681 | ||
|
|
186a12df0c | ||
|
|
904428fb36 | ||
|
|
8723bde58e | ||
|
|
7b777c425e | ||
|
|
f3811e8a0e | ||
|
|
f03d06b81d | ||
|
|
6876b79d43 | ||
|
|
33bd050b7a | ||
|
|
08793614ab | ||
|
|
70e41e47a7 | ||
|
|
66b5e4108f | ||
|
|
8613a78929 | ||
|
|
643ea07c3b | ||
|
|
c6d43a8bbc | ||
|
|
1b6f42397d | ||
|
|
bcf5db743f | ||
|
|
02456811ee | ||
|
|
dcbfb2a464 | ||
|
|
5e02340160 | ||
|
|
4e034425b9 | ||
|
|
7b7752c308 | ||
|
|
108bfb4163 | ||
|
|
d8aaeeb682 | ||
|
|
ffaedd718b | ||
|
|
b01b94001e | ||
|
|
dc143cc3ae | ||
|
|
0a1df37340 | ||
|
|
ad3fa455b1 | ||
|
|
b82bcde9f1 | ||
|
|
6fcf76e78e | ||
|
|
aa4dc4c3df | ||
|
|
3891cef66a | ||
|
|
8e47600671 | ||
|
|
89f2a9dea6 | ||
|
|
6b5df036e3 | ||
|
|
3dae1cf820 | ||
|
|
c4f94ab218 | ||
|
|
d626f03c48 | ||
|
|
93a06312a7 | ||
|
|
d2754c1623 | ||
|
|
d77c8fa23c | ||
|
|
164cf81477 | ||
|
|
4add2fb2de | ||
|
|
37e08ad739 | ||
|
|
466c7da532 | ||
|
|
e8bda853df | ||
|
|
f8bb75a13c | ||
|
|
576e17f03a | ||
|
|
a235cc9594 | ||
|
|
abf4cd4cb2 | ||
|
|
9e52b2d8a3 | ||
|
|
1111ca0fdd | ||
|
|
4de1b64b58 | ||
|
|
f0d74e59a7 | ||
|
|
a2b20dc6db | ||
|
|
21d1a192c8 | ||
|
|
e99bdb6d1a | ||
|
|
d44298a4ad | ||
|
|
89dc2a13f0 | ||
|
|
6dfce2943c | ||
|
|
0814c9da0f | ||
|
|
bb7786af7c | ||
|
|
650076a867 | ||
|
|
5b636496ef | ||
|
|
41dfd532bd | ||
|
|
26e89421d3 | ||
|
|
e7a4b71160 | ||
|
|
81c71043ca | ||
|
|
9217669c31 | ||
|
|
cc964d1853 | ||
|
|
62b5df23d1 | ||
|
|
e63a3c9d17 | ||
|
|
d895f4ceeb | ||
|
|
ba2e4a4964 | ||
|
|
78f333e79e | ||
|
|
710e73688d | ||
|
|
82075be37b | ||
|
|
7d631fafa2 | ||
|
|
78fc625174 | ||
|
|
afe544bb29 | ||
|
|
ca385925b6 | ||
|
|
4173353eb0 | ||
|
|
5135e5c5ca | ||
|
|
b1a5cf93b6 | ||
|
|
911cbb06c1 | ||
|
|
71f3b2dc78 | ||
|
|
23ccacf222 | ||
|
|
d3ecaadef0 | ||
|
|
4bb96aa295 | ||
|
|
d198de7395 | ||
|
|
9b12c13057 | ||
|
|
4f05d5629b | ||
|
|
6648913d4e | ||
|
|
05c65ccbd8 | ||
|
|
d18b889df6 | ||
|
|
6084aef91b | ||
|
|
687f0cefc8 | ||
|
|
479fe7236f | ||
|
|
15ecf3217c | ||
|
|
1f98f642af | ||
|
|
65a05d223b | ||
|
|
f36bbade45 | ||
|
|
c2b8d98400 | ||
|
|
d182354238 | ||
|
|
1fbec65714 | ||
|
|
d059de5711 | ||
|
|
7a8cdf5c3d | ||
|
|
03e81a3fab | ||
|
|
18716dbbd5 | ||
|
|
44171d7d73 | ||
|
|
726d04f00f | ||
|
|
a251318dad | ||
|
|
2363da4b2f | ||
|
|
cd3a2e0ac4 | ||
|
|
a0c8198a68 | ||
|
|
70223e85f2 | ||
|
|
b404f4e5b3 | ||
|
|
e7dd5304c7 | ||
|
|
0df8e6da39 | ||
|
|
bd75a0529c | ||
|
|
4957955df0 | ||
|
|
f85fa84ae0 | ||
|
|
bb5107fa99 | ||
|
|
97b713520f | ||
|
|
fb42bc6b27 | ||
|
|
13dea0d8ac | ||
|
|
38ba6b1d6c | ||
|
|
04e76381dc | ||
|
|
d6cb2806ff | ||
|
|
6ae9123f87 | ||
|
|
f7ba54db1c | ||
|
|
a338c2c60e | ||
|
|
2eb19b5a2d | ||
|
|
bffdfdb790 | ||
|
|
fa42bf3c41 | ||
|
|
a0a9c31745 | ||
|
|
676e61e255 | ||
|
|
0fe84ad2cf | ||
|
|
2aef82181b | ||
|
|
ffcff47545 | ||
|
|
53e731593d | ||
|
|
9193a303a5 | ||
|
|
4b4fbbb401 | ||
|
|
600af2b8bf | ||
|
|
15367fb05d | ||
|
|
fb8d15872c | ||
|
|
4c508979bb | ||
|
|
f8d100edee | ||
|
|
651fd743c7 | ||
|
|
5bdd45a8be | ||
|
|
ea2dfb28b0 | ||
|
|
82891f3c84 | ||
|
|
d2eb7bd46d | ||
|
|
1e55251235 | ||
|
|
9c3e3985bc | ||
|
|
4c9747a8b6 | ||
|
|
04d6642afe | ||
|
|
a8b0e5d94b | ||
|
|
b746a425d5 | ||
|
|
d98bb99fc1 | ||
|
|
4a12ecd9d3 | ||
|
|
61bc8e7619 | ||
|
|
196bdcb265 | ||
|
|
b3e13c29af | ||
|
|
12bc4ccdf5 | ||
|
|
2ec3bdc80e | ||
|
|
23adb5a493 | ||
|
|
9b675c308e | ||
|
|
87f6e70456 | ||
|
|
9c111ba0bc | ||
|
|
0ca0106183 | ||
|
|
fdfa7f33bf | ||
|
|
293b87e4c6 | ||
|
|
93673448e4 | ||
|
|
d59831a176 | ||
|
|
372298ea10 | ||
|
|
73de2c3f97 | ||
|
|
6455337430 | ||
|
|
00f8b78813 | ||
|
|
9340f73b39 | ||
|
|
a67af709c2 | ||
|
|
128f283377 | ||
|
|
7259848d30 | ||
|
|
8007c4576c | ||
|
|
4249c33de4 | ||
|
|
55f8f5ebd8 | ||
|
|
c204bcc753 | ||
|
|
5520f7b081 | ||
|
|
21db782ef5 | ||
|
|
d71ea5d807 | ||
|
|
e7495e15e5 | ||
|
|
b5fb8c069b | ||
|
|
4aa8f87f65 | ||
|
|
9afc19461a | ||
|
|
441c8305dc | ||
|
|
c365d802fe | ||
|
|
074f065046 | ||
|
|
88be4ca0ae | ||
|
|
64ef1d9e49 | ||
|
|
96076d6d81 | ||
|
|
7f2bfa11b3 | ||
|
|
02b3002484 | ||
|
|
12d7702a7d | ||
|
|
1d5b9d49e2 | ||
|
|
c5e62b1614 | ||
|
|
a9b5848a5f | ||
|
|
93fbfe8d26 | ||
|
|
a5e6106d51 | ||
|
|
c22feb7878 | ||
|
|
250f7ee82c | ||
|
|
bfad5839b8 | ||
|
|
a4237dad70 | ||
|
|
e97205e04d | ||
|
|
14825b5617 | ||
|
|
2a345b0afc | ||
|
|
2d03a58d56 | ||
|
|
e3fd978f42 | ||
|
|
01e5165537 | ||
|
|
fa8cef4112 | ||
|
|
47365491ff | ||
|
|
cd1a43db58 | ||
|
|
2f8960e2e8 | ||
|
|
6f73277ac2 | ||
|
|
17da1893d7 | ||
|
|
da608c2084 | ||
|
|
9570ff202a | ||
|
|
140b59dd70 | ||
|
|
af1010da71 | ||
|
|
e22bb13eda | ||
|
|
ca7d7d8fde | ||
|
|
88fe3e5a25 | ||
|
|
ff32e9e75c | ||
|
|
5b83590913 | ||
|
|
297f396bd2 | ||
|
|
8d25422c79 | ||
|
|
e200403cf8 | ||
|
|
1cf6496883 | ||
|
|
af6edf2e6e | ||
|
|
7827e892d9 | ||
|
|
67d1e24761 | ||
|
|
5f4bb014b8 | ||
|
|
d1ff26f3ce | ||
|
|
f19dcc01f9 | ||
|
|
6e0d281fe0 | ||
|
|
79643d8604 | ||
|
|
fdd9b98601 | ||
|
|
195064569d | ||
|
|
1c355ce9dd | ||
|
|
561a8c130d | ||
|
|
aa1dff6702 | ||
|
|
7e383b746e | ||
|
|
fdd7c9641e | ||
|
|
2419931105 | ||
|
|
abcb3a9f2a | ||
|
|
9e8c5eaad5 | ||
|
|
73f0b8ef00 | ||
|
|
edecc3fe57 | ||
|
|
3e9be76e52 | ||
|
|
d5e6e7e389 | ||
|
|
8e029bd8dd | ||
|
|
3c0adada11 | ||
|
|
afc84a61cb | ||
|
|
8eceb53643 | ||
|
|
714d8abac0 | ||
|
|
ae1c7f0061 | ||
|
|
6312624a5f | ||
|
|
3640421022 | ||
|
|
03d3a8cbc2 | ||
|
|
5f9322683c | ||
|
|
f53b872b33 | ||
|
|
28afb4d0dc | ||
|
|
b72ea1e2f1 | ||
|
|
819d4f19ed | ||
|
|
a313207f49 | ||
|
|
6c71465939 | ||
|
|
578112713a | ||
|
|
aee21a0f51 | ||
|
|
5674812a8c | ||
|
|
68b9e4b327 | ||
|
|
54f5b687fe | ||
|
|
39e01f04ab | ||
|
|
7758291f8e | ||
|
|
128cf3de8c | ||
|
|
5afe500935 | ||
|
|
93d31dfede | ||
|
|
9a413efd6f | ||
|
|
84a03ef78a | ||
|
|
fb398c603e | ||
|
|
58da8deca8 | ||
|
|
ce8b4575ee | ||
|
|
3ab3eab36b | ||
|
|
20dcab3208 | ||
|
|
1c775791b4 | ||
|
|
a00d41dcfa | ||
|
|
956d2fc9c4 | ||
|
|
0b52307e91 | ||
|
|
1961c6ae94 | ||
|
|
0cbae9883d | ||
|
|
f08c9c0c93 | ||
|
|
dc58886b79 | ||
|
|
1562e53d77 | ||
|
|
98128cedd7 | ||
|
|
e872c57758 | ||
|
|
42f64725f2 | ||
|
|
a6f3dc6d05 | ||
|
|
e729e4e707 | ||
|
|
fccc0428fd | ||
|
|
7a75cf3fb3 | ||
|
|
1f73830d4b | ||
|
|
e9dc5d9cad | ||
|
|
6bc965f6c2 | ||
|
|
146bc71a06 | ||
|
|
31b025bdf1 | ||
|
|
a9408305df | ||
|
|
7d483b1539 | ||
|
|
9265857edb | ||
|
|
e2b6af2ca4 | ||
|
|
9444848069 | ||
|
|
9c5b87e1c8 | ||
|
|
e07c9ee044 | ||
|
|
1f728c31a0 | ||
|
|
b76b8af7b2 | ||
|
|
e2ce9de503 | ||
|
|
c659270fcc | ||
|
|
c8a424c023 | ||
|
|
0d5919d511 | ||
|
|
18602c1e1d | ||
|
|
be41a945f5 | ||
|
|
f773272437 | ||
|
|
83aadfaaf9 | ||
|
|
d6129a26e5 | ||
|
|
6e16add239 | ||
|
|
b55abfc8fe | ||
|
|
3446c192ba | ||
|
|
69356d8c9b | ||
|
|
1cad178ec8 | ||
|
|
787f9d10e8 | ||
|
|
ec41af609d | ||
|
|
8eee3df739 |
17
.github/workflows/release.yml
vendored
17
.github/workflows/release.yml
vendored
@@ -8,19 +8,26 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-18.04
|
||||
runs-on: ubuntu-24.04
|
||||
env:
|
||||
GF_VERSION: 3.10-1
|
||||
GF_VERSION: 3.12
|
||||
DEST: gf-rgl-${{ github.event.inputs.tag }}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download GF
|
||||
uses: dsaltares/fetch-gh-release-asset@1.1.1
|
||||
with:
|
||||
repo: 'GrammaticalFramework/gf-core'
|
||||
version: 'tags/release-${{ env.GF_VERSION }}'
|
||||
file: 'gf-${{ env.GF_VERSION }}-ubuntu-24.04.deb'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install GF
|
||||
run: |
|
||||
curl -s https://www.grammaticalframework.org/download/gf_${GF_VERSION}_amd64.deb -o gf.deb
|
||||
sudo dpkg -i gf.deb
|
||||
sudo dpkg -i gf-${GF_VERSION}-ubuntu-24.04.deb
|
||||
|
||||
- name: Build RGL
|
||||
run: |
|
||||
|
||||
33
.github/workflows/test.yml
vendored
Normal file
33
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
name: Check that the RGL can successfully build
|
||||
|
||||
on:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-24.04
|
||||
env:
|
||||
GF_VERSION: 3.12
|
||||
DEST: gf-rgl
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download GF
|
||||
uses: dsaltares/fetch-gh-release-asset@1.1.1
|
||||
with:
|
||||
repo: 'GrammaticalFramework/gf-core'
|
||||
version: 'tags/release-${{ env.GF_VERSION }}'
|
||||
file: 'gf-${{ env.GF_VERSION }}-ubuntu-24.04.deb'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install GF
|
||||
run: |
|
||||
sudo dpkg -i gf-${GF_VERSION}-ubuntu-24.04.deb
|
||||
|
||||
- name: Build RGL
|
||||
run: |
|
||||
mkdir -p ${DEST}
|
||||
bash Setup.sh --dest=${DEST} --gf=gf --verbose
|
||||
12
.gitignore
vendored
12
.gitignore
vendored
@@ -5,3 +5,15 @@ dist/
|
||||
*.pgf
|
||||
*.tmp
|
||||
*~
|
||||
.direnv
|
||||
_grphp_*.dot
|
||||
_grphp_*.png
|
||||
_grpht_*.dot
|
||||
_grpht_*.png
|
||||
_gftmp
|
||||
t.dot
|
||||
t.dot.png
|
||||
u.dot.png
|
||||
t.dot.*.png
|
||||
u.dot.*.png
|
||||
u.dot
|
||||
|
||||
@@ -25,6 +25,7 @@ data LangInfo = LangInfo
|
||||
, langSymbolic :: Bool
|
||||
, langCompatibility :: Bool
|
||||
, langSynopsis :: Bool -- ^ include in RGL synopsis
|
||||
, langMorphodict :: Bool
|
||||
} deriving (Show,Eq)
|
||||
|
||||
-- | Load language information from default config file
|
||||
@@ -55,6 +56,7 @@ loadLangsFrom configFile = do
|
||||
, langSymbolic = boolBit bits 8 True
|
||||
, langCompatibility = boolBit bits 9 False
|
||||
, langSynopsis = boolBit bits 10 False
|
||||
, langMorphodict = boolBit bits 11 False
|
||||
}
|
||||
|
||||
-- | Separate a string on a character
|
||||
|
||||
2
Makefile
2
Makefile
@@ -19,6 +19,7 @@ default: build copy
|
||||
build: src/*/*.gf
|
||||
ifneq (, $(RUNGHC))
|
||||
$(RUNGHC) build
|
||||
$(RUNGHC) build morphodict
|
||||
else
|
||||
./Setup.sh
|
||||
endif
|
||||
@@ -26,6 +27,7 @@ endif
|
||||
copy:
|
||||
ifneq (, $(RUNGHC))
|
||||
$(RUNGHC) copy
|
||||
$(RUNGHC) copy morphodict
|
||||
endif
|
||||
|
||||
install: build copy
|
||||
|
||||
26
Setup.hs
26
Setup.hs
@@ -1,4 +1,4 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
{-# LANGUAGE CPP, LambdaCase #-}
|
||||
|
||||
-- | Main build script for RGL
|
||||
|
||||
@@ -150,11 +150,12 @@ getRGLBuildSubDir mode =
|
||||
case mode of
|
||||
Present -> "present"
|
||||
AllTenses -> "alltenses"
|
||||
MorphoDict -> "morphodict"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- Build modes
|
||||
|
||||
data Mode = Present | AllTenses
|
||||
data Mode = Present | AllTenses | MorphoDict
|
||||
deriving (Show,Eq)
|
||||
|
||||
all_modes :: [String]
|
||||
@@ -187,6 +188,7 @@ rglCommands =
|
||||
, RGLCommand "lang" False $ gfcp [l,s]
|
||||
, RGLCommand "api" False $ gfcp [t,sc]
|
||||
, RGLCommand "compat" False $ gfcp [c]
|
||||
, RGLCommand "morphodict" False $ gfcp [m]
|
||||
|
||||
-- Special command, invoked when command ends in .gf
|
||||
, RGLCommand "modules" False $ \modes args bi -> do
|
||||
@@ -223,14 +225,20 @@ rglCommands =
|
||||
s mode args = (symbol,optml mode langTry args)
|
||||
c mode args = (compat,optml AllTenses langCompatibility args)
|
||||
t mode args = (try,optml mode langTry args)
|
||||
m mode args = (morphodict,optml mode langMorphodict args)
|
||||
sc mode args = (symbolic,optml mode langSymbolic args)
|
||||
|
||||
optml :: Mode -> (LangInfo -> Bool) -> [String] -> ([LangInfo] -> [LangInfo])
|
||||
optml mode pred args =
|
||||
\langsAll ->
|
||||
let langsDefault = filter (if mode == Present then langPresent else const True) (filter pred langsAll)
|
||||
let langsDefault = filter (mode2langinfo mode) (filter pred langsAll)
|
||||
in getOptLangs langsAll langsDefault args
|
||||
|
||||
mode2langinfo = \case
|
||||
Present -> langPresent
|
||||
MorphoDict -> langMorphodict
|
||||
_ -> const True
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- Getting module paths/names
|
||||
|
||||
@@ -260,6 +268,9 @@ syntax l = sourceDir </> "api" </> ("Syntax" ++ langCode l ++ ".gf")
|
||||
symbolic :: LangInfo -> FilePath
|
||||
symbolic l = sourceDir </> "api" </> ("Symbolic" ++ langCode l ++ ".gf")
|
||||
|
||||
morphodict :: LangInfo -> FilePath
|
||||
morphodict l = sourceDir </> "morphodict" </> ("MorphoDict" ++ langCode l ++ ".gf")
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- Argument helpers
|
||||
|
||||
@@ -302,8 +313,9 @@ getOptMode args =
|
||||
else explicit_modes
|
||||
where
|
||||
explicit_modes =
|
||||
[Present|have "present"]++
|
||||
[AllTenses|have "alltenses"]
|
||||
[Present | have "present"] ++
|
||||
[AllTenses | have "alltenses"] ++
|
||||
[MorphoDict | have "morphodict"]
|
||||
have mode = mode `elem` args
|
||||
|
||||
-- | List of languages overriding the default definitions
|
||||
@@ -366,8 +378,8 @@ gfcn :: Info -> Mode -> String -> [FilePath] -> IO ()
|
||||
gfcn bi mode summary files = do
|
||||
let dir = getRGLBuildDir bi mode
|
||||
preproc = case mode of
|
||||
Present -> "--preproc=mkPresent"
|
||||
AllTenses -> ""
|
||||
Present -> "--preproc=mkPresent"
|
||||
_ -> ""
|
||||
createDirectoryIfMissing True dir
|
||||
if length files > 0
|
||||
then do
|
||||
|
||||
13
Setup.sh
13
Setup.sh
@@ -59,6 +59,7 @@ gfc="${gf} --batch --quiet --gf-lib-path=${dist}"
|
||||
mkdir -p "${dist}/prelude"
|
||||
mkdir -p "${dist}/present"
|
||||
mkdir -p "${dist}/alltenses"
|
||||
mkdir -p "${dist}/morphodict"
|
||||
|
||||
# Build: prelude
|
||||
echo "Building [prelude]"
|
||||
@@ -68,6 +69,7 @@ ${gfc} --gfo-dir="${dist}"/prelude "${src}"/prelude/*.gf
|
||||
# Gather all language modules for building
|
||||
modules_present=
|
||||
modules_alltenses=
|
||||
modules_morphodict=
|
||||
for lang in $langs; do
|
||||
for mod in $modules_langs $modules_api; do
|
||||
if [ $mod == "Compatibility" ] && [[ "$langs_compat" != *"$lang"* ]]; then continue; fi
|
||||
@@ -80,8 +82,12 @@ for lang in $langs; do
|
||||
modules_alltenses="${modules_alltenses} ${file}"
|
||||
done
|
||||
done
|
||||
file="${src}/morphodict/MorphoDict${lang}.gf"
|
||||
if [ ! -f "$file" ]; then continue; fi
|
||||
modules_morphodict="${modules_morphodict} ${file}"
|
||||
done
|
||||
|
||||
|
||||
# Build: present
|
||||
echo "Building [present]"
|
||||
if [ $verbose = true ]; then echo $modules_present; fi
|
||||
@@ -96,6 +102,13 @@ for module in $modules_alltenses; do
|
||||
${gfc} --no-pmcfg --gfo-dir="${dist}"/alltenses "${module}"
|
||||
done
|
||||
|
||||
# Build: morphodict
|
||||
echo "Building [morphodict]"
|
||||
if [ $verbose = true ]; then echo $modules_morphodict; fi
|
||||
for module in $modules_morphodict; do
|
||||
${gfc} --no-pmcfg --gfo-dir="${dist}"/morphodict "${module}"
|
||||
done
|
||||
|
||||
# Copy
|
||||
if [ $dest == $dist ]; then exit 0; fi
|
||||
echo "Copying to ${dest}"
|
||||
|
||||
62
flake.lock
generated
Normal file
62
flake.lock
generated
Normal file
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1775036866,
|
||||
"narHash": "sha256-ZojAnPuCdy657PbTq5V0Y+AHKhZAIwSIT2cb8UgAz/U=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "6201e203d09599479a3b3450ed24fa81537ebc4e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1750386251,
|
||||
"narHash": "sha256-1ovgdmuDYVo5OUC5NzdF+V4zx2uT8RtsgZahxidBTyw=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "076e8c6678d8c54204abcb4b1b14c366835a58bb",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs",
|
||||
"sydpkgs": "sydpkgs"
|
||||
}
|
||||
},
|
||||
"sydpkgs": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1771299872,
|
||||
"narHash": "sha256-+OPW1SKKHT7aqhyjs2O20gd1MXa7LyD+9/lwMUCVL7Y=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "53bf019e26478666ab7f458f78e569b8b106cc1f",
|
||||
"revCount": 36,
|
||||
"type": "git",
|
||||
"url": "https://git.deertopia.net/msyds/sydpkgs"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "https://git.deertopia.net/msyds/sydpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
55
flake.nix
Normal file
55
flake.nix
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
# gf.url = "github:anka-213/cclaw-nix-stuff/nix-flakes";
|
||||
sydpkgs.url = "git+https://git.deertopia.net/msyds/sydpkgs";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, sydpkgs, ... }@inputs:
|
||||
let
|
||||
supportedSystems = [
|
||||
"aarch64-darwin"
|
||||
"aarch64-linux"
|
||||
"x86_64-darwin"
|
||||
"x86_64-linux"
|
||||
];
|
||||
|
||||
each-system = f: nixpkgs.lib.genAttrs supportedSystems (system: f rec {
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [
|
||||
# (final: prev: { inherit (gf.packages.${system}) gf-core; })
|
||||
sydpkgs.overlays.default
|
||||
];
|
||||
};
|
||||
inherit (pkgs) lib;
|
||||
inherit system;
|
||||
});
|
||||
in {
|
||||
# Exposed as a REPL convenience.
|
||||
_pkgs = each-system ({ pkgs, ... }: pkgs);
|
||||
|
||||
packages = each-system ({ pkgs, ... }: {
|
||||
default = pkgs.callPackage ./package.nix {};
|
||||
});
|
||||
|
||||
devShells = each-system ({ pkgs, system, ... }:
|
||||
let
|
||||
gf-lsp = import
|
||||
(pkgs.fetchzip {
|
||||
url = "https://github.com/anka-213/gf-lsp/archive/refs/tags/1.0.6.0.tar.gz";
|
||||
hash = "sha256-UAI2qUslzLOWYjTirZJ0y4DZbkPZnVXTY0XtFO8+Rks=";
|
||||
}) {inherit system;};
|
||||
in {
|
||||
default = pkgs.mkShell {
|
||||
inputsFrom = [ self.packages.${system}.default ];
|
||||
packages = [
|
||||
gf-lsp.gf-lsp
|
||||
pkgs.gftest
|
||||
pkgs.graphviz
|
||||
pkgs.imagemagick
|
||||
];
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
118
languages.csv
118
languages.csv
@@ -1,54 +1,64 @@
|
||||
Code,Name,Directory,Functor,Unlexer,Present,All,Try,Symbolic,Compatibility,Synopsis
|
||||
Afr,Afrikaans,afrikaans,,,,,,n,,y
|
||||
Amh,Amharic,amharic,,,,,n,n,,n
|
||||
Ara,Arabic,arabic,,,,,,y,,y
|
||||
Bul,Bulgarian,bulgarian,,,y,,,,,y
|
||||
Cat,Catalan,catalan,Romance,,y,,,,y,y
|
||||
Cgg,Rukiga,rukiga,,,y,y,n,n,y,y
|
||||
Chi,Chinese (simplified),chinese,,,,,,,,y
|
||||
Cze,Czech,czech,,,,,,n,,y
|
||||
Dan,Danish,danish,Scand,,y,,,,,y
|
||||
Dut,Dutch,dutch,,,y,,,,,y
|
||||
Eng,English,english,,,y,,,,y,y
|
||||
Est,Estonian,estonian,,,,,,,,y
|
||||
Eus,Basque,basque,,,,,,,,y
|
||||
Fin,Finnish,finnish,,,y,,,,y,y
|
||||
Fre,French,french,Romance,,y,,,,y,y
|
||||
Ger,German,german,,,y,,,,,y
|
||||
Grc,Ancient Greek,ancient_greek,,,y,,n,n,,n
|
||||
Gre,Greek,greek,,,,,,,,y
|
||||
Heb,Hebrew,hebrew,,,,,n,n,,n
|
||||
Hin,Hindi,hindi,Hindustani,to_devanagari,y,,,,,y
|
||||
Hrv,Croatian,croatian,,,,,,y,,n
|
||||
Hun,Hungarian,hungarian,,,n,y,y,y,n,n
|
||||
Ice,Icelandic,icelandic,,,,,,n,,y
|
||||
Ina,Interlingua,interlingua,,,y,,n,n,,n
|
||||
Ita,Italian,italian,Romance,,y,,,,y,y
|
||||
Jpn,Japanese,japanese,,,,,,,,y
|
||||
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
|
||||
Nno,Norwegian (nynorsk),nynorsk,,,y,,,,,y
|
||||
Nor,Norwegian (bokmål),norwegian,Scand,,y,,,,,y
|
||||
Pes,Persian,persian,,,,,,,,y
|
||||
Pnb,Punjabi,punjabi,,,y,,,,,y
|
||||
Pol,Polish,polish,,,,,,,,y
|
||||
Por,Portuguese,portuguese,Romance,,y,,,,y,y
|
||||
Ron,Romanian,romanian,,,y,,,,,y
|
||||
Rus,Russian,russian,,,y,,,,,y
|
||||
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,,,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
|
||||
Code,Name,Directory,Functor,Unlexer,Present,All,Try,Symbolic,Compatibility,Synopsis,MorphoDict
|
||||
Afr,Afrikaans,afrikaans,,,,,,n,,y,n
|
||||
Amh,Amharic,amharic,,,,,n,n,,n,n
|
||||
Ara,Arabic,arabic,,,,,,y,,y,y
|
||||
Bel,Belarusian,belarusian,,,,y,n,n,n,y,n
|
||||
Bul,Bulgarian,bulgarian,,,y,,,,,y,n
|
||||
Cat,Catalan,catalan,Romance,,y,,,,y,y,n
|
||||
Cgg,Rukiga,rukiga,,,y,y,n,n,y,y,n
|
||||
Chi,Chinese (simplified),chinese,,,,,,,,y,y
|
||||
Cze,Czech,czech,,,,,,n,,y,n
|
||||
Dan,Danish,danish,Scand,,y,,,,,y,n
|
||||
Dut,Dutch,dutch,,,y,,,,,y,n
|
||||
Eng,English,english,,,y,,,,y,y,y
|
||||
Est,Estonian,estonian,,,,,,,,y,n
|
||||
Eus,Basque,basque,,,,,,,,y,n
|
||||
Fao,Faroese,faroese,,,,y,n,n,n,y,n
|
||||
Fin,Finnish,finnish,,,y,,,,y,y,y
|
||||
Fre,French,french,Romance,,y,,,,y,y,y
|
||||
Gla,Gaelic,gaelic,,,,y,n,n,n,y,n
|
||||
Ger,German,german,,,y,,,,,y,y
|
||||
Grc,Ancient Greek,ancient_greek,,,y,,n,n,,n,n
|
||||
Gre,Greek,greek,,,,,,,,y,n
|
||||
Heb,Hebrew,hebrew,,,,,n,n,,n,n
|
||||
Hin,Hindi,hindi,Hindustani,to_devanagari,y,,,,,y,n
|
||||
Hrv,Croatian,croatian,,,,,,y,,n,n
|
||||
Hun,Hungarian,hungarian,,,n,y,y,y,n,n,n
|
||||
Hye,Armenian,armenian,,,,y,n,n,n,y,n
|
||||
Ice,Icelandic,icelandic,,,,,,n,,y,n
|
||||
Ina,Interlingua,interlingua,,,y,,n,n,,n,n
|
||||
Ita,Italian,italian,Romance,,y,,,,y,y,y
|
||||
Jpn,Japanese,japanese,,,,,,,,y,n
|
||||
Kaz,Kazakh,kazakh,,,,y,n,n,n,y,n
|
||||
Kor,Korean,korean,,,n,y,y,y,n,n,n
|
||||
Lat,Latin,latin,,,,,y,y,n,y,n
|
||||
Lav,Latvian,latvian,,,,,,,y,y,n
|
||||
Mkd,Macedonian,macedonian,,,,y,n,n,n,y,n
|
||||
May,Malay,malay,,,y,,,,n,y,n
|
||||
Mlt,Maltese,maltese,,,,,,,,y,n
|
||||
Mon,Mongolian,mongolian,,,,,,n,,y,n
|
||||
Nep,Nepali,nepali,,,,,,n,,y,n
|
||||
Nno,Norwegian (nynorsk),nynorsk,,,y,,,,,y,n
|
||||
Nor,Norwegian (bokmål),norwegian,Scand,,y,,,,,y,n
|
||||
Pes,Persian,persian,,,,,,,,y,n
|
||||
Pnb,Punjabi,punjabi,,,y,,,,,y,n
|
||||
Pol,Polish,polish,,,,,,,,y,n
|
||||
Por,Portuguese,portuguese,Romance,,y,,,,y,y,y
|
||||
Ron,Romanian,romanian,,,y,,,,,y,n
|
||||
Rus,Russian,russian,,,y,,,,,y,n
|
||||
Slo,Slovak,slovak,,,,,,n,,y,n
|
||||
Slv,Slovenian,slovenian,,,,,n,n,,n,n
|
||||
Snd,Sindhi,sindhi,,,,,,,,y,n
|
||||
Spa,Spanish,spanish,Romance,,y,,,,y,y,y
|
||||
Sqi,Albanian,albanian,,,,y,n,n,n,y,n
|
||||
Sco,Scots,scots,,,y,,,,,y,n
|
||||
Swa,Swahili,swahili,Bantu,,,y,n,n,n,n,n
|
||||
Swe,Swedish,swedish,Scand,,y,,,,y,y,y
|
||||
Tam,Tamil,tamil,n,n,n,n,n,n,n,n,n
|
||||
Tel,Telugu,telugu,,,y,n,n,n,,n,n
|
||||
Tha,Thai,thai,,to_thai,,,,,,y,n
|
||||
Tur,Turkish,turkish,,,y,,,n,,n,n
|
||||
Ukr,Ukrainian,ukrainian,,,,y,n,n,n,y,n
|
||||
Urd,Urdu,urdu,Hindustani,,,,,,,y,n
|
||||
Som,Somali,somali,,,,,n,n,,n,n
|
||||
Zul,Zulu,zulu,,,,,n,n,,n,n
|
||||
|
||||
|
23
package.nix
Normal file
23
package.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{ stdenv
|
||||
, ghc
|
||||
, gf-core
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "gf-rgl";
|
||||
src = ./.;
|
||||
buildInputs = [ ghc gf-core ];
|
||||
# Keep references to source, so go to definition works
|
||||
# postUnpack = ''
|
||||
# rm -r source/src
|
||||
# ln -s $src/src source/src
|
||||
# '';
|
||||
LC_ALL = "C.UTF-8";
|
||||
buildPhase = ''
|
||||
runghc Setup.hs build
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir -p $out/share/gf/lib
|
||||
runghc Setup.hs copy --dest=$out/share/gf/lib
|
||||
'';
|
||||
}
|
||||
@@ -52,6 +52,12 @@ apiModules = ["Try","Symbolic","Syntax","Constructors","Combinators"]
|
||||
|
||||
clone :: [String] -> String -> String -> String -> String -> (String, String) -> IO ()
|
||||
clone options fromdir todir from to (absname,absfx) = do
|
||||
printf "clone options=%s\n\
|
||||
\ fromdir=%s\n\
|
||||
\ todir=%s\n\
|
||||
\ from=%s\n\
|
||||
\ to=%s\n" (show options) (show fromdir)
|
||||
(show todir) (show from) (show to)
|
||||
s <- readFile (fromdir ++ "/" ++ absname ++ from ++ absfx ++ ".gf")
|
||||
writeAndReportFile (todir ++ "/" ++ absname ++ to ++ absfx ++ ".gf") (commentIf options (replaceLang from to s))
|
||||
|
||||
|
||||
@@ -14,9 +14,29 @@ This Readme was written by Nemo and edited by Inari on 14th August 2022.
|
||||
|
||||
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.
|
||||
### From an existing RGL language
|
||||
|
||||
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.
|
||||
If your language already has a close relative in the RGL, then you can clone your language from that one, in order reuse the same structures with only minor modifications. As per the instructions, the syntax is `Clone fromdir todir fromlang tolang`.Suppose you want to clone Slovak from Czech, then do as follows:
|
||||
|
||||
```bash
|
||||
$ runghc Clone czech slovak Cze Slo
|
||||
```
|
||||
|
||||
You may want to add the option `--comment-body` after the word `Clone` to comment out every line in the body of the files.
|
||||
|
||||
```bash
|
||||
$ runghc Clone --comment-body czech slovak Cze Slo
|
||||
```
|
||||
|
||||
### From a generic template
|
||||
|
||||
Often it is easier to start from a rather clean slate, so the recommended way is to clone the [TEMPLATE](TEMPLATE/) module. So suppose you want to start a resource grammar for Albanian, do it as follows:
|
||||
|
||||
```bash
|
||||
$ runghc Clone TEMPLATE albanian TMP Sqi
|
||||
```
|
||||
|
||||
You will see more detailed instructions on how to continue from the cloned template in the [README file](template/README.md).
|
||||
|
||||
# File hierarchy
|
||||
|
||||
|
||||
68
src/TEMPLATE/AdjectiveTMP.gf
Normal file
68
src/TEMPLATE/AdjectiveTMP.gf
Normal file
@@ -0,0 +1,68 @@
|
||||
concrete AdjectiveTMP of Adjective = CatTMP ** open ResTMP, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
-- : AP -> Adv -> AP ; -- warm by nature
|
||||
AdvAP ap adv = ap ** {
|
||||
s = ap.s ++ adv.s ;
|
||||
} ;
|
||||
|
||||
-- : A -> AP ;
|
||||
PositA a = a ** {
|
||||
compar = [] ;
|
||||
} ;
|
||||
|
||||
-- : A -> NP -> AP ;
|
||||
ComparA a np = a ** {
|
||||
compar = np.s
|
||||
} ;
|
||||
|
||||
-- : A2 -> NP -> AP ; -- married to her
|
||||
-- ComplA2 a2 np = a2 ** { } ;
|
||||
|
||||
-- : A2 -> AP ; -- married to itself
|
||||
-- ReflA2 a2 = a2 ** { } ;
|
||||
|
||||
-- : A2 -> AP ; -- married
|
||||
UseA2 = PositA ;
|
||||
|
||||
-- : A -> AP ; -- warmer
|
||||
-- UseComparA a = a ** {
|
||||
-- s = \\af => "???" ++ a.s ! af ;
|
||||
-- compar = []
|
||||
-- } ;
|
||||
|
||||
|
||||
-- : CAdv -> AP -> NP -> AP ; -- as cool as John
|
||||
-- CAdvAP adv ap np = ap ** { } ;
|
||||
|
||||
-- The superlative use is covered in $Ord$.
|
||||
|
||||
-- : Ord -> AP ; -- warmest
|
||||
-- AdjOrd ord = ord ** {
|
||||
-- compar = []
|
||||
-- } ;
|
||||
-- AdjOrd : Ord -> AP =
|
||||
AdjOrd ord = ord ;
|
||||
|
||||
-- Sentence and question complements defined for all adjectival
|
||||
-- phrases, although the semantics is only clear for some adjectives.
|
||||
|
||||
-- : AP -> SC -> AP ; -- good that she is here
|
||||
-- SentAP ap sc = ap ** {
|
||||
-- s = \\af => ap.s ! af ++ sc.s
|
||||
-- } ;
|
||||
|
||||
-- An adjectival phrase can be modified by an *adadjective*, such as "very".
|
||||
|
||||
-- : AdA -> AP -> AP ;
|
||||
-- AdAP ada ap = ap ** { } ;
|
||||
|
||||
|
||||
-- It can also be postmodified by an adverb, typically a prepositional phrase.
|
||||
|
||||
|
||||
|
||||
}
|
||||
39
src/TEMPLATE/AdverbTMP.gf
Normal file
39
src/TEMPLATE/AdverbTMP.gf
Normal file
@@ -0,0 +1,39 @@
|
||||
concrete AdverbTMP of Adverb = CatTMP ** open ResTMP, ParadigmsTMP, Prelude in {
|
||||
{-
|
||||
lin
|
||||
|
||||
-- : A -> Adv ;
|
||||
PositAdvAdj adj =
|
||||
|
||||
-- : CAdv -> A -> NP -> Adv ; -- more warmly than John
|
||||
ComparAdvAdj cadv a np =
|
||||
|
||||
-- : CAdv -> A -> S -> Adv ; -- more warmly than he runs
|
||||
ComparAdvAdjS cadv a s =
|
||||
|
||||
-- : Prep -> NP -> Adv ;
|
||||
PrepNP prep np = ;
|
||||
|
||||
-- Adverbs can be modified by 'adadjectives', just like adjectives.
|
||||
|
||||
-- : AdA -> Adv -> Adv ; -- very quickly
|
||||
AdAdv ada adv = adv **
|
||||
|
||||
-- Like adverbs, adadjectives can be produced by adjectives.
|
||||
|
||||
-- : A -> AdA ; -- extremely
|
||||
PositAdAAdj a =
|
||||
|
||||
-- Subordinate clauses can function as adverbs.
|
||||
|
||||
-- : Subj -> S -> Adv ;
|
||||
SubjS subj s = {s = subj.s ++ s.s} ;
|
||||
|
||||
-- Comparison adverbs also work as numeral adverbs.
|
||||
|
||||
-- : CAdv -> AdN ; -- less (than five)
|
||||
AdnCAdv cadv = ;
|
||||
|
||||
-}
|
||||
|
||||
}
|
||||
6
src/TEMPLATE/AllTMP.gf
Normal file
6
src/TEMPLATE/AllTMP.gf
Normal file
@@ -0,0 +1,6 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
concrete AllTMP of AllTMPAbs =
|
||||
LangTMP,
|
||||
ExtendTMP
|
||||
;
|
||||
5
src/TEMPLATE/AllTMPAbs.gf
Normal file
5
src/TEMPLATE/AllTMPAbs.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:../abstract:../common:prelude
|
||||
|
||||
abstract AllTMPAbs =
|
||||
Lang,
|
||||
Extend ;
|
||||
121
src/TEMPLATE/CatTMP.gf
Normal file
121
src/TEMPLATE/CatTMP.gf
Normal file
@@ -0,0 +1,121 @@
|
||||
concrete CatTMP of Cat = CommonX ** open ResTMP, Coordination, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lincat
|
||||
|
||||
--2 Sentences and clauses
|
||||
-- Constructed in SentenceTMP, and also in IdiomTMP
|
||||
S = SS ;
|
||||
QS = SS ;
|
||||
RS = SS ;
|
||||
-- relative sentence. Tense and polarity fixed,
|
||||
-- but agreement may depend on the CN/NP it modifies.
|
||||
|
||||
Cl = ResTMP.LinCl ;
|
||||
ClSlash = SS ;
|
||||
SSlash = SS ; -- sentence missing NP; e.g. "she has looked at"
|
||||
Imp = SS ; -- imperative e.g. "look at this"
|
||||
|
||||
--2 Questions and interrogatives
|
||||
|
||||
-- Constructed in QuestionTMP.
|
||||
QCl = SS ;
|
||||
IComp = SS ; -- interrogative complement of copula e.g. "where"
|
||||
IDet = SS ; -- interrogative determiner e.g. "how many"
|
||||
IQuant = SS ; -- interrogative quantifier e.g. "which"
|
||||
IP = SS ; -- interrogative pronoun e.g. "who"
|
||||
|
||||
--2 Subord clauses and pronouns
|
||||
|
||||
RCl = SS ;
|
||||
RP = SS ;
|
||||
|
||||
--2 Verb phrases
|
||||
|
||||
-- Constructed in VerbTMP.
|
||||
VP = ResTMP.LinVP ;
|
||||
VPSlash = SS ;
|
||||
Comp = SS ;
|
||||
|
||||
--2 Adjectival phrases
|
||||
|
||||
-- Constructed in AdjectiveTMP.
|
||||
AP = SS ;
|
||||
|
||||
--2 Nouns and noun phrases
|
||||
|
||||
-- Constructed in NounTMP.
|
||||
-- Many atomic noun phrases e.g. "everybody"
|
||||
-- are constructed in StructuralTMP.
|
||||
|
||||
CN = ResTMP.LinCN ;
|
||||
NP = ResTMP.LinNP ;
|
||||
Pron = SS ; -- NB. Pronouns need enough info to become NP or Quant.
|
||||
Det = ResTMP.LinDet ; -- s : Str , n : Number
|
||||
Predet = SS ;
|
||||
Quant = ResTMP.LinQuant ; -- s : Number => Str
|
||||
Num = ResTMP.LinDet ;
|
||||
Card = ResTMP.LinDet ;
|
||||
ACard = SS ;
|
||||
Ord = SS ;
|
||||
DAP = SS ;
|
||||
|
||||
|
||||
--2 Numerals
|
||||
|
||||
-- Constructed in NumeralTMP.
|
||||
|
||||
Numeral = ResTMP.LinNumeral ;
|
||||
Digits = ResTMP.LinNumeral ;
|
||||
|
||||
--2 Structural words
|
||||
|
||||
-- Constructed in StructuralTMP.
|
||||
Conj = Coordination.ConjunctionDistr ** {
|
||||
n : Number -- The number of the NP that results from
|
||||
-- coordinating a list of NPs with that Conj.
|
||||
} ; -- "[Ann and Bob] are children" → and_Conj.n = Pl
|
||||
Subj = SS ;
|
||||
Prep = SS ;
|
||||
|
||||
|
||||
|
||||
--2 Words of open classes
|
||||
|
||||
-- These are constructed in LexiconTMP and in
|
||||
-- additional lexicon modules.
|
||||
|
||||
-- TODO: eventually different lincats
|
||||
VS, -- sentence-complement verb e.g. "claim"
|
||||
VQ, -- question-complement verb e.g. "wonder"
|
||||
VA, -- adjective-complement verb e.g. "look"
|
||||
V = ResTMP.LinV ;
|
||||
|
||||
VV -- verb-phrase-complement verb e.g. "want"
|
||||
= SS ;
|
||||
|
||||
V2A, -- verb with NP and AP complement e.g. "paint"
|
||||
V2V, -- verb with NP and V complement e.g. "cause"
|
||||
V2S, -- verb with NP and S complement e.g. "tell"
|
||||
V2Q, -- verb with NP and Q complement e.g. "ask"
|
||||
V2 = SS ;
|
||||
V3 = SS ;
|
||||
|
||||
A = SS ;
|
||||
A2 = SS ;
|
||||
|
||||
N = ResTMP.LinN ;
|
||||
N2 = ResTMP.LinN ;
|
||||
N3 = ResTMP.LinN ;
|
||||
PN = SS ;
|
||||
|
||||
-- From the Names module, not in the official API as of 2023-08
|
||||
GN = SS ; -- Given name, e.g. "George"
|
||||
SN = SS ; -- Second name, e.g. "Washington"
|
||||
LN = SS ; -- Location name, e.g. "Sweden"
|
||||
|
||||
linref
|
||||
Cl = linCl ;
|
||||
|
||||
}
|
||||
147
src/TEMPLATE/ConjunctionTMP.gf
Normal file
147
src/TEMPLATE/ConjunctionTMP.gf
Normal file
@@ -0,0 +1,147 @@
|
||||
concrete ConjunctionTMP of Conjunction =
|
||||
CatTMP ** open ResTMP, Coordination, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
{- Conjunction for category X needs four things:
|
||||
lincat [X]
|
||||
lin BaseX
|
||||
lin ConsX
|
||||
lin ConjX
|
||||
|
||||
For example, if X is defined as
|
||||
|
||||
lincat X = {s : Number => Str ; g : Gender} ;
|
||||
|
||||
then [X] will split its s field into two, and retain its other fields as is:
|
||||
|
||||
lincat [X] = {s1,s2 : Number => Str ; g : Gender} ;
|
||||
|
||||
Let us look at a simple case: Adv is of type {s : Str}
|
||||
Then [Adv] is {s1,s2 : Str}.
|
||||
BaseAdv, ConsAdv and ConjAdv can all use functions defined in prelude/Coordination:
|
||||
|
||||
BaseAdv = twoSS ;
|
||||
ConsAdv = consrSS comma ;
|
||||
ConjAdv = conjunctSS ;
|
||||
|
||||
--}
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Adverb and other simple {s : Str} types.
|
||||
lincat
|
||||
[Adv],[AdV],[IAdv] = {s1,s2 : Str} ;
|
||||
|
||||
lin
|
||||
BaseAdv, BaseAdV, BaseIAdv = twoSS ;
|
||||
ConsAdv, ConsAdV, ConsIAdv = consrSS comma ;
|
||||
ConjAdv, ConjAdV, ConjIAdv = conjunctDistrSS ;
|
||||
|
||||
{-
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- S is sometimes already {s : Str}, sometimes open for mood or word order.
|
||||
-- Simply take the lincat of S, and split the s field into s1 and s2.
|
||||
-- Then make sure that all of the other fields are retained.
|
||||
|
||||
lincat
|
||||
[S] = {s1, s2 : …} ;
|
||||
|
||||
lin
|
||||
-- : S -> S -> ListS ; -- John walks, Mary runs
|
||||
BaseS x y =
|
||||
|
||||
-- : S -> ListS -> ListS ; -- John walks, Mary runs, Bill swims
|
||||
ConsS x xs =
|
||||
|
||||
-- : Conj -> ListS -> S ; -- he walks and she runs
|
||||
ConjS conj xs =
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- RS is variable on … and has inherent …
|
||||
-- RS can modify CNs, which are open for …, and have inherent …
|
||||
|
||||
lincat
|
||||
[RS] = {s1,s2 : … => Str} ;
|
||||
|
||||
lin
|
||||
|
||||
-- : RS -> RS -> ListRS ; -- who walks, whom I know
|
||||
BaseRS x y =
|
||||
|
||||
-- : RS -> ListRS -> ListRS ; -- who wals, whom I know, who is here
|
||||
ConsRS x xs =
|
||||
|
||||
-- : Conj -> ListRS -> RS ; -- who walks and whose mother runs
|
||||
ConjRS conj xs =
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- NP is variable on … and has inherent …
|
||||
|
||||
lincat
|
||||
[NP] = {s1, s2 : …} ;
|
||||
|
||||
lin
|
||||
-- : NP -> NP -> ListNP ; -- John, Mary
|
||||
BaseNP x y =
|
||||
|
||||
-- : NP -> ListNP -> ListNP ; -- John, Mary, Bill
|
||||
ConsNP x xs =
|
||||
|
||||
-- : Conj -> ListNP -> NP ; -- she or we
|
||||
ConjNP conj xs =
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- AP is variable on … and has an inherent …
|
||||
|
||||
lincat
|
||||
[AP] = {s1, s2 : …} ;
|
||||
|
||||
lin
|
||||
-- : AP -> AP -> ListAP ; -- red, white
|
||||
BaseAP x y =
|
||||
|
||||
-- : AP -> ListAP -> ListAP ; -- red, white, blue
|
||||
ConsAP x xs =
|
||||
|
||||
-- : Conj -> ListAP -> AP ; -- cold and warm
|
||||
ConjAP conj xs =
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- CN is variable on …
|
||||
-- CN conjunction is not in the API, so this can be lower prio
|
||||
|
||||
lincat
|
||||
[CN] = {s1, s2 : …} ;
|
||||
|
||||
lin
|
||||
-- : CN -> CN -> ListCN ; -- man, woman
|
||||
BaseCN x y =
|
||||
|
||||
-- : CN -> ListCN -> ListCN ; -- man, woman, child
|
||||
ConsCN x xs =
|
||||
|
||||
-- : Conj -> ListCN -> CN ; -- man and woman
|
||||
ConjCN conj xs =
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Det and DAP
|
||||
-- Note that there is no [Det], the way to coordinate Dets is to make them
|
||||
-- into DAP first, using Noun.DetDAP : Det -> DAP ;
|
||||
-- DAP ("three small") isn't used in any API functions, so lower prio.
|
||||
|
||||
lincat
|
||||
[DAP] = {s1, s2 : …} ;
|
||||
|
||||
lin
|
||||
-- : DAP -> DAP -> ListDAP ;
|
||||
BaseDAP x y =
|
||||
|
||||
-- : DAP -> ListDAP -> ListDAP ;
|
||||
ConsDAP xs x =
|
||||
|
||||
-- : Conj -> ListDAP -> Det ; -- his or her
|
||||
ConjDet conj xs =
|
||||
-}
|
||||
}
|
||||
117
src/TEMPLATE/ConstructionTMP.gf
Normal file
117
src/TEMPLATE/ConstructionTMP.gf
Normal file
@@ -0,0 +1,117 @@
|
||||
concrete ConstructionTMP of Construction = CatTMP ** open ParadigmsTMP in {
|
||||
|
||||
lincat
|
||||
Timeunit = N ;
|
||||
Weekday = N ;
|
||||
Monthday = NP ;
|
||||
Month = N ;
|
||||
Year = NP ;
|
||||
{-
|
||||
lin
|
||||
|
||||
timeunitAdv n time =
|
||||
let n_card : Card = n ;
|
||||
n_hours_NP : NP = mkNP n_card time ;
|
||||
in SyntaxTMP.mkAdv for_Prep n_hours_NP | mkAdv (n_hours_NP.s ! R.npNom) ;
|
||||
|
||||
weekdayPunctualAdv w = ; -- on Sunday
|
||||
weekdayHabitualAdv w = ; -- on Sundays
|
||||
weekdayNextAdv w = -- next Sunday
|
||||
weekdayLastAdv w = -- last Sunday
|
||||
|
||||
monthAdv m = mkAdv in_Prep (mkNP m) ;
|
||||
yearAdv y = mkAdv in_Prep y ;
|
||||
dayMonthAdv d m = ; -- on 17 TMP
|
||||
monthYearAdv m y = ; -- in TMP 2012
|
||||
dayMonthYearAdv d m y = ; -- on 17 TMP 2013
|
||||
|
||||
intYear = symb ;
|
||||
intMonthday = symb ;
|
||||
|
||||
lincat Language = N ;
|
||||
|
||||
lin InLanguage l = mkAdv ???_Prep (mkNP l) ;
|
||||
|
||||
lin
|
||||
weekdayN w = w ;
|
||||
monthN m = m ;
|
||||
|
||||
weekdayPN w = mkPN w ;
|
||||
monthPN m = mkPN m ;
|
||||
|
||||
languageCN l = mkCN l ;
|
||||
languageNP l = mkNP l ;
|
||||
|
||||
|
||||
oper mkLanguage : Str -> N = \s -> mkN s ;
|
||||
|
||||
----------------------------------------------
|
||||
---- lexicon of special names
|
||||
|
||||
lin second_Timeunit = mkN "second" ;
|
||||
lin minute_Timeunit = mkN "minute" ;
|
||||
lin hour_Timeunit = mkN "hour" ;
|
||||
lin day_Timeunit = mkN "day" ;
|
||||
lin week_Timeunit = mkN "week" ;
|
||||
lin month_Timeunit = mkN "month" ;
|
||||
lin year_Timeunit = mkN "year" ;
|
||||
|
||||
lin monday_Weekday = mkN "Monday" ;
|
||||
lin tuesday_Weekday = mkN "Tuesday" ;
|
||||
lin wednesday_Weekday = mkN "Wednesday" ;
|
||||
lin thursday_Weekday = mkN "Thursday" ;
|
||||
lin friday_Weekday = mkN "Friday" ;
|
||||
lin saturday_Weekday = mkN "Saturday" ;
|
||||
lin sunday_Weekday = mkN "Sunday" ;
|
||||
|
||||
lin january_Month = mkN "January" ;
|
||||
lin february_Month = mkN "February" ;
|
||||
lin march_Month = mkN "March" ;
|
||||
lin april_Month = mkN "April" ;
|
||||
lin may_Month = mkN "May" ;
|
||||
lin june_Month = mkN "June" ;
|
||||
lin july_Month = mkN "July" ;
|
||||
lin august_Month = mkN "August" ;
|
||||
lin september_Month = mkN "September" ;
|
||||
lin october_Month = mkN "October" ;
|
||||
lin november_Month = mkN "November" ;
|
||||
lin december_Month = mkN "December" ;
|
||||
|
||||
lin afrikaans_Language = mkLanguage "Afrikaans" ;
|
||||
lin amharic_Language = mkLanguage "Amharic" ;
|
||||
lin arabic_Language = mkLanguage "Arabic" ;
|
||||
lin bulgarian_Language = mkLanguage "Bulgarian" ;
|
||||
lin catalan_Language = mkLanguage "Catalan" ;
|
||||
lin chinese_Language = mkLanguage "Chinese" ;
|
||||
lin danish_Language = mkLanguage "Danish" ;
|
||||
lin dutch_Language = mkLanguage "Dutch" ;
|
||||
lin english_Language = mkLanguage "Euslish" ;
|
||||
lin estonian_Language = mkLanguage "Estonian" ;
|
||||
lin finnish_Language = mkLanguage "Finnish" ;
|
||||
lin french_Language = mkLanguage "French" ;
|
||||
lin german_Language = mkLanguage "German" ;
|
||||
lin greek_Language = mkLanguage "Greek" ;
|
||||
lin hebrew_Language = mkLanguage "Hebrew" ;
|
||||
lin hindi_Language = mkLanguage "Hindi" ;
|
||||
lin japanese_Language = mkLanguage "Japanese" ;
|
||||
lin italian_Language = mkLanguage "Italian" ;
|
||||
lin latin_Language = mkLanguage "Latin" ;
|
||||
lin latvian_Language = mkLanguage "Latvian" ;
|
||||
lin maltese_Language = mkLanguage "Maltese" ;
|
||||
lin nepali_Language = mkLanguage "Nepali" ;
|
||||
lin norwegian_Language = mkLanguage "Norwegian" ;
|
||||
lin persian_Language = mkLanguage "Persian" ;
|
||||
lin polish_Language = mkLanguage "Polish" ;
|
||||
lin punjabi_Language = mkLanguage "Punjabi" ;
|
||||
lin romanian_Language = mkLanguage "Romanian" ;
|
||||
lin russian_Language = mkLanguage "Russian" ;
|
||||
lin sindhi_Language = mkLanguage "Sindhi" ;
|
||||
lin spanish_Language = mkLanguage "Spanish" ;
|
||||
lin swahili_Language = mkLanguage "Swahili" ;
|
||||
lin swedish_Language = mkLanguage "Swedish" ;
|
||||
lin thai_Language = mkLanguage "Thai" ;
|
||||
lin turkish_Language = mkLanguage "Turkish" ;
|
||||
lin urdu_Language = mkLanguage "Urdu" ;
|
||||
|
||||
-}
|
||||
}
|
||||
35
src/TEMPLATE/ExtendTMP.gf
Normal file
35
src/TEMPLATE/ExtendTMP.gf
Normal file
@@ -0,0 +1,35 @@
|
||||
--# -path=.:../common:../abstract
|
||||
|
||||
concrete ExtendTMP of Extend = CatTMP
|
||||
** ExtendFunctor - [
|
||||
VPS -- finite VP's with tense and polarity
|
||||
, ListVPS
|
||||
, VPI
|
||||
, ListVPI -- infinitive VP's (TODO: with anteriority and polarity)
|
||||
, MkVPS
|
||||
, PredVPS
|
||||
|
||||
-- excluded because RGL funs needed for them not implemented yet
|
||||
, SlashBareV2S
|
||||
, PredAPVP
|
||||
, ComplBareVS
|
||||
, AdvIsNP, AdvIsNPAP
|
||||
, CompBareCN
|
||||
, CompIQuant
|
||||
, ComplSlashPartLast
|
||||
, ComplDirectVQ
|
||||
, ComplDirectVS
|
||||
, DetNPFem, DetNPMasc
|
||||
, ExistCN, ExistMassCN, ExistPluralCN, ExistsNP
|
||||
, ExistIPQS, ExistNPQS, ExistS
|
||||
, PredIAdvVP
|
||||
, PrepCN
|
||||
, ReflPossPron
|
||||
, UttVP, UttVPShort, UttAccNP, UttDatNP, UttAccIP, UttDatIP
|
||||
, EmptyRelSlash, StrandQuestSlash, StrandRelSlash
|
||||
, SubjRelNP
|
||||
, UseComp_ser, UseComp_estar
|
||||
, iFem_Pron, weFem_Pron, youFem_Pron, youPlFem_Pron, youPolFem_Pron, youPolPlFem_Pron, youPolPl_Pron, theyFem_Pron, theyNeutr_Pron
|
||||
, GenModNP
|
||||
|
||||
] with (Grammar=GrammarTMP) ;
|
||||
17
src/TEMPLATE/GrammarTMP.gf
Normal file
17
src/TEMPLATE/GrammarTMP.gf
Normal file
@@ -0,0 +1,17 @@
|
||||
concrete GrammarTMP of Grammar =
|
||||
NounTMP
|
||||
, VerbTMP
|
||||
, AdjectiveTMP
|
||||
, AdverbTMP
|
||||
, NumeralTMP
|
||||
, SentenceTMP
|
||||
, QuestionTMP
|
||||
, RelativeTMP
|
||||
, ConjunctionTMP
|
||||
, PhraseTMP
|
||||
, TextX
|
||||
, StructuralTMP
|
||||
, IdiomTMP
|
||||
, TenseX
|
||||
, NamesTMP -- Not part of original Grammar, here to trigger compilation
|
||||
;
|
||||
56
src/TEMPLATE/IdiomTMP.gf
Normal file
56
src/TEMPLATE/IdiomTMP.gf
Normal file
@@ -0,0 +1,56 @@
|
||||
|
||||
--1 Idiom: Idiomatic Expressions
|
||||
|
||||
concrete IdiomTMP of Idiom = CatTMP ** open Prelude, ResTMP, VerbTMP, QuestionTMP, NounTMP, StructuralTMP in {
|
||||
|
||||
-- This module defines constructions that are formed in fixed ways,
|
||||
-- often different even in closely related languages.
|
||||
|
||||
{-
|
||||
lin
|
||||
|
||||
|
||||
-- ImpersCl : VP -> Cl ; -- it is hot
|
||||
ImpersCl vp = {
|
||||
} ;
|
||||
|
||||
-- : NP -> Cl ; -- there is a house
|
||||
ExistNP np =
|
||||
|
||||
-- ExistIP : IP -> QCl ; -- which houses are there
|
||||
ExistIP ip =
|
||||
|
||||
-- GenericCl : VP -> Cl ; -- one sleeps
|
||||
GenericCl vp =
|
||||
|
||||
CleftNP : NP -> RS -> Cl ; -- it is I who did it
|
||||
CleftAdv : Adv -> S -> Cl ; -- it is here she slept
|
||||
|
||||
-- : NP -> Cl ; -- there is a house
|
||||
ExistNP np =
|
||||
|
||||
ExistIP : IP -> QCl ; -- which houses are there
|
||||
|
||||
-- 7/12/2012 generalizations of these
|
||||
|
||||
ExistNPAdv : NP -> Adv -> Cl ; -- there is a house in Paris
|
||||
ExistIPAdv : IP -> Adv -> QCl ; -- which houses are there in Paris
|
||||
|
||||
-- : VP -> VP ;
|
||||
ProgrVP vp = vp ** {
|
||||
} ;
|
||||
|
||||
|
||||
-- : VP -> Utt ; -- let's go
|
||||
ImpPl1 vp = { } ;
|
||||
|
||||
ImpP3 : NP -> VP -> Utt ; -- let John walk
|
||||
|
||||
-- 3/12/2013 non-reflexive uses of "self"
|
||||
|
||||
SelfAdvVP : VP -> VP ; -- is at home himself
|
||||
SelfAdVVP : VP -> VP ; -- is himself at home
|
||||
SelfNP : NP -> NP ; -- the president himself (is at home)
|
||||
-}
|
||||
|
||||
}
|
||||
5
src/TEMPLATE/LangTMP.gf
Normal file
5
src/TEMPLATE/LangTMP.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:../abstract:../common:../prelude:../api
|
||||
concrete LangTMP of Lang =
|
||||
GrammarTMP,
|
||||
LexiconTMP,
|
||||
ConstructionTMP ;
|
||||
419
src/TEMPLATE/LexiconTMP.gf
Normal file
419
src/TEMPLATE/LexiconTMP.gf
Normal file
@@ -0,0 +1,419 @@
|
||||
concrete LexiconTMP of Lexicon = CatTMP **
|
||||
open ParadigmsTMP, ResTMP in {
|
||||
|
||||
----
|
||||
-- A
|
||||
{-
|
||||
lin add_V3 = mkV3 (mkV "") ;
|
||||
lin airplane_N = mkN "" ;
|
||||
lin alas_Interj = mkInterj "" ;
|
||||
lin already_Adv = mkA "" ;
|
||||
lin animal_N = mkN "" ;
|
||||
lin answer_V2S = mkV2S (mkV "") ;
|
||||
lin apartment_N = mkN "" ;
|
||||
lin apple_N = mkN "" ;
|
||||
lin art_N = mkN "" ;
|
||||
lin ashes_N = mkN "" ;
|
||||
lin ask_V2Q = mkV2Q (mkV "") ;
|
||||
|
||||
----
|
||||
-- B
|
||||
|
||||
lin baby_N = mkN "" ;
|
||||
lin back_N = mkN "" ;
|
||||
lin bad_A = mkA "" ;
|
||||
lin bank_N = mkN "" ;
|
||||
lin bark_N = mkN "" ;
|
||||
lin beautiful_A = mkA "" ;
|
||||
lin become_VA = mkVA (mkV "") ;
|
||||
lin beer_N = mkN "" ;
|
||||
lin beg_V2V = mkV2V (mkV "") ;
|
||||
lin belly_N = mkN "" ;
|
||||
lin big_A = mkA "" ;
|
||||
lin bike_N = mkN "" ;
|
||||
lin bird_N = mkN "" ;
|
||||
lin bite_V2 = mkV2 "" ;
|
||||
lin black_A = mkA "" ; -}
|
||||
lin blood_N = mkN "blood" ;
|
||||
{-lin blow_V = mkV "" ;
|
||||
lin blue_A = mkA "" ;
|
||||
lin boat_N = mkN "" ;
|
||||
lin bone_N = mkN "" ;
|
||||
lin boot_N = mkN "" ;
|
||||
lin boss_N = mkN "" ;
|
||||
lin book_N = mkN "" ;
|
||||
lin boy_N = mkN "" ;
|
||||
lin bread_N = mkN "" ;
|
||||
lin break_V2 = mkV2 "" ;
|
||||
lin breast_N = mkN "" ;
|
||||
lin breathe_V = mkV "" ;
|
||||
lin broad_A = mkA "" ;
|
||||
lin brother_N2 = mkN "" ;
|
||||
lin brown_A = mkA "" ;
|
||||
lin burn_V = mkV "" ;
|
||||
lin butter_N = mkN "" ;
|
||||
lin buy_V2 = mkV2 "" ;
|
||||
|
||||
----
|
||||
-- C
|
||||
|
||||
lin camera_N = mkN "" ;
|
||||
lin cap_N = mkN "" ;
|
||||
lin car_N = mkN "" ;
|
||||
lin carpet_N = mkN "" ;
|
||||
lin cat_N = mkN "" ;
|
||||
lin ceiling_N = mkN "" ;
|
||||
lin chair_N = mkN "" ;
|
||||
lin cheese_N = mkN "" ;
|
||||
lin child_N = mkN "" ;
|
||||
lin church_N = mkN "" ;
|
||||
lin city_N = mkN "" ;
|
||||
lin clean_A = mkA "" ;
|
||||
lin clever_A = mkA "" ;
|
||||
lin close_V2 = mkV2 "" ;
|
||||
lin cloud_N = mkN "" ;
|
||||
lin coat_N = mkN "" ;
|
||||
lin cold_A = mkA "" ;
|
||||
lin come_V = mkV "" ;
|
||||
lin computer_N = mkN "" ;
|
||||
lin correct_A = mkA "" ;
|
||||
lin count_V2 = mkV2 "" ;
|
||||
lin country_N = mkN "" ;
|
||||
lin cousin_N = mkN "" ;
|
||||
lin cow_N = mkN "" ;
|
||||
lin cut_V2 = mkV2 "" ;
|
||||
|
||||
----
|
||||
-- D
|
||||
|
||||
lin day_N = mkN "" ; -}
|
||||
lin die_V = mkV "die" ;
|
||||
{-lin dig_V = mkV "" ;
|
||||
lin dirty_A = mkA "" ;
|
||||
lin distance_N3 = mkN3 (mkN "") ;
|
||||
lin do_V2 = mkV2 "" ;
|
||||
lin doctor_N = mkN "" ;
|
||||
lin dog_N = mkN "" ;
|
||||
lin door_N = mkN "" ;
|
||||
lin drink_V2 = mkV2 "" ;
|
||||
lin dry_A = mkA "" ;
|
||||
lin dull_A = mkA "" ;
|
||||
lin dust_N = mkN "" ;
|
||||
|
||||
----
|
||||
-- E
|
||||
|
||||
lin ear_N = mkN "" ;
|
||||
lin earth_N = mkN "" ;
|
||||
lin eat_V2 = mkV "" ;
|
||||
lin egg_N = mkN "" ;
|
||||
lin empty_A = mkA "" ;
|
||||
lin enemy_N = mkN "" ;
|
||||
lin eye_N = mkN "" ;
|
||||
|
||||
----
|
||||
-- F
|
||||
|
||||
lin factory_N = mkN "" ;
|
||||
lin fall_V = mkV "" ;
|
||||
lin far_Adv = mkA "" ;
|
||||
lin fat_N = mkN "" ;
|
||||
lin father_N2 = mkN2 (mkN "") ;
|
||||
lin fear_V2 = mkV2 "" ;
|
||||
lin fear_VS = mkVS (mkV "") ;
|
||||
lin feather_N = mkN "" ;
|
||||
lin fight_V2 = mkV2 "" ;
|
||||
lin find_V2 = mkV2 "" ;
|
||||
lin fingernail_N = mkN "" ;
|
||||
lin fire_N = mkN "" ;
|
||||
lin fish_N = mkN "" ;
|
||||
lin float_V = mkV "" ;
|
||||
lin floor_N = mkN "" ;
|
||||
lin flow_V = mkV "" ;
|
||||
lin flower_N = mkN "" ;
|
||||
lin fly_V = mkV "" ;
|
||||
lin fog_N = mkN "" ;
|
||||
lin foot_N = mkN "" ;
|
||||
lin forest_N = mkN "" ;
|
||||
lin forget_V2 = mkV2 "" ;
|
||||
lin freeze_V = mkV "" ;
|
||||
lin fridge_N = mkN "" ;
|
||||
lin friend_N = mkN "" ;
|
||||
lin fruit_N = mkN "" ;
|
||||
lin full_A = mkA "" ;
|
||||
--lin fun_AV
|
||||
|
||||
----
|
||||
-- G
|
||||
|
||||
lin garden_N = mkN "" ;
|
||||
lin girl_N = mkN "" ;
|
||||
lin give_V3 = mkV3 (mkV "") ;
|
||||
lin glove_N = mkN "" ;
|
||||
lin go_V = mkV "" ;
|
||||
lin gold_N = mkN "" ;
|
||||
lin good_A = mkA "" ;
|
||||
lin grammar_N = mkN "" ;
|
||||
lin grass_N = mkN "" ;
|
||||
lin green_A = mkA "" ;
|
||||
|
||||
----
|
||||
-- H
|
||||
|
||||
lin hair_N = mkN "" ;
|
||||
lin hand_N = mkN "" ;
|
||||
lin harbour_N = mkN "" ;
|
||||
lin hat_N = mkN "" ;
|
||||
lin hate_V2 = mkV2 "" ;
|
||||
lin head_N = mkN "" ;
|
||||
lin hear_V2 = mkV2 "" ;
|
||||
lin heart_N = mkN "" ;
|
||||
lin heavy_A = mkA "" ;
|
||||
lin hill_N = mkN "" ;
|
||||
lin hit_V2 = mkV2 "" ;
|
||||
lin hold_V2 = mkV2 "" ;
|
||||
lin hope_VS = mkV "" ;
|
||||
lin horn_N = mkN "" ;
|
||||
lin horse_N = mkN "" ;
|
||||
lin hot_A = mkA "" ;
|
||||
lin house_N = mkN "" ;
|
||||
lin hunt_V2 = mkV2 "" ;
|
||||
lin husband_N = mkN "" ;
|
||||
|
||||
--------
|
||||
-- I - K
|
||||
|
||||
lin ice_N = mkN "" ;
|
||||
lin industry_N = mkN "" ;
|
||||
lin iron_N = mkN "" ;
|
||||
lin john_PN = mkPN "" ;
|
||||
lin jump_V = mkV "" ;
|
||||
lin kill_V2 = mkV2 "" ;
|
||||
lin king_N = mkN "" ;
|
||||
lin knee_N = mkN "" ;
|
||||
lin know_V2 = mkV2 "" ;
|
||||
lin know_VQ = mkVQ (mkV "") ;
|
||||
lin know_VS = mkV "" ;
|
||||
|
||||
|
||||
----
|
||||
-- L
|
||||
|
||||
lin lake_N = mkN "" ;
|
||||
lin lamp_N = mkN "" ;
|
||||
lin language_N = mkN "" ;
|
||||
lin laugh_V = mkV "" ;
|
||||
lin leaf_N = mkN "" ;
|
||||
lin learn_V2 = mkV2 "" ;
|
||||
lin leather_N = mkN "" ;
|
||||
lin leave_V2 = mkV2 "" ;
|
||||
lin leg_N = mkN "" ;
|
||||
lin lie_V = mkV "" ;
|
||||
lin like_V2 = mkV2 "" ;
|
||||
lin listen_V2 = mkV2 "" ;
|
||||
lin live_V = mkV "";
|
||||
lin liver_N = mkN "" ;
|
||||
lin long_A = mkA "" ;
|
||||
lin lose_V2 = mkV2 "" ;
|
||||
lin louse_N = mkN "" ;
|
||||
lin love_N = mkN "" ;
|
||||
lin love_V2 = mkV2 "" ;
|
||||
|
||||
----
|
||||
-- M
|
||||
|
||||
lin man_N = mkN "" ;
|
||||
lin married_A2 = mkA2 (mkA "") ;
|
||||
lin meat_N = mkN "" ;
|
||||
lin milk_N = mkN "" ;
|
||||
lin moon_N = mkN "" ;
|
||||
lin mother_N2 = mkN2 (mkN "") ;
|
||||
lin mountain_N = mkN "" ;
|
||||
lin mouth_N = mkN "" ;
|
||||
lin music_N = mkN "" ;
|
||||
|
||||
----
|
||||
-- N
|
||||
|
||||
lin name_N = mkN "" ;
|
||||
lin narrow_A = mkA "" ;
|
||||
lin near_A = mkA "" ;
|
||||
lin neck_N = mkN "" ;
|
||||
lin new_A = mkA "" ;
|
||||
lin newspaper_N = mkN "" ;
|
||||
lin night_N = mkN "" ;
|
||||
lin nose_N = mkN "" ;
|
||||
lin now_Adv = mkAdv "" ;
|
||||
lin number_N = mkN "" ;
|
||||
|
||||
--------
|
||||
-- O - P
|
||||
|
||||
|
||||
lin oil_N = mkN "" ;
|
||||
lin old_A = mkA "" ;
|
||||
lin open_V2 = mkV2 "" ;
|
||||
lin paint_V2A = mkV2A (mkV "") ;
|
||||
lin paper_N = mkN "" ;
|
||||
lin paris_PN = mkPN "Paris" ;
|
||||
lin peace_N = mkN "" ;
|
||||
lin pen_N = mkN "" ;
|
||||
lin person_N = mkN "" ;
|
||||
lin planet_N = mkN "" ;
|
||||
lin plastic_N = mkN "" ;
|
||||
lin play_V = mkV "" ;
|
||||
lin policeman_N = mkN "" ;
|
||||
lin priest_N = mkN "" ;
|
||||
lin pull_V2 = mkV2 "" ;
|
||||
lin push_V2 = mkV2 "" ;
|
||||
lin put_V2 = mkV2 "" ;
|
||||
|
||||
--------
|
||||
-- Q - R
|
||||
|
||||
|
||||
lin queen_N = mkN "" ;
|
||||
lin question_N = mkN "" ;
|
||||
lin radio_N = mkN "" ;
|
||||
lin rain_N = mkN "" ;
|
||||
lin rain_V0 = mkV "" ;
|
||||
lin read_V2 = mkV2 "" ;
|
||||
lin ready_A = mkA "" ;
|
||||
lin reason_N = mkN "" ;
|
||||
lin red_A = mkA "" ;
|
||||
lin religion_N = mkN "" ;
|
||||
lin restaurant_N = mkN "" ;
|
||||
lin river_N = mkN "" ;
|
||||
lin road_N = mkN "" ;
|
||||
lin rock_N = mkN "" ;
|
||||
lin roof_N = mkN "" ;
|
||||
lin root_N = mkN "" ;
|
||||
lin rope_N = mkN "" ;
|
||||
lin rotten_A = mkA "" ;
|
||||
lin round_A = mkA "" ;
|
||||
lin rub_V2 = mkV2 "" ;
|
||||
lin rubber_N = mkN "" ;
|
||||
lin rule_N = mkN "" ;
|
||||
lin run_V = mkV "" ;
|
||||
|
||||
----
|
||||
-- S
|
||||
|
||||
lin salt_N = mkN "" ;
|
||||
lin sand_N = mkN "" ;
|
||||
lin say_VS = mkVS (mkV "") ;
|
||||
lin school_N = mkN "" ;
|
||||
lin science_N = mkN "" ;
|
||||
lin scratch_V2 = mkV2 "" ;
|
||||
lin sea_N = mkN "" ;
|
||||
lin see_V2 = mkV2 "" ;
|
||||
lin seed_N = mkN "" ;
|
||||
lin seek_V2 = mkV2 "" ;
|
||||
lin sell_V3 = mkV3 (mkV "" Meng) emptyPrep emptyPrep ; -- TODO
|
||||
lin send_V3 = mkV3 (mkV "") ;
|
||||
lin sew_V = mkV "" ;
|
||||
lin sharp_A = mkA "" ;
|
||||
lin sheep_N = mkN "" fem ;
|
||||
lin ship_N = mkN "" ;
|
||||
lin shirt_N = mkN "" ;
|
||||
lin shoe_N = mkN "" ;
|
||||
lin shop_N = mkN "" ;
|
||||
lin short_A = mkA "" ;
|
||||
lin silver_N = mkN "" ;
|
||||
lin sing_V = mkV "" ;
|
||||
lin sister_N = mkN "" ;
|
||||
lin sit_V = mkV "" ;
|
||||
lin skin_N = mkN "" ;
|
||||
lin sky_N = mkN "" ;
|
||||
lin sleep_V = mkV "" ;
|
||||
lin small_A = mkA "" ;
|
||||
lin smell_V = mkV "" ;
|
||||
lin smoke_N = mkN "" ;
|
||||
lin smooth_A = mkA "" ;
|
||||
lin snake_N = mkN "" ;
|
||||
lin snow_N = mkN "" ;
|
||||
lin sock_N = mkN "" ;
|
||||
lin song_N = mkN "" ;
|
||||
lin speak_V2 = mkV2 "" ;
|
||||
lin spit_V = mkV "" ;
|
||||
lin split_V2 = mkV2 "" ;
|
||||
lin squeeze_V2 = mkV2 "" ;
|
||||
lin stab_V2 = mkV2 "" ;
|
||||
lin stand_V = mkV "" ;
|
||||
lin star_N = mkN "" ;
|
||||
lin steel_N = mkN "" ;
|
||||
lin stick_N = mkN "" ;
|
||||
lin stone_N = mkN "" ;
|
||||
lin stop_V = mkV "" ;
|
||||
lin stove_N = mkN "" ;
|
||||
lin straight_A = mkA "" ;
|
||||
lin student_N = mkN "" ;
|
||||
lin stupid_A = mkA "" ;
|
||||
lin suck_V2 = mkV2 "" ;
|
||||
lin sun_N = mkN "" ;
|
||||
lin swell_V = mkV "" ;
|
||||
lin swim_V = mkV "" ;
|
||||
|
||||
----
|
||||
-- T
|
||||
|
||||
|
||||
lin table_N = mkN "" ;
|
||||
lin tail_N = mkN "" ;
|
||||
lin talk_V3 = mkV3 (mkV "" Ber) (mkPrep "") (mkPrep "") ;
|
||||
lin teach_V2 = mkV2 "" ;
|
||||
lin teacher_N = mkN "" ;
|
||||
lin television_N = mkN "" ;
|
||||
lin thick_A = mkA "" ;
|
||||
lin thin_A = mkA "" ;
|
||||
lin think_V = mkV "" ;
|
||||
lin throw_V2 = mkV2 "" ;
|
||||
lin tie_V2 = mkV2 "" ;
|
||||
lin today_Adv = mkA "" ;
|
||||
lin tongue_N = mkN "" ;
|
||||
lin tooth_N = mkN "" ;
|
||||
lin train_N = mkN "" ;
|
||||
lin travel_V = mkV "" ;
|
||||
lin tree_N = mkN "" ;
|
||||
lin turn_V = mkV "" ;
|
||||
|
||||
--------
|
||||
-- U - V
|
||||
|
||||
lin ugly_A = mkA "" ;
|
||||
lin uncertain_A = mkA "" ;
|
||||
lin understand_V2 = mkV2 "" ;
|
||||
lin university_N = mkN "" ;
|
||||
lin village_N = mkN "" ;
|
||||
lin vomit_V = mkV2 "" ;
|
||||
|
||||
--------
|
||||
-- W - Y
|
||||
|
||||
lin wait_V2 = mkV2 "" ;
|
||||
lin walk_V = mkV "" ;
|
||||
lin war_N = mkN "" ;
|
||||
lin warm_A = mkA "" ;
|
||||
lin wash_V2 = mkV2 "" ;
|
||||
lin watch_V2 = mkV2 "" ;
|
||||
lin water_N = mkNoun "" ;
|
||||
lin wet_A = mkA "" ;
|
||||
lin white_A = mkA "" ;
|
||||
lin wide_A = mkA "" ;
|
||||
lin wife_N = mkN "" ;
|
||||
lin win_V2 = mkV2 "" ;
|
||||
lin wind_N = mkN "" ;
|
||||
lin window_N = mkN "" ;
|
||||
lin wine_N = mkN "" ;
|
||||
lin wing_N = mkN "" ;
|
||||
lin wipe_V2 = mkV2 "" ;
|
||||
lin woman_N = mkN "" ;
|
||||
lin wonder_VQ = mkVQ (mkV "") ;
|
||||
lin wood_N = mkN "" ;
|
||||
lin worm_N = mkN "" ;
|
||||
lin write_V2 = mkV2 "" ;
|
||||
lin year_N = mkN "" ;
|
||||
lin yellow_A = mkA "" ;
|
||||
lin young_A = mkA "" ;
|
||||
-}
|
||||
}
|
||||
313
src/TEMPLATE/MissingTMP.gf
Normal file
313
src/TEMPLATE/MissingTMP.gf
Normal file
@@ -0,0 +1,313 @@
|
||||
resource MissingTMP = open GrammarTMP, Prelude in {
|
||||
-- temporary definitions to enable the compilation of RGL API
|
||||
oper AdAP : AdA -> AP -> AP = notYet "AdAP" ;
|
||||
oper AdAdv : AdA -> Adv -> Adv = notYet "AdAdv" ;
|
||||
oper AdNum : AdN -> Card -> Card = notYet "AdNum" ;
|
||||
oper AdVVP : AdV -> VP -> VP = notYet "AdVVP" ;
|
||||
oper AdVVPSlash : AdV -> VPSlash -> VPSlash = notYet "AdVVPSlash" ;
|
||||
oper AddAdvQVP : QVP -> IAdv -> QVP = notYet "AddAdvQVP" ;
|
||||
oper AdjCN : AP -> CN -> CN = notYet "AdjCN" ;
|
||||
oper AdjDAP : DAP -> AP -> DAP = notYet "AdjDAP" ;
|
||||
oper AdjOrd : Ord -> AP = notYet "AdjOrd" ;
|
||||
oper AdnCAdv : CAdv -> AdN = notYet "AdnCAdv" ;
|
||||
oper AdvAP : AP -> Adv -> AP = notYet "AdvAP" ;
|
||||
oper AdvCN : CN -> Adv -> CN = notYet "AdvCN" ;
|
||||
oper AdvIAdv : IAdv -> Adv -> IAdv = notYet "AdvIAdv" ;
|
||||
oper AdvIP : IP -> Adv -> IP = notYet "AdvIP" ;
|
||||
oper AdvImp : Adv -> Imp -> Imp = notYet "AdvImp" ;
|
||||
oper AdvNP : NP -> Adv -> NP = notYet "AdvNP" ;
|
||||
oper AdvQVP : VP -> IAdv -> QVP = notYet "AdvQVP" ;
|
||||
oper AdvS : Adv -> S -> S = notYet "AdvS" ;
|
||||
oper AdvSlash : ClSlash -> Adv -> ClSlash = notYet "AdvSlash" ;
|
||||
oper AdvVP : VP -> Adv -> VP = notYet "AdvVP" ;
|
||||
oper AdvVPSlash : VPSlash -> Adv -> VPSlash = notYet "AdvVPSlash" ;
|
||||
oper ApposCN : CN -> NP -> CN = notYet "ApposCN" ;
|
||||
oper BaseAP : AP -> AP -> ListAP = notYet "BaseAP" ;
|
||||
oper BaseAdV : AdV -> AdV -> ListAdV = notYet "BaseAdV" ;
|
||||
oper BaseAdv : Adv -> Adv -> ListAdv = notYet "BaseAdv" ;
|
||||
oper BaseCN : CN -> CN -> ListCN = notYet "BaseCN" ;
|
||||
oper BaseIAdv : IAdv -> IAdv -> ListIAdv = notYet "BaseIAdv" ;
|
||||
oper BaseNP : NP -> NP -> ListNP = notYet "BaseNP" ;
|
||||
oper BaseRS : RS -> RS -> ListRS = notYet "BaseRS" ;
|
||||
oper BaseS : S -> S -> ListS = notYet "BaseS" ;
|
||||
oper CAdvAP : CAdv -> AP -> NP -> AP = notYet "CAdvAP" ;
|
||||
oper CleftAdv : Adv -> S -> Cl = notYet "CleftAdv" ;
|
||||
oper CleftNP : NP -> RS -> Cl = notYet "CleftNP" ;
|
||||
oper CompAP : AP -> Comp = notYet "CompAP" ;
|
||||
oper CompAdv : Adv -> Comp = notYet "CompAdv" ;
|
||||
oper CompCN : CN -> Comp = notYet "CompCN" ;
|
||||
oper CompIAdv : IAdv -> IComp = notYet "CompIAdv" ;
|
||||
oper CompIP : IP -> IComp = notYet "CompIP" ;
|
||||
oper CompNP : NP -> Comp = notYet "CompNP" ;
|
||||
oper ComparA : A -> NP -> AP = notYet "ComparA" ;
|
||||
oper ComparAdvAdj : CAdv -> A -> NP -> Adv = notYet "ComparAdvAdj" ;
|
||||
oper ComparAdvAdjS : CAdv -> A -> S -> Adv = notYet "ComparAdvAdjS" ;
|
||||
oper ComplA2 : A2 -> NP -> AP = notYet "ComplA2" ;
|
||||
oper ComplN2 : N2 -> NP -> CN = notYet "ComplN2" ;
|
||||
oper ComplN3 : N3 -> NP -> N2 = notYet "ComplN3" ;
|
||||
oper ComplSlash : VPSlash -> NP -> VP = notYet "ComplSlash" ;
|
||||
oper ComplSlashIP : VPSlash -> IP -> QVP = notYet "ComplSlashIP" ;
|
||||
oper ComplVA : VA -> AP -> VP = notYet "ComplVA" ;
|
||||
oper ComplVQ : VQ -> QS -> VP = notYet "ComplVQ" ;
|
||||
oper ComplVS : VS -> S -> VP = notYet "ComplVS" ;
|
||||
oper ComplVV : VV -> VP -> VP = notYet "ComplVV" ;
|
||||
oper ConjAP : Conj -> ListAP -> AP = notYet "ConjAP" ;
|
||||
oper ConjAdV : Conj -> ListAdV -> AdV = notYet "ConjAdV" ;
|
||||
oper ConjAdv : Conj -> ListAdv -> Adv = notYet "ConjAdv" ;
|
||||
oper ConjCN : Conj -> ListCN -> CN = notYet "ConjCN" ;
|
||||
oper ConjDet : Conj -> ListDAP -> Det = notYet "ConjDet" ;
|
||||
oper ConjIAdv : Conj -> ListIAdv -> IAdv = notYet "ConjIAdv" ;
|
||||
oper ConjNP : Conj -> ListNP -> NP = notYet "ConjNP" ;
|
||||
oper ConjRS : Conj -> ListRS -> RS = notYet "ConjRS" ;
|
||||
oper ConjS : Conj -> ListS -> S = notYet "ConjS" ;
|
||||
oper ConsAP : AP -> ListAP -> ListAP = notYet "ConsAP" ;
|
||||
oper ConsAdV : AdV -> ListAdV -> ListAdV = notYet "ConsAdV" ;
|
||||
oper ConsAdv : Adv -> ListAdv -> ListAdv = notYet "ConsAdv" ;
|
||||
oper ConsCN : CN -> ListCN -> ListCN = notYet "ConsCN" ;
|
||||
oper ConsIAdv : IAdv -> ListIAdv -> ListIAdv = notYet "ConsIAdv" ;
|
||||
oper ConsNP : NP -> ListNP -> ListNP = notYet "ConsNP" ;
|
||||
oper ConsRS : RS -> ListRS -> ListRS = notYet "ConsRS" ;
|
||||
oper ConsS : S -> ListS -> ListS = notYet "ConsS" ;
|
||||
oper CountNP : Det -> NP -> NP = notYet "CountNP" ;
|
||||
oper DetCN : Det -> CN -> NP = notYet "DetCN" ;
|
||||
oper DetDAP : Det -> DAP = notYet "DetDAP" ;
|
||||
oper DetNP : Det -> NP = notYet "DetNP" ;
|
||||
oper DetQuantOrd : Quant -> Num -> Ord -> Det = notYet "DetQuantOrd" ;
|
||||
oper EmbedQS : QS -> SC = notYet "EmbedQS" ;
|
||||
oper EmbedS : S -> SC = notYet "EmbedS" ;
|
||||
oper EmbedVP : VP -> SC = notYet "EmbedVP" ;
|
||||
oper ExistIP : IP -> QCl = notYet "ExistIP" ;
|
||||
oper ExistIPAdv : IP -> Adv -> QCl = notYet "ExistIPAdv" ;
|
||||
oper ExistNP : NP -> Cl = notYet "ExistNP" ;
|
||||
oper ExistNPAdv : NP -> Adv -> Cl = notYet "ExistNPAdv" ;
|
||||
oper ExtAdvS : Adv -> S -> S = notYet "ExtAdvS" ;
|
||||
oper ExtAdvVP : VP -> Adv -> VP = notYet "ExtAdvVP" ;
|
||||
oper FunRP : Prep -> NP -> RP -> RP = notYet "FunRP" ;
|
||||
oper GenericCl : VP -> Cl = notYet "GenericCl" ;
|
||||
oper IdRP : RP = notYet "IdRP" ;
|
||||
oper IdetCN : IDet -> CN -> IP = notYet "IdetCN" ;
|
||||
oper IdetIP : IDet -> IP = notYet "IdetIP" ;
|
||||
oper IdetQuant : IQuant -> Num -> IDet = notYet "IdetQuant" ;
|
||||
oper ImpP3 : NP -> VP -> Utt = notYet "ImpP3" ;
|
||||
oper ImpPl1 : VP -> Utt = notYet "ImpPl1" ;
|
||||
oper ImpVP : VP -> Imp = notYet "ImpVP" ;
|
||||
oper ImpersCl : VP -> Cl = notYet "ImpersCl" ;
|
||||
oper MassNP : CN -> NP = notYet "MassNP" ;
|
||||
oper NumCard : Card -> Num = notYet "NumCard" ;
|
||||
oper NumDigits : Digits -> Card = notYet "NumDigits" ;
|
||||
oper NumNumeral : Numeral -> Card = notYet "NumNumeral" ;
|
||||
oper OrdDigits : Digits -> Ord = notYet "OrdDigits" ;
|
||||
oper OrdNumeral : Numeral -> Ord = notYet "OrdNumeral" ;
|
||||
oper OrdNumeralSuperl : Numeral -> A -> Ord = notYet "OrdNumeralSuperl" ;
|
||||
oper OrdSuperl : A -> Ord = notYet "OrdSuperl" ;
|
||||
oper PConjConj : Conj -> PConj = notYet "PConjConj" ;
|
||||
oper PPartNP : NP -> V2 -> NP = notYet "PPartNP" ;
|
||||
oper PartNP : CN -> NP -> CN = notYet "PartNP" ;
|
||||
oper PassV2 : V2 -> VP = notYet "PassV2" ;
|
||||
oper PhrUtt : PConj -> Utt -> Voc -> Phr = notYet "PhrUtt" ;
|
||||
oper PositA : A -> AP = notYet "PositA" ;
|
||||
oper PositAdAAdj : A -> AdA = notYet "PositAdAAdj" ;
|
||||
oper PositAdvAdj : A -> Adv = notYet "PositAdvAdj" ;
|
||||
oper PossNP : CN -> NP -> CN = notYet "PossNP" ;
|
||||
oper PossPron : Pron -> Quant = notYet "PossPron" ;
|
||||
oper PredSCVP : SC -> VP -> Cl = notYet "PredSCVP" ;
|
||||
oper PredVP : NP -> VP -> Cl = notYet "PredVP" ;
|
||||
oper PredetNP : Predet -> NP -> NP = notYet "PredetNP" ;
|
||||
oper PrepIP : Prep -> IP -> IAdv = notYet "PrepIP" ;
|
||||
oper PrepNP : Prep -> NP -> Adv = notYet "PrepNP" ;
|
||||
oper ProgrVP : VP -> VP = notYet "ProgrVP" ;
|
||||
oper QuestCl : Cl -> QCl = notYet "QuestCl" ;
|
||||
oper QuestIAdv : IAdv -> Cl -> QCl = notYet "QuestIAdv" ;
|
||||
oper QuestIComp : IComp -> NP -> QCl = notYet "QuestIComp" ;
|
||||
oper QuestQVP : IP -> QVP -> QCl = notYet "QuestQVP" ;
|
||||
oper QuestSlash : IP -> ClSlash -> QCl = notYet "QuestSlash" ;
|
||||
oper QuestVP : IP -> VP -> QCl = notYet "QuestVP" ;
|
||||
oper ReflA2 : A2 -> AP = notYet "ReflA2" ;
|
||||
oper ReflVP : VPSlash -> VP = notYet "ReflVP" ;
|
||||
oper RelCN : CN -> RS -> CN = notYet "RelCN" ;
|
||||
oper RelCl : Cl -> RCl = notYet "RelCl" ;
|
||||
oper RelNP : NP -> RS -> NP = notYet "RelNP" ;
|
||||
oper RelS : S -> RS -> S = notYet "RelS" ;
|
||||
oper RelSlash : RP -> ClSlash -> RCl = notYet "RelSlash" ;
|
||||
oper RelVP : RP -> VP -> RCl = notYet "RelVP" ;
|
||||
oper SSubjS : S -> Subj -> S -> S = notYet "SSubjS" ;
|
||||
oper SelfAdVVP : VP -> VP = notYet "SelfAdVVP" ;
|
||||
oper SelfAdvVP : VP -> VP = notYet "SelfAdvVP" ;
|
||||
oper SelfNP : NP -> NP = notYet "SelfNP" ;
|
||||
oper SentAP : AP -> SC -> AP = notYet "SentAP" ;
|
||||
oper SentCN : CN -> SC -> CN = notYet "SentCN" ;
|
||||
oper Slash2V3 : V3 -> NP -> VPSlash = notYet "Slash2V3" ;
|
||||
oper Slash3V3 : V3 -> NP -> VPSlash = notYet "Slash3V3" ;
|
||||
oper SlashPrep : Cl -> Prep -> ClSlash = notYet "SlashPrep" ;
|
||||
oper SlashV2A : V2A -> AP -> VPSlash = notYet "SlashV2A" ;
|
||||
oper SlashV2Q : V2Q -> QS -> VPSlash = notYet "SlashV2Q" ;
|
||||
oper SlashV2S : V2S -> S -> VPSlash = notYet "SlashV2S" ;
|
||||
oper SlashV2V : V2V -> VP -> VPSlash = notYet "SlashV2V" ;
|
||||
oper SlashV2VNP : V2V -> NP -> VPSlash -> VPSlash = notYet "SlashV2VNP" ;
|
||||
oper SlashV2a : V2 -> VPSlash = notYet "SlashV2a" ;
|
||||
oper SlashVP : NP -> VPSlash -> ClSlash = notYet "SlashVP" ;
|
||||
oper SlashVS : NP -> VS -> SSlash -> ClSlash = notYet "SlashVS" ;
|
||||
oper SlashVV : VV -> VPSlash -> VPSlash = notYet "SlashVV" ;
|
||||
oper SubjS : Subj -> S -> Adv = notYet "SubjS" ;
|
||||
oper TFullStop : Phr -> Text -> Text = notYet "TFullStop" ;
|
||||
oper Use2N3 : N3 -> N2 = notYet "Use2N3" ;
|
||||
oper Use3N3 : N3 -> N2 = notYet "Use3N3" ;
|
||||
oper UseA2 : A2 -> AP = notYet "UseA2" ;
|
||||
oper UseCl : Temp -> Pol -> Cl -> S = notYet "UseCl" ;
|
||||
oper UseComp : Comp -> VP = notYet "UseComp" ;
|
||||
oper UseComparA : A -> AP = notYet "UseComparA" ;
|
||||
oper UseCopula : VP = notYet "UseCopula" ;
|
||||
oper UseN : N -> CN = notYet "UseN" ;
|
||||
oper UseN2 : N2 -> CN = notYet "UseN2" ;
|
||||
oper UsePN : PN -> NP = notYet "UsePN" ;
|
||||
oper UsePron : Pron -> NP = notYet "UsePron" ;
|
||||
oper UseQCl : Temp -> Pol -> QCl -> QS = notYet "UseQCl" ;
|
||||
oper UseRCl : Temp -> Pol -> RCl -> RS = notYet "UseRCl" ;
|
||||
oper UseSlash : Temp -> Pol -> ClSlash -> SSlash = notYet "UseSlash" ;
|
||||
oper UseV : V -> VP = notYet "UseV" ;
|
||||
oper UttAP : AP -> Utt = notYet "UttAP" ;
|
||||
oper UttAdv : Adv -> Utt = notYet "UttAdv" ;
|
||||
oper UttCN : CN -> Utt = notYet "UttCN" ;
|
||||
oper UttCard : Card -> Utt = notYet "UttCard" ;
|
||||
oper UttIAdv : IAdv -> Utt = notYet "UttIAdv" ;
|
||||
oper UttIP : IP -> Utt = notYet "UttIP" ;
|
||||
oper UttImpPl : Pol -> Imp -> Utt = notYet "UttImpPl" ;
|
||||
oper UttImpPol : Pol -> Imp -> Utt = notYet "UttImpPol" ;
|
||||
oper UttImpSg : Pol -> Imp -> Utt = notYet "UttImpSg" ;
|
||||
oper UttInterj : Interj -> Utt = notYet "UttInterj" ;
|
||||
oper UttNP : NP -> Utt = notYet "UttNP" ;
|
||||
oper UttQS : QS -> Utt = notYet "UttQS" ;
|
||||
oper UttS : S -> Utt = notYet "UttS" ;
|
||||
oper UttVP : VP -> Utt = notYet "UttVP" ;
|
||||
oper VPSlashPrep : VP -> Prep -> VPSlash = notYet "VPSlashPrep" ;
|
||||
oper VocNP : NP -> Voc = notYet "VocNP" ;
|
||||
oper above_Prep : Prep = notYet "above_Prep" ;
|
||||
oper active2passive : Cl -> Cl = notYet "active2passive" ;
|
||||
oper after_Prep : Prep = notYet "after_Prep" ;
|
||||
oper alas_Interj : Interj = notYet "alas_Interj" ;
|
||||
oper all_Predet : Predet = notYet "all_Predet" ;
|
||||
oper almost_AdA : AdA = notYet "almost_AdA" ;
|
||||
oper almost_AdN : AdN = notYet "almost_AdN" ;
|
||||
oper already_Adv : Adv = notYet "already_Adv" ;
|
||||
oper although_Subj : Subj = notYet "although_Subj" ;
|
||||
oper always_AdV : AdV = notYet "always_AdV" ;
|
||||
oper as_CAdv : CAdv = notYet "as_CAdv" ;
|
||||
oper at_least_AdN : AdN = notYet "at_least_AdN" ;
|
||||
oper at_most_AdN : AdN = notYet "at_most_AdN" ;
|
||||
oper because_Subj : Subj = notYet "because_Subj" ;
|
||||
oper before_Prep : Prep = notYet "before_Prep" ;
|
||||
oper behind_Prep : Prep = notYet "behind_Prep" ;
|
||||
oper between_Prep : Prep = notYet "between_Prep" ;
|
||||
oper both7and_DConj : Conj = notYet "both7and_DConj" ;
|
||||
oper but_PConj : PConj = notYet "but_PConj" ;
|
||||
oper by8agent_Prep : Prep = notYet "by8agent_Prep" ;
|
||||
oper by8means_Prep : Prep = notYet "by8means_Prep" ;
|
||||
oper dconcat : Digits -> Digits -> Digits = notYet "dconcat" ;
|
||||
oper digits2num : Digits -> Numeral = notYet "digits2num" ;
|
||||
oper digits2numeral : Card -> Card = notYet "digits2numeral" ;
|
||||
oper dn : Dig -> Digit = notYet "dn" ;
|
||||
oper dn10 : Dig -> Sub10 = notYet "dn10" ;
|
||||
oper dn100 : Dig -> Dig -> Sub100 = notYet "dn100" ;
|
||||
oper dn1000 : Dig -> Dig -> Dig -> Sub1000 = notYet "dn1000" ;
|
||||
oper dn1000000a : Dig -> Dig -> Dig -> Dig -> Sub1000000 = notYet "dn1000000a" ;
|
||||
oper dn1000000b : Dig -> Dig -> Dig -> Dig -> Dig -> Sub1000000 = notYet "dn1000000b" ;
|
||||
oper dn1000000c : Dig -> Dig -> Dig -> Dig -> Dig -> Dig -> Sub1000000 = notYet "dn1000000c" ;
|
||||
oper during_Prep : Prep = notYet "during_Prep" ;
|
||||
oper either7or_DConj : Conj = notYet "either7or_DConj" ;
|
||||
oper every_Det : Det = notYet "every_Det" ;
|
||||
oper everybody_NP : NP = notYet "everybody_NP" ;
|
||||
oper everything_NP : NP = notYet "everything_NP" ;
|
||||
oper everywhere_Adv : Adv = notYet "everywhere_Adv" ;
|
||||
oper except_Prep : Prep = notYet "except_Prep" ;
|
||||
oper few_Det : Det = notYet "few_Det" ;
|
||||
oper for_Prep : Prep = notYet "for_Prep" ;
|
||||
oper from_Prep : Prep = notYet "from_Prep" ;
|
||||
oper he_Pron : Pron = notYet "he_Pron" ;
|
||||
oper here7from_Adv : Adv = notYet "here7from_Adv" ;
|
||||
oper here7to_Adv : Adv = notYet "here7to_Adv" ;
|
||||
oper here_Adv : Adv = notYet "here_Adv" ;
|
||||
oper how8many_IDet : IDet = notYet "how8many_IDet" ;
|
||||
oper how8much_IAdv : IAdv = notYet "how8much_IAdv" ;
|
||||
oper how_IAdv : IAdv = notYet "how_IAdv" ;
|
||||
oper i_Pron : Pron = notYet "i_Pron" ;
|
||||
oper if_Subj : Subj = notYet "if_Subj" ;
|
||||
oper if_then_Conj : Conj = notYet "if_then_Conj" ;
|
||||
oper in8front_Prep : Prep = notYet "in8front_Prep" ;
|
||||
oper in_Prep : Prep = notYet "in_Prep" ;
|
||||
oper it_Pron : Pron = notYet "it_Pron" ;
|
||||
oper john_PN : PN = notYet "john_PN" ;
|
||||
oper language_title_Utt : Utt = notYet "language_title_Utt" ;
|
||||
oper left_Ord : Ord = notYet "left_Ord" ;
|
||||
oper less_CAdv : CAdv = notYet "less_CAdv" ;
|
||||
oper many_Det : Det = notYet "many_Det" ;
|
||||
oper more_CAdv : CAdv = notYet "more_CAdv" ;
|
||||
oper most_Predet : Predet = notYet "most_Predet" ;
|
||||
oper much_Det : Det = notYet "much_Det" ;
|
||||
oper nd : Digit -> Dig = notYet "nd" ;
|
||||
oper nd10 : Sub10 -> Digits = notYet "nd10" ;
|
||||
oper nd100 : Sub100 -> Digits = notYet "nd100" ;
|
||||
oper nd1000 : Sub1000 -> Digits = notYet "nd1000" ;
|
||||
oper nd1000000 : Sub1000000 -> Digits = notYet "nd1000000" ;
|
||||
oper no_Quant : Quant = notYet "no_Quant" ;
|
||||
oper no_Utt : Utt = notYet "no_Utt" ;
|
||||
oper nobody_NP : NP = notYet "nobody_NP" ;
|
||||
oper not_Predet : Predet = notYet "not_Predet" ;
|
||||
oper nothing_NP : NP = notYet "nothing_NP" ;
|
||||
oper num : Sub1000000 -> Numeral = notYet "num" ;
|
||||
oper num2digits : Numeral -> Digits = notYet "num2digits" ;
|
||||
oper on_Prep : Prep = notYet "on_Prep" ;
|
||||
oper only_Predet : Predet = notYet "only_Predet" ;
|
||||
oper or_Conj : Conj = notYet "or_Conj" ;
|
||||
oper otherwise_PConj : PConj = notYet "otherwise_PConj" ;
|
||||
oper part_Prep : Prep = notYet "part_Prep" ;
|
||||
oper please_Voc : Voc = notYet "please_Voc" ;
|
||||
oper possess_Prep : Prep = notYet "possess_Prep" ;
|
||||
oper pot01 : Sub10 = notYet "pot01" ;
|
||||
oper pot1 : Digit -> Sub100 = notYet "pot1" ;
|
||||
oper pot110 : Sub100 = notYet "pot110" ;
|
||||
oper pot111 : Sub100 = notYet "pot111" ;
|
||||
oper pot1plus : Digit -> Sub10 -> Sub100 = notYet "pot1plus" ;
|
||||
oper pot1to19 : Digit -> Sub100 = notYet "pot1to19" ;
|
||||
oper pot2 : Sub10 -> Sub1000 = notYet "pot2" ;
|
||||
oper pot2plus : Sub10 -> Sub100 -> Sub1000 = notYet "pot2plus" ;
|
||||
oper pot3 : Sub1000 -> Sub1000000 = notYet "pot3" ;
|
||||
oper pot3plus : Sub1000 -> Sub1000 -> Sub1000000 = notYet "pot3plus" ;
|
||||
oper quite_Adv : AdA = notYet "quite_Adv" ;
|
||||
oper right_Ord : Ord = notYet "right_Ord" ;
|
||||
oper she_Pron : Pron = notYet "she_Pron" ;
|
||||
oper so_AdA : AdA = notYet "so_AdA" ;
|
||||
oper somePl_Det : Det = notYet "somePl_Det" ;
|
||||
oper someSg_Det : Det = notYet "someSg_Det" ;
|
||||
oper somebody_NP : NP = notYet "somebody_NP" ;
|
||||
oper something_NP : NP = notYet "something_NP" ;
|
||||
oper somewhere_Adv : Adv = notYet "somewhere_Adv" ;
|
||||
oper that_Quant : Quant = notYet "that_Quant" ;
|
||||
oper that_Subj : Subj = notYet "that_Subj" ;
|
||||
oper there7from_Adv : Adv = notYet "there7from_Adv" ;
|
||||
oper there7to_Adv : Adv = notYet "there7to_Adv" ;
|
||||
oper there_Adv : Adv = notYet "there_Adv" ;
|
||||
oper therefore_PConj : PConj = notYet "therefore_PConj" ;
|
||||
oper they_Pron : Pron = notYet "they_Pron" ;
|
||||
oper this_Quant : Quant = notYet "this_Quant" ;
|
||||
oper through_Prep : Prep = notYet "through_Prep" ;
|
||||
oper to_Prep : Prep = notYet "to_Prep" ;
|
||||
oper too_AdA : AdA = notYet "too_AdA" ;
|
||||
oper under_Prep : Prep = notYet "under_Prep" ;
|
||||
oper very_AdA : AdA = notYet "very_AdA" ;
|
||||
oper we_Pron : Pron = notYet "we_Pron" ;
|
||||
oper whatPl_IP : IP = notYet "whatPl_IP" ;
|
||||
oper whatSg_IP : IP = notYet "whatSg_IP" ;
|
||||
oper when_IAdv : IAdv = notYet "when_IAdv" ;
|
||||
oper when_Subj : Subj = notYet "when_Subj" ;
|
||||
oper where_IAdv : IAdv = notYet "where_IAdv" ;
|
||||
oper which_IQuant : IQuant = notYet "which_IQuant" ;
|
||||
oper whoPl_IP : IP = notYet "whoPl_IP" ;
|
||||
oper whoSg_IP : IP = notYet "whoSg_IP" ;
|
||||
oper why_IAdv : IAdv = notYet "why_IAdv" ;
|
||||
oper with_Prep : Prep = notYet "with_Prep" ;
|
||||
oper without_Prep : Prep = notYet "without_Prep" ;
|
||||
oper yes_Utt : Utt = notYet "yes_Utt" ;
|
||||
oper youPl_Pron : Pron = notYet "youPl_Pron" ;
|
||||
oper youPol_Pron : Pron = notYet "youPol_Pron" ;
|
||||
oper youSg_Pron : Pron = notYet "youSg_Pron" ;
|
||||
}
|
||||
36
src/TEMPLATE/NamesTMP.gf
Normal file
36
src/TEMPLATE/NamesTMP.gf
Normal file
@@ -0,0 +1,36 @@
|
||||
concrete NamesTMP of Names = CatTMP ** open Prelude in {
|
||||
|
||||
-- An API layer to deal with names
|
||||
-- Not part of the RGL API, but used in the AW project
|
||||
-- So depends on your goals whether this is high or low priority to implement.
|
||||
{-
|
||||
lin
|
||||
-- : GN -> NP ;
|
||||
GivenName gn =
|
||||
|
||||
-- : SN -> NP ;
|
||||
MaleSurname sn =
|
||||
|
||||
-- : SN -> NP ;
|
||||
FemaleSurname sn =
|
||||
|
||||
-- : SN -> NP ;
|
||||
PlSurname sn =
|
||||
|
||||
-- : GN -> SN -> NP ;
|
||||
FullName gn sn =
|
||||
|
||||
lin
|
||||
-- : LN -> NP ;
|
||||
UseLN ln =
|
||||
|
||||
-- : LN -> NP ;
|
||||
PlainLN ln =
|
||||
|
||||
-- : LN -> Adv ;
|
||||
InLN ln =
|
||||
|
||||
-- : AP -> LN -> LN ;
|
||||
AdjLN ap ln =
|
||||
-}
|
||||
}
|
||||
210
src/TEMPLATE/NounTMP.gf
Normal file
210
src/TEMPLATE/NounTMP.gf
Normal file
@@ -0,0 +1,210 @@
|
||||
concrete NounTMP of Noun = CatTMP ** open ResTMP, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
--2 Noun phrases
|
||||
|
||||
-- : Det -> CN -> NP
|
||||
DetCN det cn = emptyNP ** {
|
||||
s = det.s ++ cn.s ! det.n
|
||||
} ;
|
||||
{-
|
||||
-- : PN -> NP ;
|
||||
-- Assuming that lincat PN = lincat NP
|
||||
UsePN pn = pn ;
|
||||
|
||||
-- : Pron -> NP ;
|
||||
-- Assuming that lincat Pron = lincat NP
|
||||
UsePron pron = pron ;
|
||||
|
||||
-- : Predet -> NP -> NP ; -- only the man
|
||||
PredetNP predet np =
|
||||
|
||||
-- A noun phrase can also be postmodified by the past participle of a
|
||||
-- verb, by an adverb, or by a relative clause
|
||||
|
||||
-- low prio
|
||||
-- : NP -> V2 -> NP ; -- the man seen
|
||||
-- PPartNP np v2 = np ** {
|
||||
-- s =
|
||||
-- } ;
|
||||
|
||||
-- : NP -> Adv -> NP ; -- Paris today
|
||||
AdvNP np adv = np ** {
|
||||
s = np.s ++ "," ++ adv.s
|
||||
} ;
|
||||
|
||||
-- : NP -> Adv -> NP ; -- boys, such as ..
|
||||
ExtAdvNP np adv = AdvNP np {s = "," ++ adv.s} ;
|
||||
|
||||
-- : NP -> RS -> NP ; -- Paris, which is here
|
||||
RelNP np rs = np ** {
|
||||
|
||||
} ;
|
||||
|
||||
-- Determiners can form noun phrases directly.
|
||||
|
||||
-- : Det -> NP ;
|
||||
DetNP det = emptyNP ** {
|
||||
s = \\_ => linDet det ;
|
||||
} ;
|
||||
-}
|
||||
-- MassNP : CN -> NP ;
|
||||
MassNP cn = emptyNP ** {
|
||||
s = linCN cn
|
||||
} ;
|
||||
|
||||
|
||||
--2 Determiners
|
||||
|
||||
-- The determiner has a fine-grained structure, in which a 'nucleus'
|
||||
-- quantifier and an optional numeral can be discerned.
|
||||
|
||||
-- : Quant -> Num -> Det ;
|
||||
DetQuant quant num = quant ** {
|
||||
s = quant.s ! num.n ++ num.s ;
|
||||
n = num.n ;
|
||||
} ;
|
||||
|
||||
-- : Quant -> Num -> Ord -> Det ;
|
||||
-- DetQuantOrd quant num ord = quant ** {
|
||||
|
||||
-- } ;
|
||||
|
||||
-- Whether the resulting determiner is singular or plural depends on the
|
||||
-- cardinal.
|
||||
|
||||
-- All parts of the determiner can be empty, except $Quant$, which is
|
||||
-- the "kernel" of a determiner. It is, however, the $Num$ that determines
|
||||
-- the inherent number.
|
||||
|
||||
NumSg = {s = [] ; n = Sg} ;
|
||||
NumPl = {s = [] ; n = Pl} ;
|
||||
|
||||
{-
|
||||
-- : Card -> Num ; -- two
|
||||
NumCard card = card ;
|
||||
|
||||
-- : Digits -> Card ;
|
||||
NumDigits dig = -- probably like OrdDigits, but choose the NCard form
|
||||
|
||||
-- : Numeral -> Card ;
|
||||
NumNumeral num = {
|
||||
s = num.s ! NCard ;
|
||||
n = num.n -- inherits grammatical number (Sg, Pl, …) from the Numeral
|
||||
} ;
|
||||
|
||||
-- : AdN -> Card -> Card ;
|
||||
AdNum adn card = card ** { s = adn.s ++ card.s } ;
|
||||
|
||||
-- : Digits -> Ord ;
|
||||
OrdDigits digs = digs ** { s = digs.s ! NOrd } ;
|
||||
|
||||
-- : Numeral -> Ord ;
|
||||
OrdNumeral num = {
|
||||
s = num.s ! NOrd
|
||||
} ;
|
||||
|
||||
-- : A -> Ord ;
|
||||
OrdSuperl a = {
|
||||
s = "most" ++ a.s ! Superl
|
||||
} ;
|
||||
|
||||
-- One can combine a numeral and a superlative.
|
||||
|
||||
-- : Numeral -> A -> Ord ; -- third largest
|
||||
OrdNumeralSuperl num a = {
|
||||
s = num.s ! NOrd ++ a.s ! Superl
|
||||
} ;
|
||||
-}
|
||||
|
||||
-- : Quant
|
||||
DefArt = mkQuant "the" "the" ;
|
||||
|
||||
-- : Quant
|
||||
IndefArt = mkQuant "a" [] ;
|
||||
|
||||
{-
|
||||
-- : Pron -> Quant -- my
|
||||
PossPron pron = mkQuant pron.s ** {
|
||||
|
||||
} ;
|
||||
-}
|
||||
|
||||
--2 Common nouns
|
||||
|
||||
-- : N -> CN
|
||||
UseN n = n ;
|
||||
|
||||
{-
|
||||
-- : N2 -> CN ;
|
||||
UseN2 n2 =
|
||||
|
||||
-- : N2 -> NP -> CN ;
|
||||
ComplN2 n2 np =
|
||||
|
||||
-- : N3 -> NP -> N2 ; -- distance from this city (to Paris)
|
||||
ComplN3 n3 np =
|
||||
|
||||
-- : N3 -> N2 ; -- distance (from this city)
|
||||
Use2N3 n3 = lin N2 n3 ** { c2 = n3.c3 } ;
|
||||
|
||||
-- : N3 -> N2 ; -- distance (to Paris)
|
||||
Use3N3 n3 = lin N2 n3 ;
|
||||
|
||||
-- : AP -> CN -> CN
|
||||
AdjCN ap cn =
|
||||
|
||||
-- : CN -> RS -> CN ;
|
||||
RelCN cn rs =
|
||||
|
||||
|
||||
-- : CN -> Adv -> CN ;
|
||||
AdvCN cn adv =
|
||||
|
||||
-- Nouns can also be modified by embedded sentences and questions.
|
||||
-- For some nouns this makes little sense, but we leave this for applications
|
||||
-- to decide. Sentential complements are defined in VerbTMP.
|
||||
|
||||
-- : CN -> SC -> CN ; -- question where she sleeps
|
||||
SentCN cn sc =
|
||||
|
||||
--2 Apposition
|
||||
|
||||
-- This is certainly overgenerating.
|
||||
|
||||
-- : CN -> NP -> CN ; -- city Paris (, numbers x and y)
|
||||
ApposCN cn np = cn ** {
|
||||
s =
|
||||
} ;
|
||||
|
||||
--2 Possessive and partitive constructs
|
||||
-- NB. Below this, the functions are not in the API, so lower prio to implement
|
||||
|
||||
-- : PossNP : CN -> NP -> CN ;
|
||||
-- in English: book of someone; point is that we can add a determiner to the CN,
|
||||
-- so it can become "a book of someone" or "the book of someone"
|
||||
PossNP cn np =
|
||||
|
||||
|
||||
-- : Det -> NP -> NP ; -- three of them, some of the boys
|
||||
CountNP det np = -- Nonsense for DefArt or IndefArt, but don't worry about that! RGL can contain weird sentences, as long as it contains the non-weird stuff we want
|
||||
|
||||
|
||||
-- : CN -> NP -> CN ; -- glass of wine / two kilos of red apples
|
||||
PartNP cn np =
|
||||
|
||||
--3 Conjoinable determiners and ones with adjectives
|
||||
|
||||
-- : DAP -> AP -> DAP ; -- the large (one)
|
||||
AdjDAP dap ap = dap ** {
|
||||
|
||||
} ;
|
||||
|
||||
-- : Det -> DAP ; -- this (or that)
|
||||
DetDAP det = det ;
|
||||
-}
|
||||
|
||||
}
|
||||
115
src/TEMPLATE/NumeralTMP.gf
Normal file
115
src/TEMPLATE/NumeralTMP.gf
Normal file
@@ -0,0 +1,115 @@
|
||||
concrete NumeralTMP of Numeral = CatTMP [Numeral,Digits] **
|
||||
open Prelude, ResTMP in {
|
||||
|
||||
lincat
|
||||
Digit = LinNumeral ; -- 2..9
|
||||
Sub10, -- 1..9
|
||||
Sub100, -- 1..99
|
||||
Sub1000, -- 1..999
|
||||
Sub1000000, -- 1..999999
|
||||
Sub1000000000, -- 1..999999999
|
||||
Sub1000000000000 -- 1..999999999999
|
||||
= LinNumeral ;
|
||||
|
||||
-- param CardOrd defined in ResTMP
|
||||
-- type LinNumeral -""-
|
||||
|
||||
|
||||
lin
|
||||
-- : Sub1000000 -> Numeral ; -- 123456 [coercion to top category]
|
||||
num x = x ;
|
||||
|
||||
-- : Digit ;
|
||||
n2 = mkNumeral "two" ;
|
||||
n3 = mkNumeral "three" ;
|
||||
n4 = mkNumeral "four" ;
|
||||
n5 = mkNumeral "five" ;
|
||||
n6 = mkNumeral "six" ;
|
||||
n7 = mkNumeral "seven" ;
|
||||
n8 = mkNumeral "eight" ;
|
||||
n9 = mkNumeral "nine" ;
|
||||
|
||||
-- : Sub10 ; -- 1
|
||||
-- pot01 =
|
||||
|
||||
-- : Digit -> Sub10 ; -- d * 1
|
||||
pot0 d = d ;
|
||||
|
||||
-- : Sub100 ; -- 10
|
||||
-- pot110 = mkNum "ten" ;
|
||||
|
||||
-- : Sub100 ; -- 11
|
||||
-- pot111 = mkNum "eleven" ;
|
||||
|
||||
-- : Digit -> Sub100 ; -- 10 + d
|
||||
-- pot1to19 d =
|
||||
|
||||
-- : Sub10 -> Sub100 ; -- coercion of 1..9
|
||||
pot0as1 n = n ;
|
||||
|
||||
-- : Digit -> Sub100 ; -- d * 10
|
||||
-- pot1 d =
|
||||
|
||||
-- : Digit -> Sub10 -> Sub100 ; -- d * 10 + n
|
||||
-- pot1plus d e =
|
||||
|
||||
-- : Sub100 -> Sub1000 ; -- coercion of 1..99
|
||||
pot1as2 n = n ;
|
||||
|
||||
-- : Sub10 -> Sub1000 ; -- m * 100
|
||||
-- pot2 d =
|
||||
|
||||
-- : Sub10 -> Sub100 -> Sub1000 ; -- m * 100 + n
|
||||
-- pot2plus d e =
|
||||
|
||||
-- : Sub1000 -> Sub1000000 ; -- coercion of 1..999
|
||||
pot2as3 n = n ;
|
||||
|
||||
-- : Sub1000 -> Sub1000000 ; -- m * 1000
|
||||
-- pot3 d =
|
||||
|
||||
-- : Sub1000 -> Sub1000 -> Sub1000000 ; -- m * 1000 + n
|
||||
-- pot3plus d e =
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Numerals as sequences of digits have a separate, simpler grammar
|
||||
--
|
||||
|
||||
lincat
|
||||
Dig = LinDig ; -- single digit 0..9
|
||||
|
||||
lin
|
||||
-- : Dig -> Digits ; -- 8
|
||||
IDig d = d ;
|
||||
|
||||
-- : Dig -> Digits -> Digits ; -- 876
|
||||
IIDig d e = {
|
||||
s = table {
|
||||
NCard => glue (d.s ! NCard) (e.s ! NCard) ;
|
||||
NOrd => glue (d.s ! NCard) (e.s ! NOrd)
|
||||
} ;
|
||||
n = Pl ;
|
||||
} ;
|
||||
|
||||
-- : Dig ;
|
||||
D_0 = mkDig "0" ;
|
||||
D_1 = mkDig "1" ;
|
||||
D_2 = mkDig "2" ;
|
||||
D_3 = mkDig "3" ;
|
||||
D_4 = mkDig "4" ;
|
||||
D_5 = mkDig "5" ;
|
||||
D_6 = mkDig "6" ;
|
||||
D_7 = mkDig "7" ;
|
||||
D_8 = mkDig "8" ;
|
||||
D_9 = mkDig "9" ;
|
||||
|
||||
oper
|
||||
LinDig : Type = {s : CardOrd => Str ; n : Number} ;
|
||||
mkDig : Str -> LinDig = \s -> {
|
||||
s = table {
|
||||
NCard => s ;
|
||||
NOrd => s + "th"
|
||||
} ;
|
||||
n = Pl ; -- TODO: handle number 1
|
||||
} ;
|
||||
}
|
||||
211
src/TEMPLATE/ParadigmsTMP.gf
Normal file
211
src/TEMPLATE/ParadigmsTMP.gf
Normal file
@@ -0,0 +1,211 @@
|
||||
resource ParadigmsTMP = open CatTMP, ResTMP, NounTMP, Prelude in {
|
||||
|
||||
oper
|
||||
|
||||
--2 Parameters
|
||||
--
|
||||
-- To abstract over number, valency and (some) case names,
|
||||
-- we define the following identifiers. The application programmer
|
||||
-- should always use these constants instead of the constructors
|
||||
-- defined in $ResSom$.
|
||||
|
||||
Prep : Type ;
|
||||
noPrep : Prep ;
|
||||
|
||||
-- Add more overload instances if needed for all categories!
|
||||
|
||||
--2 Nouns
|
||||
|
||||
mkN : overload {
|
||||
mkN : Str -> N ; -- Predictable nouns
|
||||
} ;
|
||||
|
||||
mkPN : overload {
|
||||
mkPN : Str -> PN ; -- Proper nouns
|
||||
} ;
|
||||
|
||||
--2 Adjectives
|
||||
|
||||
mkA : overload {
|
||||
mkA : Str -> A ; -- Predictable adjective
|
||||
} ;
|
||||
|
||||
mkA2 : overload {
|
||||
mkA2 : Str -> A2 ; -- Predictable A2, no preposition
|
||||
mkA2 : A -> Prep -> A2 ; -- A2 made from A and Prep
|
||||
} ;
|
||||
|
||||
--2 Verbs
|
||||
|
||||
-- Verbs
|
||||
mkV : overload {
|
||||
mkV : Str -> V ; -- Predictable verb
|
||||
} ;
|
||||
|
||||
|
||||
mkV2 : overload {
|
||||
mkV2 : Str -> V2 ; -- Predictable transitive verb
|
||||
mkV2 : V -> Prep -> V2 ; -- V2 made from V and Prep
|
||||
} ;
|
||||
|
||||
mkV3 : overload {
|
||||
mkV3 : V -> V3 ; -- No prepositions
|
||||
mkV3 : V -> Prep -> Prep -> V3 ; -- Prepositions for direct and indirect objects given
|
||||
} ;
|
||||
|
||||
mkVV : overload {
|
||||
mkVV : V -> VV ;
|
||||
} ;
|
||||
|
||||
mkVA : overload {
|
||||
mkVA : V -> VA ;
|
||||
} ;
|
||||
|
||||
mkVQ : overload {
|
||||
mkVQ : V -> VQ ;
|
||||
} ;
|
||||
|
||||
mkVS : overload {
|
||||
mkV : V -> VS ;
|
||||
} ;
|
||||
|
||||
-- Etc. do the same for other V subcats (V2A, V2V, V2S, …)
|
||||
|
||||
|
||||
-----
|
||||
|
||||
--2 Structural categories
|
||||
|
||||
-- If prepositions take case, add that as argument to mkPrep
|
||||
mkPrep : overload {
|
||||
mkPrep : Str -> Prep ;
|
||||
} ;
|
||||
|
||||
mkConj : overload {
|
||||
mkConj : (and : Str) -> Conj ; -- (coffee) and (tea)
|
||||
mkConj : (either : Str) -> (or : Str) -> Conj ; -- either (coffee) or (tea)
|
||||
} ;
|
||||
|
||||
mkSubj : overload {
|
||||
mkSubj : Str -> Subj ;
|
||||
} ;
|
||||
|
||||
mkAdv : overload {
|
||||
mkAdv : Str -> Adv ;
|
||||
} ;
|
||||
|
||||
mkAdV : overload {
|
||||
mkAdV : Str -> AdV ;
|
||||
} ;
|
||||
|
||||
mkAdA : overload {
|
||||
mkAdA : Str -> AdA ;
|
||||
} ;
|
||||
|
||||
|
||||
--.
|
||||
-------------------------------------------------------------------------------
|
||||
-- The definitions should not bother the user of the API. So they are
|
||||
-- hidden from the document.
|
||||
|
||||
Prep = CatTMP.Prep ;
|
||||
noPrep = mkPrep [] ;
|
||||
|
||||
-- Add more overload instances if needed for all categories!
|
||||
|
||||
-- For explanation of `lin N`, see
|
||||
-- https://inariksit.github.io/gf/2018/05/25/subtyping-gf.html#lock-fields
|
||||
|
||||
mkN = overload {
|
||||
mkN : Str -> N = \s -> lin N (ResTMP.mkNoun s) ;
|
||||
-- TODO: more overload instances
|
||||
} ;
|
||||
|
||||
{-
|
||||
mkPN = overload {
|
||||
mkPN : Str -> PN = …
|
||||
} ;
|
||||
|
||||
--2 Adjectives
|
||||
|
||||
mkA = overload {
|
||||
mkA : Str -> A = \s -> …
|
||||
} ;
|
||||
|
||||
mkA2 = overload {
|
||||
mkA2 : Str -> A2 = \s -> …
|
||||
mkA2 : A -> Prep -> A2 = \s -> …
|
||||
} ;
|
||||
|
||||
--2 Verbs
|
||||
-}
|
||||
-- Verbs
|
||||
mkV = overload {
|
||||
mkV : Str -> V = \s -> lin V (mkVerb s) ;
|
||||
} ;
|
||||
|
||||
{-
|
||||
|
||||
mkV2 = overload {
|
||||
mkV2 : Str -> V2 = \s -> …
|
||||
mkV2 : V -> Prep -> V2 = \s -> …
|
||||
} ;
|
||||
|
||||
mkV3 = overload {
|
||||
mkV3 : V -> V3 = \s -> …
|
||||
mkV3 : V -> Prep -> Prep -> V3 = \s -> …
|
||||
} ;
|
||||
|
||||
mkVV = overload {
|
||||
mkVV : V -> VV = \s -> …
|
||||
} ;
|
||||
|
||||
mkVA = overload {
|
||||
mkVA : V -> VA = \s -> …
|
||||
} ;
|
||||
|
||||
mkVQ = overload {
|
||||
mkVQ : V -> VQ = \s -> …
|
||||
} ;
|
||||
|
||||
|
||||
mkVS = overload {
|
||||
mkV : V -> VS = \s -> …
|
||||
} ;
|
||||
|
||||
-- Etc. do the same for other V subcats (V2A, V2V, V2S, …)
|
||||
|
||||
|
||||
-----
|
||||
-}
|
||||
|
||||
-- If prepositions take case, add that as argument to mkPrep
|
||||
mkPrep = overload {
|
||||
mkPrep : Str -> Prep = \s -> lin Prep {s = s} ;
|
||||
} ;
|
||||
{-
|
||||
mkConj = overload {
|
||||
mkConj : (and : Str) -> Conj = \s -> …
|
||||
mkConj : (either : Str) -> (or : Str) -> Conj = \s -> …
|
||||
} ;
|
||||
|
||||
mkSubj = overload {
|
||||
mkSubj : Str -> Subj = \s -> …
|
||||
} ;
|
||||
|
||||
mkAdv = overload {
|
||||
mkAdv : Str -> Adv = \s -> …
|
||||
} ;
|
||||
|
||||
mkAdV = overload {
|
||||
mkAdV : Str -> AdV = \s -> …
|
||||
} ;
|
||||
|
||||
mkAdA = overload {
|
||||
mkAdA : Str -> AdA = \s -> …
|
||||
} ;
|
||||
|
||||
-}
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
}
|
||||
27
src/TEMPLATE/PhraseTMP.gf
Normal file
27
src/TEMPLATE/PhraseTMP.gf
Normal file
@@ -0,0 +1,27 @@
|
||||
concrete PhraseTMP of Phrase = CatTMP ** open Prelude, ResTMP in {
|
||||
|
||||
lin
|
||||
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
|
||||
|
||||
UttS s = s ;
|
||||
{-
|
||||
UttQS qs = qs ;
|
||||
UttIAdv iadv = iadv ;
|
||||
UttNP np =
|
||||
UttIP ip =
|
||||
UttImpSg pol imp = { s = pol.s ++ imp.s ! Sg ! pol.p } ;
|
||||
UttImpPl pol imp =
|
||||
UttImpPol pol imp = {s = pol.s ++ imp.s ! Sg ! pol.p} ;
|
||||
UttVP vp = {s = linVP vp} ;
|
||||
UttAP ap = { s = ap.s } ;
|
||||
UttAdv adv = {s = } ;
|
||||
UttCN n = {s = } ;
|
||||
UttCard n = {s = } ;
|
||||
UttInterj i = i ; -}
|
||||
NoPConj = {s = []} ;
|
||||
-- PConjConj conj = {s = conj.s1 ++ conj.s2 ! …} ;
|
||||
|
||||
NoVoc = {s = []} ;
|
||||
-- VocNP np = { s = "," ++ np.s ! … } ;
|
||||
|
||||
}
|
||||
105
src/TEMPLATE/QuestionTMP.gf
Normal file
105
src/TEMPLATE/QuestionTMP.gf
Normal file
@@ -0,0 +1,105 @@
|
||||
concrete QuestionTMP of Question = CatTMP ** open
|
||||
Prelude, ResTMP, ParadigmsTMP, (V=VerbTMP), (Noun=NounTMP), (S=StructuralTMP) in {
|
||||
|
||||
-- A question can be formed from a clause ('yes-no question') or
|
||||
-- with an interrogative.
|
||||
-- Interrogative pronouns can be formed with interrogative
|
||||
-- determiners, with or without a noun.
|
||||
|
||||
{-
|
||||
lin
|
||||
-- : IDet -> CN -> IP ; -- which five songs
|
||||
IdetCN idet cn = Noun.DetCN idet cn ** {
|
||||
} ;
|
||||
|
||||
-- : IDet -> IP ; -- which five
|
||||
IdetIP idet = Noun.DetNP idet ** {sp = idet.sp};
|
||||
|
||||
-- : IQuant -> Num -> IDet ; -- which (five)
|
||||
IdetQuant iquant num = iquant ** {
|
||||
} ;
|
||||
|
||||
-- : IP -> ClSlash -> QCl ; -- whom does John love
|
||||
QuestSlash ip cls = cls ** {
|
||||
|
||||
} ;
|
||||
|
||||
-- : Cl -> QCl ;
|
||||
QuestCl cl = cl ** {
|
||||
};
|
||||
|
||||
|
||||
-- : IP -> VP -> QCl ;
|
||||
QuestVP ip cl = cl ** {
|
||||
} ;
|
||||
|
||||
-- : IAdv -> Cl -> QCl ; -- why does John walk
|
||||
QuestIAdv iadv cls = {
|
||||
} ;
|
||||
|
||||
-- : IP -> IComp ;
|
||||
CompIP ip = {s = ip.s ! } ; -- who (is it)
|
||||
|
||||
-- : IComp -> NP -> QCl ; -- where is John?
|
||||
QuestIComp icomp np = {
|
||||
} ;
|
||||
|
||||
|
||||
-- Interrogative pronouns can be formed with interrogative
|
||||
-- determiners, with or without a noun.
|
||||
|
||||
-- : IDet -> CN -> IP ; -- which five songs
|
||||
IdetCN idet cn =
|
||||
|
||||
-- : IDet -> IP ; -- which five
|
||||
IdetIP idet =
|
||||
|
||||
-- They can be modified with adverbs.
|
||||
|
||||
-- : IP -> Adv -> IP ; -- who in Paris
|
||||
AdvIP = Noun.AdvNP ;
|
||||
|
||||
-- Interrogative quantifiers have number forms and can take number modifiers.
|
||||
|
||||
-- : IQuant -> Num -> IDet ; -- which (five)
|
||||
IdetQuant = Noun.DetQuant ;
|
||||
|
||||
-- Interrogative adverbs can be formed prepositionally.
|
||||
-- : Prep -> IP -> IAdv ; -- with whom
|
||||
PrepIP prep ip =
|
||||
|
||||
-- They can be modified with other adverbs.
|
||||
|
||||
-- : IAdv -> Adv -> IAdv ; -- where in Paris
|
||||
AdvIAdv iadv adv =
|
||||
|
||||
-- Interrogative complements to copulas can be both adverbs and
|
||||
-- pronouns.
|
||||
|
||||
-- : IAdv -> IComp ;
|
||||
CompIAdv iadv = iadv ; -- where (is it)
|
||||
|
||||
|
||||
-- More $IP$, $IDet$, and $IAdv$ are defined in $Structural$.
|
||||
|
||||
-- Wh questions with two or more question words require a new, special category.
|
||||
|
||||
lincat
|
||||
-- buy what where
|
||||
QVP =
|
||||
lin
|
||||
-- : VPSlash -> IP -> QVP ; -- buys what
|
||||
ComplSlashIP vps ip =
|
||||
|
||||
-- : VP -> IAdv -> QVP ; -- lives where
|
||||
AdvQVP vp iadv =
|
||||
|
||||
-- : QVP -> IAdv -> QVP ; -- buys what where
|
||||
AddAdvQVP qvp iadv =
|
||||
|
||||
-- : IP -> QVP -> QCl ; -- who buys what where
|
||||
QuestQVP ip qvp =
|
||||
-}
|
||||
|
||||
|
||||
}
|
||||
391
src/TEMPLATE/README.md
Normal file
391
src/TEMPLATE/README.md
Normal file
@@ -0,0 +1,391 @@
|
||||
# TEMPLATE
|
||||
|
||||
This is a starting point to clone a new RGL language. It has some pre-populated lincats and lins, mostly in the `Noun` module, but also a few minimal things for verbs and sentences. This README contains a guided tour of lincats and lins to implement first, and the modules also contain comments and suggestions aimed for new grammarians.
|
||||
|
||||
**If you want a 100% just strings template**, you can find that in [github.com/daherb/gf-rgl-template](https://github.com/daherb/gf-rgl-template). If you choose the string-only template, you can still read this document for suggestions about implementation order.
|
||||
|
||||
- [How to use this tutorial](#how-to-use-this-tutorial)
|
||||
- [Guided tour: what to implement first?](#guided-tour-what-to-implement-first)
|
||||
* [1. N-CN-NP(-AP)](#1-n-cn-np-ap)
|
||||
+ [Already implemented](#already-implemented)
|
||||
+ [Next steps](#next-steps)
|
||||
- [More morphology](#more-morphology)
|
||||
- [More syntax](#more-syntax)
|
||||
+ [How about adjectives?](#how-about-adjectives)
|
||||
+ [Side note: a word about MassNP](#side-note-a-word-about-massnp)
|
||||
* [2. V-VP](#2-v-vp)
|
||||
+ [Already implemented](#already-implemented-1)
|
||||
+ [Next steps](#next-steps-1)
|
||||
- [Add morphology](#add-morphology)
|
||||
- [Add syntax](#add-syntax)
|
||||
* [3. Cl-S-Utt-Phr](#3-cl-s-utt-phr)
|
||||
+ [Already implemented](#already-implemented-2)
|
||||
+ [Next steps](#next-steps-2)
|
||||
- [Declarative sentences](#declarative-sentences)
|
||||
- [Imperatives](#imperatives)
|
||||
+ [Unused or nonexistent forms?](#unused-or-nonexistent-forms)
|
||||
- [Choose your own adventure: what to implement next](#choose-your-own-adventure-what-to-implement-next)
|
||||
* [Questions](#questions)
|
||||
* [Adjectives](#adjectives)
|
||||
* [Relative clauses](#relative-clauses)
|
||||
* [Numerals](#numerals)
|
||||
* [Conjunctions](#conjunctions)
|
||||
+ [List without inflection table and single field](#list-without-inflection-table-and-single-field)
|
||||
+ [List with inflection table and multiple fields](#list-with-inflection-table-and-multiple-fields)
|
||||
+ [Inspiration from existing RGL languages](#inspiration-from-existing-rgl-languages)
|
||||
* [Phrases](#phrases)
|
||||
* [Idioms](#idioms)
|
||||
* [Symbol](#symbol)
|
||||
* [Extend](#extend)
|
||||
- [Functions outside the API or otherwise lower priority](#functions-outside-the-api-or-otherwise-lower-priority)
|
||||
# How to use this tutorial
|
||||
|
||||
If you haven't done so yet, clone your language from this template as instructed [here](../README.md#from-a-generic-template). The cloning doesn't include README.md, so there's only one copy of this README document.
|
||||
|
||||
You can open the grammar in a GF shell and see its functions as follows. (I'm using here the `TMP` concrete syntax, but you should have cloned it to some other concrete syntax with a different extension, so substitute as necessary.)
|
||||
|
||||
```
|
||||
$ gf LangTMP.gf
|
||||
Lang> gr -depth=6 | l -treebank
|
||||
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN blood_N)) (UseV die_V)))) NoVoc
|
||||
LangTMP: the blood die
|
||||
```
|
||||
|
||||
There are also a couple of unit tests in the [`unittest`](/unittest) directory. To see how to use them, see the [instructions](https://github.com/GrammaticalFramework/gf-rgl/tree/master/unittest#readme).
|
||||
|
||||
|
||||
# Guided tour: what to implement first?
|
||||
|
||||
In this section, I group the RGL functions in clusters and suggest an implementation order. If you have different needs, e.g. you're making the resource grammar for a particular application and need specific RGL functions for that, feel free to prioritise your needs. I'm giving this list as a suggestion for people who just want something to start from.
|
||||
|
||||
## 1. N-CN-NP(-AP)
|
||||
|
||||
Most of these are in the Noun module. This is the cluster that has most work done in this template.
|
||||
|
||||
### Already implemented
|
||||
|
||||
With the following functions, it is possible to construct simple noun phrases.
|
||||
|
||||
- `DetCN`
|
||||
- `DetQuant`
|
||||
- `DefArt`, `IndefArt` (no problem if they are empty strings in your language!)
|
||||
- `NumSg`, `NumPl`
|
||||
- `MassNP`
|
||||
- `UseN`
|
||||
- `blood_N` (in Lexicon module)
|
||||
|
||||
You can see all NPs with the following command:
|
||||
|
||||
```bash
|
||||
Lang> gt -cat=NP | l -treebank
|
||||
```
|
||||
|
||||
### Next steps
|
||||
|
||||
#### More morphology
|
||||
Check the categories and params in `ResTMP`: how well do they apply to your language? Is the initial implementation missing inflectional features that your language has, like case, gender/noun class, other numbers like dual?
|
||||
|
||||
If so, then I would suggest adding the missing morphology before implementing any new syntactic functions. Whenever you change a lincat, e.g. by making something that used to be a Str into an inflection table, all the lins that handle that lincat will break. So it's less painful to change the lincats when the amount of lins is still small.
|
||||
|
||||
#### More syntax
|
||||
Once you're happy with the morphology, you can start with other lins and lincats. In addition to nouns, the RGL allows making NPs out of pronouns and proper nouns:
|
||||
- lincat for `Pron`
|
||||
- lin for `UsePron` and `PossPron`
|
||||
- lin for some `Pron`s in Structural
|
||||
- lincat for `PN`
|
||||
- lin for `UsePN`
|
||||
- lin for `john_PN` and `paris_PN` in Lexicon
|
||||
|
||||
You can also make the NPs a bit more varied by adding more quantifiers and modifiers:
|
||||
- lins for more `Quant`s, `Det`s etc. in Structural
|
||||
|
||||
Some things in the Noun module will have to wait for other categories to be done. For instance, `AdjCN` relies on adjectives, `RelCN` on relatives, `NumCard` and `NumNumeral` on numerals, none of which is (properly) implemented in this template. So feel free to postpone the rest.
|
||||
|
||||
### How about adjectives?
|
||||
|
||||
In some languages, adjectives behave like nouns. In other languages, they behave like verbs. In yet other languages, the situation is more complicated. But if your language happens to be one where adjectives are like nouns, it's pretty cheap to just implement adjectives here as well. The minimal set is as follows:
|
||||
|
||||
- lincat for `A` and `AP`
|
||||
- lin for some `A`s from Lexicon
|
||||
- lin for `PositA` and `AdjCN`
|
||||
|
||||
But if adjectives are rather like verbs (e.g. Korean), or there are other complications (e.g. Zulu), just postpone their implementation.
|
||||
|
||||
|
||||
### Side note: a word about MassNP
|
||||
In the Noun module, there is a function called `MassNP : CN -> NP`. This is a *mass construction*, which is usually applied to mass nouns like "water".
|
||||
|
||||
However, the RGL does not contain a semantic distinction between mass and count nouns, and thus the `MassNP` function can be applied to any CN. Sometimes this results in semantically weird results.
|
||||
|
||||
As a resource grammarian, don't worry if `MassNP` applied to count nouns sounds weird. It's the application grammarian's problem to choose when to use MassNP and when DetCN. If `MassNP` sounds good when applied to mass nouns, then you're doing it right.
|
||||
|
||||
## 2. V-VP
|
||||
|
||||
### Already implemented
|
||||
|
||||
For verbs, we have much fewer things implemented: a single intransitive verb, and a function that elevates an intransitive verb into a VP.
|
||||
|
||||
* `UseV`
|
||||
* `die_V` (in Lexicon module)
|
||||
|
||||
You can see all (=1) VPs with the following command.
|
||||
|
||||
```bash
|
||||
Lang> gt -cat=VP | l -treebank
|
||||
Langs: UseV die_V
|
||||
LangTMP: die
|
||||
```
|
||||
|
||||
### Next steps
|
||||
|
||||
#### Add morphology
|
||||
|
||||
Just like with nouns, look at the `VForm` param in the Res module, and add the missing inflectional features. If verbs are very complex in your language, it's fine to start with a smaller subset, e.g. only indicative mood, or only a couple of tenses.
|
||||
|
||||
Again, you should extend the `VForm` param, and change the lincats of `V` and `VP` in other ways, if needed. It is very common that the lincat for `VP` has many fields, so that it
|
||||
|
||||
In addition, you could implement some morphological paradigms, so that you can add some verbs in the lexicon.
|
||||
|
||||
#### Add syntax
|
||||
|
||||
In addition to intransitive verbs (`V`), the GF RGL has a large set of verb subcategories. So now you can start adding lincats to `V2` (direct object), `VV` (verbal complement), `VS` (sentence complement) etc.
|
||||
|
||||
The most important are the following:
|
||||
|
||||
- lincat for `V2` and `VPSlash`
|
||||
- lin for some `V2`s from Lexicon
|
||||
- lin for `SlashV2a` and `ComplSlash`
|
||||
|
||||
If you have done a thorough implementation on noun morphology, you might find it useful here. For instance, if verbs mark their arguments with cases, now is a great time to add those cases as *inherent* argument in the verbs. (For explanation on parametric vs. inherent, see [GF tutorial](https://www.grammaticalframework.org/doc/tutorial/gf-tutorial.html#toc54)).
|
||||
|
||||
Another way to make VPs is to use adjectives, noun phrases and adverbials as complements. If you haven't implemented adjectives yet, feel free to skip them at this step. But the other complements should be in reach already, so the next most important steps are the following:
|
||||
|
||||
- lincat for `Comp`
|
||||
- lin for `CompNP`, (`CompAdv`) and `UseComp`
|
||||
- (If you already have AP: lin for `CompAP`)
|
||||
|
||||
These functions don't care whether your language has an explicit copula or not. Just implement whatever strategy that it uses for non-V❋ predication.
|
||||
|
||||
In terms of word order, you could consider how adverbials attach to verbs.
|
||||
|
||||
## 3. Cl-S-Utt-Phr
|
||||
|
||||
At this level, there is rarely new morphology to be added, but there can be interesting decisions about e.g. word order or subordination.
|
||||
|
||||
### Already implemented
|
||||
|
||||
The following rarely need any changes. By the time an `Utt` is reached, the grammatical decisions should have been already made, and the lincats of `Utt` and `Phr` should be just `{s : Str}`.
|
||||
- `PhrUtt`
|
||||
- `NoPConj`, `NoVoc`
|
||||
- `UttS`
|
||||
|
||||
The following functions, and the lincats they operate on, are implemented in the most naive only-strings way, and they need to be changed.
|
||||
- `UseCl`
|
||||
- `TTAnt`, `TPres`, `TPast`, `TFut`, `TCond`, `ASimul`, `AAnter`
|
||||
- `PPos`, `PNeg`
|
||||
- `PredVP`
|
||||
|
||||
### Next steps
|
||||
|
||||
#### Declarative sentences
|
||||
|
||||
If you have added verb inflection in the V❋ and VP categories, then you need to connect them to the Cl category. `PredVP : NP → VP → Cl` picks the correct person inflection from its VP argument, but any tense and polarity is still open. So in most languages, the lincat of `Cl` should have an inflection table, and only `UseCl : Temp → Pol → Cl → S` will choose the final form.
|
||||
|
||||
Sometimes even the lincat of `S` has an inflection table or it is discontinuous. That's because `S` can be used in a VP or an Adv, and in those cases, it may have a different word order or inflectional form than as standalone sentence.
|
||||
|
||||
If you're not sure whether the lincat of `S` should be still open for something, try to implement the following functions and see if it needs tweaking.
|
||||
|
||||
- `ComplVS : VS → S → VP`
|
||||
- `SubjS : Subj → S → Adv`
|
||||
|
||||
#### Imperatives
|
||||
|
||||
In the Sentence module, there are also functions to construct imperatives. Depending on your language, it could be rather easy to implement them after you've added declarative sentences. But nothing depends on imperatives, so you can as well postpone them.
|
||||
|
||||
### Unused or nonexistent forms?
|
||||
|
||||
What if your language has no form that corresponds to e.g. future anterior negative (*won't have walked*)? That's fine, you can put some other form in that slot and move on.
|
||||
|
||||
What if your language has tenses, aspects, moods, politeness forms or any other inflection that isn't accessible via the core RGL? That's fine too, you can always create a language-specific extra module with functions that do access them. If you're working towards a specific application that needs such forms, then you should of course prioritise them. But if covering the core RGL that is in the API is the most important, feel free to postpone all the verbal inflection that is not accessible via the core.
|
||||
|
||||
# Choose your own adventure: what to implement next
|
||||
|
||||
If you've implemented the first 3 clusters, you already have a nice chunk of the RGL!
|
||||
You have tackled many of the hard decisions, so it's natural that these things can take a long time, and you may need to revise often.
|
||||
|
||||
The following set doesn't have to be followed in any particular order.
|
||||
|
||||
## Questions
|
||||
|
||||
The Question module introduces interrogative noun phrases (`IP`) like *who* or *whose car*, and question clauses (`QCl`) and sentences (`QS`). Their implementation is often similar to that of noun phrases and declarative clauses and sentences.
|
||||
|
||||
Compared to declarative sentences, questions may require more variation in word order. You may need to make some fields discontinuous, e.g. splitting a single `s` field (e.g. *eat porridge*) of a VP into `verb` (*eat*) and `complement` (*porridge*).
|
||||
|
||||
The minimal set to get questions is the following:
|
||||
- lincat for `QCl`
|
||||
- lin for `QuestCl`
|
||||
With these, you get yes/no questions, like "do you walk".
|
||||
|
||||
To get wh-questions, like "who walks", you first need the `IP` category for interrogative noun phrases. Here's a full set for wh-questions with the IP as a subject.
|
||||
- lincat for `IP`, `IDet` and `IQuant`
|
||||
- lin for `IDetCN`, `IdetQuant`
|
||||
- lin for some `IQuant`s and `IP`s in Structural
|
||||
- lin for `QuestVP`
|
||||
|
||||
The next thing to add is `IAdv` for interrogative adverbs, like "why" or "where". With these, you can ask questions like "why do you walk" and "where are you".
|
||||
- lincat for `IAdv`
|
||||
- lin for some `IAdv`s in Structural, and/or `PrepIP` in Question
|
||||
- lin for `QuestIAdv`
|
||||
- lincat for `IComp`
|
||||
- lin for `CompIAdv`, `CompIP` and `QuestIComp`
|
||||
|
||||
Finally, we can also make a question using `IP` as an object, e.g. "who do you like". Where previously we have formed QCls from a normal VP with a special subject (`IP` instead of `NP`), here we introduce a new category `ClSlash`, which is a `Cl` missing an object. So you need the following:
|
||||
- lincat for `ClSlash`
|
||||
- lin for `QuestSlash`
|
||||
|
||||
## Adjectives
|
||||
|
||||
If you haven't implemented adjectives yet, it's about time! If your adjectives are more of the nouny type, I hope it's rather straightforward to do them. The minimal cluster is the following:
|
||||
|
||||
- lincat for `A` and `AP`
|
||||
- lin for `PositA` and `AdjCN`
|
||||
- lin for `CompAP`, check whether you have to update lincat for `Comp`
|
||||
|
||||
If adjectives behave like verbs, then the lincat for `Comp` and lin for `CompAP` can reuse the lincats and lins of the V-VP cluster. But `AdjCN` can be a bit difficult. Based on previous RGL languages that have verby adjectives, you get a lot of synergy with the Relative module. Basically, APs as modifiers behave just like relative clauses, so `AdjCN` and `RelCN` are similar or even identical.
|
||||
|
||||
## Relative clauses
|
||||
|
||||
These may be complicated, so feel free to postpone until further. But if your APs are verby, it makes sense to implement these in parallel with `AdjCN`, because you will need some way of making verby/clause-y things into modifiers.
|
||||
|
||||
## Numerals
|
||||
|
||||
There is a tentative lincat for numerals, and linearisations for the digits `D_0..D_9` and `n2..n9`, as well as the simple coercions `pot0`, `pot0as1`, `pot1as2`, `pot2as3` and `num`. However, it's possible that the simple lincat needs to be changed, and so I haven't implemented any of the lins that do something complex.
|
||||
|
||||
The numeral module the oldest piece of code in the RGL, and hence it looks pretty strange compared to the rest of the RGL. If you don't understand it, don't worry–just leave it aside until you have other parts implemented. Nothing depends on it, and in fact, I would recommend that your N-CN-NP cluster is solid before you do numerals, because then you know better which inflectional features are needed in numerals.
|
||||
|
||||
But eventually the time comes to tackle numerals. First tip is to check in https://github.com/GrammaticalFramework/gf-contrib/tree/master/numerals whether someone has already implemented them for your language, or a close relative that behaves similarly. Second tip is to look at the existing implementation of any RGL language that you know, and try to reverse engineer based on that. But even if these tips don't work, please submit your grammar to gf-rgl anyway! A grammar without full numeral implementation is much better than no grammar at all.
|
||||
|
||||
Once you have some kind of implementation of the Numeral module, you can connect it to the Noun module by implementing the following. The minimal meaningful set is these two:
|
||||
|
||||
- `NumNumeral : Numeral -> Card`
|
||||
- `NumCard : Card -> Num`
|
||||
|
||||
With these, you get a `Num` that can be used in `DetQuant` to make a Det, and that unlocks numerals as determiners, like "two cats".
|
||||
|
||||
## Conjunctions
|
||||
|
||||
Conjunction for category X needs 4 things:
|
||||
|
||||
- lincat for `[X]`
|
||||
- lin for `BaseX`
|
||||
- lin for `ConsX`
|
||||
- lin for `ConjX`
|
||||
|
||||
For example, if `X` is defined as
|
||||
```haskell
|
||||
lincat X = {s : Case => Str ; a : Agr} ;
|
||||
```
|
||||
then `[X]` will split its s field into two, and retain its other fields as is:
|
||||
|
||||
```haskell
|
||||
lincat [X] = {s1,s2 : Case => Str ; a : Agr} ;
|
||||
```
|
||||
|
||||
### List without inflection table and single field
|
||||
|
||||
Let's start with a simple case: Adv is of type `{s : Str}`. Then `[Adv]` is `{s1,s2 : Str}`.
|
||||
`BaseAdv`, `ConsAdv` and `ConjAdv` can all use functions defined in [prelude/Coordination](../prelude/Coordination.gf):
|
||||
|
||||
```haskell
|
||||
lin BaseAdv = twoSS ;
|
||||
lin ConsAdv = consrSS comma ;
|
||||
lin ConjAdv = conjunctSS ;
|
||||
```
|
||||
|
||||
### List with inflection table and multiple fields
|
||||
|
||||
Let's take the previous example and call it NP. Our lincats are as follows:
|
||||
```haskell
|
||||
lincat
|
||||
NP = {s : Case => Str ; a : Agr} ; -- in Cat
|
||||
[NP] = {s1,s2 : Case => Str ; a : Agr} ; -- in Conjunction
|
||||
```
|
||||
|
||||
Now we need to do a bit more work in our linearisations.
|
||||
```haskell
|
||||
lin
|
||||
BaseNP x y = twoTable Case x y ** {a = conjAgr x.a y.a} ;
|
||||
|
||||
oper
|
||||
conjAgr : Agr -> Agr -> Agr ;
|
||||
conjAgr agr1 agr2 = -- TODO actual implementation
|
||||
```
|
||||
First, we use the [twoTable](https://github.com/GrammaticalFramework/gf-rgl/blob/master/src/prelude/Coordination.gf#L57-L60) oper from Coordination, which puts the right values in the right fields.
|
||||
|
||||
But it doesn't deal with the rest of the fields, `g : Agr` in our case, and so we need to put it in manually. That's what happens in the *record extension* with the two stars. To combine two Agrs into one Agr, we define an oper `conjAgr`, that takes two Agrs and returns their combination.
|
||||
|
||||
Then let's do the rest of the linearisations.
|
||||
|
||||
```haskell
|
||||
lin
|
||||
ConsNP x xs = consrTable NPCase comma x xs ** {a = conjAgr xs.a x.a} ;
|
||||
ConjNP conj xs = conjunctDistrTable NPCase conj xs ** {
|
||||
a = -- xs.a, with possible Number input from the Conj
|
||||
} ;
|
||||
```
|
||||
ConsNP is similar to BaseNP, except that we will now include the separator character. `comma` is defined as the string "," in Prelude, but other languages use other characters, e.g. **、** in Chinese.
|
||||
|
||||
ConjNP puts together a NP from the list of NPs, using a conjunction: "Inari, Krasimir and Aarne". This resulting NP has to also have an `a` field, and in this final stage, we are putting together the `conjAgr` from all the arguments, and also taking into account the Conj itself. For instance, in [English style guides](https://editorsmanual.com/articles/compound-subject-singular-or-plural/),
|
||||
|
||||
> Two or more nouns joined by and form a plural compound subject, which takes plural verbs. But when a compound subject contains or or nor, the verb should agree with the part of the subject closest to it.
|
||||
|
||||
So in the English resource grammar, `and_Conj` has an inherent number Pl, and `or_Conj` has an inherent number Sg. If your language doesn't do that, then it's just the list of NPs that determines the agreement of the resulting coordinated NP.
|
||||
|
||||
### Inspiration from existing RGL languages
|
||||
|
||||
Most existing RGL languages use the Coordination module and its opers that are rather cryptic. Sometimes you can copy and paste an existing RGL language, just adjust the arity of the opers (e.g. call `twoTable3` instead of `twoTable2`) and which `param`s are given to those opers as argument. Other times you need to do more manual tweaking.
|
||||
|
||||
Here are some examples of [coordination strategies that are more complex than English](https://inariksit.github.io/gf/2021/02/22/lists.html#natural-language-strategies-beyond-a-b-and-c). The more your language differs from English, the more work you need to do in the internal params.
|
||||
|
||||
Some of the categories that have list instances may not be able to coordinate in your language. In such a case, you can decide whether to leave it unimplemented (thus trying to use it via the API gives an exception), or linearise something ungrammatical.
|
||||
|
||||
## Phrases
|
||||
|
||||
In the Phrase module, there are functions that create standalone utterances of multiple RGL categories. They are usually rather easy to implement: the `Utt` category should be just a `{s : Str}`, and the task is to decide which of the inflection forms is the standalone form.
|
||||
|
||||
## Idioms
|
||||
|
||||
The Idiom module defines constructions that are formed in idiosyncratic ways. Examples of its constructions are impersonal and generic clauses ("it is warm") and clefts ("it is John who sleeps"). This module is not a dependency of any other module, and its constructions are less frequent than the core modules like Noun and Verb. So this can be done whenever you like.
|
||||
|
||||
|
||||
## Symbol
|
||||
|
||||
The Symbol module (exported in the API as Symbolic) is used for embedding symbolic notation in natural-language text, e.g. "level 4". This module is not a dependency of any other, and it mostly depends on Noun. So it can be done any time after the N-CN-NP cluster is solid.
|
||||
|
||||
## Extend
|
||||
|
||||
As the name suggests, this is an extension and not in the API. See [here](https://inariksit.github.io/gf/2021/02/15/rgl-api-core-extensions.html#extend) for more explanation.
|
||||
|
||||
In my experience, the generalisations of VP are useful: `VPS` (VP with a tense and polarity), `VPI` (infinitival VP) and their transitive counterparts `VPS2` and `VPI2`. With these, you can do VP conjunctions, like "she runs and sings", "to eat and sleep".
|
||||
|
||||
Extend is a rather large module, and not all funs have meaningful lins in all languages. So don't feel pressured to fill Extend all at once; often grammarians just add linearisations when the need arises for a particular structure.
|
||||
|
||||
# Functions outside the API or otherwise lower priority
|
||||
|
||||
What is low or high priority depends on the application. But if you want some general guidelines, these are usually less used, or not in the API at all.
|
||||
|
||||
### Not in the API
|
||||
|
||||
- The category DAP + its functions
|
||||
- CountNP, PossNP, PartNP
|
||||
- OrdNumeralSuperl
|
||||
- List instance for CN
|
||||
TODO: continue the list
|
||||
|
||||
### Expensive
|
||||
|
||||
- `SlashV2VNP` is often expensive, because it has so many arguments.
|
||||
|
||||
For any function that turns out to be expensive, you can comment it out when implementing other parts of the grammar.
|
||||
|
||||
###
|
||||
24
src/TEMPLATE/RelativeTMP.gf
Normal file
24
src/TEMPLATE/RelativeTMP.gf
Normal file
@@ -0,0 +1,24 @@
|
||||
concrete RelativeTMP of Relative = CatTMP ** open
|
||||
ResTMP, Prelude in {
|
||||
|
||||
{-
|
||||
lin
|
||||
-- : Cl -> RCl ; -- such that John loves her
|
||||
RelCl cl = cl ** {
|
||||
} ;
|
||||
|
||||
-- : RP -> VP -> RCl ;
|
||||
RelVP rp vp = {
|
||||
} ;
|
||||
|
||||
-- : RP -> ClSlash -> RCl ; -- who I went with
|
||||
RelSlash rp cls = {
|
||||
} ;
|
||||
|
||||
-- : RP ;
|
||||
IdRP = {s = "that"} ;
|
||||
|
||||
-- : Prep -> NP -> RP -> RP ; -- the mother of whom
|
||||
FunRP prep np rp =
|
||||
-}
|
||||
}
|
||||
296
src/TEMPLATE/ResTMP.gf
Normal file
296
src/TEMPLATE/ResTMP.gf
Normal file
@@ -0,0 +1,296 @@
|
||||
resource ResTMP = open Prelude, Predef in {
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- General notes
|
||||
|
||||
-- ** Naming **
|
||||
{-
|
||||
I'm using the naming scheme for lincats and opers as explained here:
|
||||
https://inariksit.github.io/gf/2018/08/28/gf-gotchas.html#my-naming-scheme-for-lincats-and-opers
|
||||
-}
|
||||
|
||||
-- ** File structure **
|
||||
-- The rest of this module is organised as follows:
|
||||
|
||||
-----------------------------
|
||||
-- Grammatical categor(y|ies)
|
||||
|
||||
{-
|
||||
General comments on the cat(s)
|
||||
|
||||
params related to the cat(s)
|
||||
|
||||
opers related to the cat(s)
|
||||
-}
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Nouns
|
||||
|
||||
{-The param Number comes from common/ParamX, and has the values Sg and Pl.
|
||||
* If your language doesn't have number, remove Number from all records.
|
||||
* If your language has number with more than 2 values, define your own number in this module
|
||||
(e.g. uncomment line 56) and use that Number instead of Number.
|
||||
|
||||
The param Gender is defined here, and has the values Gender1 and Gender2.
|
||||
Currently it's only as a suggestion to be an inherent field in LinN.
|
||||
* If your language doesn't have gender, remove Gender from all records.
|
||||
* If your language has genders/noun classes, replace the placeholder Gender1 and Gender1
|
||||
with the actual values of your language (there can be more than 2!), and uncomment
|
||||
the g : Gender field from the definition of LinN.
|
||||
|
||||
If your nouns inflect in more things, like case, you can do one of the following
|
||||
* Replace the placeholder cases on line 53 and make the table 2-dimensional, like this:
|
||||
oper LinN : Type = {s : Number => Case => Str ; …} ;
|
||||
* Make your own parameter that combines all the relevant features, like this:
|
||||
param NForm = Whatever | You | Need | For | Noun | Inflection ;
|
||||
oper LinN : Type = {s : NForm => Str ; …} ;
|
||||
This can be a good idea, if your inflection table has some gaps, i.e. not all combinations are in use
|
||||
See https://gist.github.com/inariksit/708ab9df2498e88bc63aedf5fc7be2f3#file-tables-gf-L48-L122 for explanation
|
||||
-}
|
||||
|
||||
param
|
||||
Gender = Gender1 | Gender2 ; -- Just a placeholder, see lines 34-39 above
|
||||
Case = Case1 | Case2 | Case3 ; -- Just a placeholder, see lines 41-48 above
|
||||
Number = Sg
|
||||
| Pl
|
||||
-- | Dual -- If your language has numbers other than Sg and Pl, add them to the parameter
|
||||
;
|
||||
Person = P1 | P2 | P3 ;
|
||||
|
||||
oper
|
||||
LinN : Type = {
|
||||
s :
|
||||
-- Case => -- uncomment if your language has case
|
||||
Number => -- variable number: table {Sg => "house" ; Pl => "houses"}
|
||||
Str ;
|
||||
-- g : Gender ; -- inherent gender/noun class, if your language has that
|
||||
} ;
|
||||
|
||||
-- Most often, the lincat for CN is the same as N, with possibly some additional fields.
|
||||
-- However, sometimes you need more fields than just the s field, e.g. to keep word order flexible, or to add clitics and make sure they attach to the head, not modifiers.
|
||||
-- If you don't know what the previous line means, you can get started with just a single s field.
|
||||
-- You'll notice later whether you need such a field or not.
|
||||
LinCN : Type = LinN
|
||||
-- ** {postmod/premod/… : Str} -- if needed
|
||||
;
|
||||
|
||||
LinPN : Type = {
|
||||
s : Str ;
|
||||
n : Number ; -- Proper nouns often have already an inherent number; you don't usually say "a Paris / many Parises"
|
||||
-- g : Gender ; -- inherent gender/noun class, if your language has that
|
||||
} ;
|
||||
|
||||
-- For inflection paradigms, see http://www.grammaticalframework.org/doc/tutorial/gf-tutorial.html#toc56
|
||||
mkNoun : Str -> LinN = \str -> {
|
||||
s = table {
|
||||
_ => str -- TODO: actual morphology
|
||||
} ;
|
||||
-- If your nouns have gender, it should come here as inherent field.
|
||||
-- Usually you need to give the gender as an argument to mkNoun.
|
||||
} ;
|
||||
|
||||
linCN : LinCN -> Str = \cn -> cn.s ! Sg
|
||||
-- ++ cn.postmod -- If there is another field, use here
|
||||
;
|
||||
|
||||
---------------------------------------------
|
||||
-- Numeral
|
||||
|
||||
-- Used in NumeralTMP
|
||||
param
|
||||
CardOrd = NCard | NOrd ;
|
||||
|
||||
oper
|
||||
LinNumeral : Type = {s : CardOrd => Str ; n : Number} ;
|
||||
|
||||
mkNumeral : Str -> LinNumeral = \s -> {
|
||||
s = table {
|
||||
NCard => s ;
|
||||
NOrd => s + "th"
|
||||
} ;
|
||||
n = Pl ; -- NB. probably singular for number 1
|
||||
} ;
|
||||
|
||||
---------------------------------------------
|
||||
-- Pronoun
|
||||
|
||||
{-The param Person comes from common/ParamX, and has the values P1, P2 and P3.
|
||||
* If your language doesn't inflect in person, you may be able to remove Person from all records.
|
||||
- However, consider if it's really never present? How about e.g. reflexive ("myself", "yourself" etc?)
|
||||
* If your language is more fine-grained than {P1,P2,P3} x {Sg,Pl} (for instance gender and familiarity),
|
||||
you can define your own param. We provide an example called Agr to take inspiration from—remove if
|
||||
not needed, or use and refine if needed.
|
||||
-}
|
||||
|
||||
param
|
||||
-- These params are just for inspiration, not used anywhere currently.
|
||||
Agr = SgP1 -- I
|
||||
| SgP2 Politeness -- e.g. tū, tum, āp (Hindi) — note that the verb really inflects differently for all three!
|
||||
| SgP3 Gender -- e.g. he, she (verb inflects the same, but distinction in reflexive: himself / herself)
|
||||
| FillInTheRestYourself ;
|
||||
Politeness = Intimate | Familiar | Polite ;
|
||||
|
||||
oper
|
||||
LinPron : Type = {
|
||||
s : Str ;
|
||||
-- Alternative if your language has case and pronouns inflect in case (e.g. English I/me/my, she/her/hers)
|
||||
-- s : Case => Str ;
|
||||
n : Number ;
|
||||
p : Person ;
|
||||
-- Alternative to the `n` and `p` fields:
|
||||
-- a : Agr -- sketched above, lines 97-103
|
||||
} ;
|
||||
|
||||
mkPron : (_ : Str) -> Person -> Number -> LinPron = \str,per,num -> {
|
||||
s = str ;
|
||||
{- If there is case inflection, you need a table here
|
||||
table {
|
||||
_ => str -- Pronoun inflection is often irregular, so possibly this constructor requires several forms as argument, even if mkNoun is nice and regular
|
||||
} ;
|
||||
-}
|
||||
p = per ;
|
||||
n = num
|
||||
} ;
|
||||
|
||||
---------------------------------------------
|
||||
-- NP
|
||||
|
||||
{-
|
||||
In the RGL, a NP may come from a common noun, proper noun or pronoun.
|
||||
Pronouns are the only ones that have an inherent person (nouns are almost always 3rd person! please give me counterexamples if you can think of any.)
|
||||
So we can often say that NP's lincat is the same as Prons.
|
||||
|
||||
NB. for later, when you want to make Pron into possessives, you may need more fields in LinPron than in LinNP.
|
||||
That's why I'm copying over the definition below, instead of the neater `LinNP : Type = LinPron`.
|
||||
-}
|
||||
|
||||
LinNP : Type = {
|
||||
s : Str ;
|
||||
-- Alternative: If anything inflects in case (nouns, pronouns), NP has to also inflect in case!
|
||||
-- s : Case => Str ;
|
||||
n : Number ;
|
||||
p : Person ;
|
||||
-- Alternative to the `n` and `p` fields:
|
||||
-- a : Agr -- sketched on lines 97-101
|
||||
} ;
|
||||
|
||||
linNP : LinNP -> Str = \np -> np.s ; -- Change when you change LinNP
|
||||
|
||||
emptyNP : LinNP = { -- Change when you change LinNP
|
||||
s = [] ;
|
||||
n = Sg ;
|
||||
p = P3 ;
|
||||
} ;
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Det, Quant, Card, Ord
|
||||
|
||||
-- If your language has a number, it is very very very likely that
|
||||
-- Quant has a variable number and Det has inherent number.
|
||||
|
||||
LinQuant : Type = {
|
||||
s, -- quantifier in a context, e.g. 'this (cat) (is nice)'
|
||||
sp -- quantifier as standalone, e.g. 'this (is nice)'
|
||||
: Number => Str ;
|
||||
} ;
|
||||
|
||||
LinDet : Type = {
|
||||
s : Str ;
|
||||
n : Number ;
|
||||
} ;
|
||||
|
||||
-- Can you reuse your mkNoun? Do nouns and quantifiers inflect the same way?
|
||||
mkQuant : Str -> Str -> LinQuant = \this, these -> {
|
||||
s,
|
||||
sp = table {
|
||||
Sg => this ;
|
||||
Pl => these } ;
|
||||
};
|
||||
|
||||
mkDet : Str -> Number -> LinDet = \str, num -> {
|
||||
s = str ;
|
||||
n = num
|
||||
} ;
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Adpositions
|
||||
|
||||
{- The main use of Prep is in the fun
|
||||
|
||||
PrepNP : Prep -> NP -> Adv
|
||||
|
||||
Despite the name of the RGL category, a 'Prep' can be a preposition, postposition,
|
||||
or just an instruction to choose a particular case from the NP.
|
||||
A language may use one, two or all these strategies.
|
||||
|
||||
-}
|
||||
|
||||
oper
|
||||
LinPrep : Type = {
|
||||
s : Str ;
|
||||
|
||||
-- If your language has cases, and different prepositions choose different cases.
|
||||
-- c2 : Case ;
|
||||
|
||||
-- If your language has both pre- and postpositions, you need an inherent parameter in Prep to record which one a given Prep is.
|
||||
-- position : PreOrPost ;
|
||||
} ;
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Adjectives
|
||||
|
||||
LinA : Type = SS ;
|
||||
LinA2 : Type = LinA ;
|
||||
|
||||
mkAdj : Str -> LinA = \str -> {s = str} ;
|
||||
|
||||
AdjPhrase : Type = LinA ; -- ** {compar : Str} ;
|
||||
--------------------------------------------------------------------------------
|
||||
-- Verbs
|
||||
|
||||
param
|
||||
VForm = TODOVF Number Person ;
|
||||
|
||||
oper
|
||||
LinV : Type = {
|
||||
s : VForm => Str
|
||||
} ;
|
||||
|
||||
LinV2 : Type = LinV ** {
|
||||
c2 : LinPrep ;
|
||||
} ;
|
||||
|
||||
mkVerb : Str -> LinV = \str -> {
|
||||
s = table {
|
||||
_ => str
|
||||
}
|
||||
} ;
|
||||
|
||||
copula : LinV = {s = \\_ => "TODO: copula"} ; -- often useful
|
||||
|
||||
------------------
|
||||
-- VP
|
||||
|
||||
LinVP : Type = {
|
||||
s : VForm => Str ;
|
||||
} ;
|
||||
|
||||
LinVPSlash : Type = LinVP ** {
|
||||
c2 : LinPrep ;
|
||||
} ;
|
||||
|
||||
linVP : LinVP -> Str = \vp -> vp.s ! TODOVF Sg P3 ;
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Cl, S
|
||||
|
||||
-- Operations for clauses, sentences
|
||||
LinCl : Type = {
|
||||
subj : Str ;
|
||||
pred : Str ; -- TODO: depend on Temp and Pol
|
||||
} ;
|
||||
|
||||
linCl : LinCl -> Str = \cl -> cl.subj ++ cl.pred ;
|
||||
|
||||
}
|
||||
76
src/TEMPLATE/SentenceTMP.gf
Normal file
76
src/TEMPLATE/SentenceTMP.gf
Normal file
@@ -0,0 +1,76 @@
|
||||
|
||||
concrete SentenceTMP of Sentence = CatTMP ** open
|
||||
TenseX, ResTMP, (AM=AdverbTMP), Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
--2 Clauses
|
||||
|
||||
-- : NP -> VP -> Cl
|
||||
PredVP np vp = {
|
||||
subj = np.s ; -- ! Nom, if there are cases
|
||||
pred =
|
||||
-- table {something with tense+polarity =>
|
||||
vp.s ! TODOVF np.n np.p
|
||||
-- TODO: all of the VP's tense and polarity should be open here!
|
||||
-- PredVP only decides the subject.
|
||||
-- }
|
||||
} ;
|
||||
|
||||
{-
|
||||
-- : SC -> VP -> Cl ; -- that she goes is good
|
||||
PredSCVP sc vp = ;
|
||||
|
||||
--2 Clauses missing object noun phrases
|
||||
-- : NP -> VPSlash -> ClSlash ;
|
||||
SlashVP =
|
||||
|
||||
-- : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today
|
||||
AdvSlash cls adv =
|
||||
|
||||
-- : Cl -> Prep -> ClSlash ; -- (with whom) he walks
|
||||
SlashPrep cl prep = cl ** {c2 = prep} ;
|
||||
|
||||
-- Imperatives
|
||||
-- : VP -> Imp ;
|
||||
ImpVP vp =
|
||||
|
||||
--2 Embedded sentences
|
||||
|
||||
-- : S -> SC ;
|
||||
EmbedS s =
|
||||
|
||||
-- : QS -> SC ;
|
||||
EmbedQS qs =
|
||||
|
||||
-- : VP -> SC ;
|
||||
EmbedVP vp =
|
||||
-}
|
||||
--2 Sentences
|
||||
|
||||
-- : Temp -> Pol -> Cl -> S ;
|
||||
UseCl t p cl = {
|
||||
s = cl.subj ++ t.s ++ p.s ++ cl.pred -- ! t.t ! p.p -- eventually
|
||||
} ;
|
||||
{-
|
||||
-- : Temp -> Pol -> QCl -> QS ;
|
||||
UseQCl t p cl =
|
||||
|
||||
-- : Temp -> Pol -> RCl -> RS ;
|
||||
UseRCl t p cl =
|
||||
|
||||
-- AdvS : Adv -> S -> S ; -- then I will go home
|
||||
AdvS adv s =
|
||||
|
||||
-- ExtAdvS : Adv -> S -> S ; -- next week, I will go home
|
||||
ExtAdvS adv s =
|
||||
|
||||
-- : S -> Subj -> S -> S ;
|
||||
SSubjS s1 subj s2 =
|
||||
|
||||
-- : S -> RS -> S ; -- she sleeps, which is good
|
||||
RelS sent rs =
|
||||
-}
|
||||
}
|
||||
171
src/TEMPLATE/StructuralTMP.gf
Normal file
171
src/TEMPLATE/StructuralTMP.gf
Normal file
@@ -0,0 +1,171 @@
|
||||
concrete StructuralTMP of Structural = CatTMP **
|
||||
open Prelude, ResTMP, (Noun=NounTMP), ParadigmsTMP in {
|
||||
|
||||
-------
|
||||
-- Ad*
|
||||
{-
|
||||
lin almost_AdA =
|
||||
lin almost_AdN =
|
||||
lin at_least_AdN =
|
||||
lin at_most_AdN =
|
||||
lin so_AdA =
|
||||
lin too_AdA =
|
||||
lin very_AdA =
|
||||
|
||||
lin as_CAdv =
|
||||
lin less_CAdv =
|
||||
lin more_CAdv =
|
||||
|
||||
lin how8much_IAdv =
|
||||
lin when_IAdv =
|
||||
|
||||
lin how_IAdv =
|
||||
lin where_IAdv =
|
||||
lin why_IAdv =
|
||||
|
||||
lin always_AdV = ss "" ;
|
||||
|
||||
lin everywhere_Adv = ss "" ;
|
||||
lin here7from_Adv = ss "" ;
|
||||
lin here7to_Adv = ss "" ;
|
||||
lin here_Adv = ss "" ;
|
||||
lin quite_Adv = ss "" ;
|
||||
lin somewhere_Adv = ss "" ;
|
||||
lin there7from_Adv = ss "" ;
|
||||
lin there7to_Adv = ss "" ;
|
||||
lin there_Adv = ss "" ;
|
||||
|
||||
-}
|
||||
-------
|
||||
-- Conj
|
||||
|
||||
-- The lincat of Conj is Coordination.ConjunctionDistr ** {n:Number}
|
||||
-- which means that there are two fields for the strings, and
|
||||
-- n:Number which specifies the number of the resulting NP.
|
||||
|
||||
lin and_Conj = {s1 = [] ; s2 = "and" ; n = Pl} ;
|
||||
-- lin or_Conj =
|
||||
-- lin if_then_Conj =
|
||||
lin both7and_DConj = {s1 = "both" ; s2 = "and" ; n = Pl} ;
|
||||
-- lin either7or_DConj =
|
||||
|
||||
-- lin but_PConj =
|
||||
-- lin otherwise_PConj =
|
||||
-- lin therefore_PConj =
|
||||
|
||||
|
||||
-----------------
|
||||
-- *Det and Quant
|
||||
{-
|
||||
lin how8many_IDet =
|
||||
lin every_Det =
|
||||
|
||||
lin all_Predet = {s = ""} ;
|
||||
lin not_Predet = { s = "" } ;
|
||||
lin only_Predet = { s = "" } ;
|
||||
lin most_Predet = {s = ""} ;
|
||||
|
||||
lin few_Det = R.indefDet "" pl ;
|
||||
lin many_Det = R.indefDet "" pl ;
|
||||
lin much_Det = R.indefDet "" sg ;
|
||||
|
||||
lin somePl_Det =
|
||||
lin someSg_Det =
|
||||
|
||||
lin no_Quant =
|
||||
lin that_Quant = mkQuant "" ;
|
||||
lin this_Quant = mkQuant "" ;
|
||||
lin which_IQuant = mkQuant "" ;
|
||||
|
||||
-----
|
||||
-- NP
|
||||
|
||||
lin somebody_NP =
|
||||
|
||||
|
||||
lin everybody_NP =
|
||||
lin everything_NP =
|
||||
lin nobody_NP =
|
||||
lin nothing_NP =
|
||||
lin somebody_NP =
|
||||
lin something_NP =
|
||||
|
||||
-------
|
||||
-- Prep
|
||||
|
||||
lin above_Prep = mkPrep "" ;
|
||||
lin after_Prep = mkPrep "" ;
|
||||
lin before_Prep = mkPrep "" ;
|
||||
lin behind_Prep = mkPrep "" ;
|
||||
lin between_Prep = = mkPrep "" ;
|
||||
lin by8agent_Prep = mkPrep "" ;
|
||||
lin by8means_Prep = mkPrep "" ;
|
||||
lin during_Prep = mkPrep "" ;
|
||||
lin except_Prep = mkPrep "" ;
|
||||
lin for_Prep = mkPrep "" ;
|
||||
lin from_Prep = mkPrep "" ;
|
||||
lin in8front_Prep = mkPrep "" ;
|
||||
lin in_Prep = mkPrep "" ;
|
||||
lin on_Prep = mkPrep "" ;
|
||||
lin part_Prep = mkPrep ;
|
||||
lin possess_Prep = mkPrep "" ;
|
||||
lin through_Prep = mkPrep "" ;
|
||||
lin to_Prep = mkPrep "k" ;
|
||||
lin under_Prep = mkPrep "" ;
|
||||
lin with_Prep = mkPrep "" ;
|
||||
lin without_Prep = mkPrep "" ;
|
||||
|
||||
-------
|
||||
-- Pron
|
||||
|
||||
-- Pronouns are closed class, no constructor in ParadigmsTMP.
|
||||
lin it_Pron =
|
||||
lin i_Pron =
|
||||
lin youPol_Pron =
|
||||
lin youSg_Pron =
|
||||
lin he_Pron =
|
||||
lin she_Pron =
|
||||
lin we_Pron =
|
||||
lin youPl_Pron =
|
||||
lin they_Pron =
|
||||
|
||||
lin whatPl_IP =
|
||||
lin whatSg_IP =
|
||||
lin whoPl_IP =
|
||||
lin whoSg_IP =
|
||||
|
||||
-------
|
||||
-- Subj
|
||||
|
||||
lin although_Subj =
|
||||
lin because_Subj =
|
||||
lin if_Subj =
|
||||
lin that_Subj =
|
||||
lin when_Subj =
|
||||
|
||||
|
||||
------
|
||||
-- Utt
|
||||
|
||||
lin language_title_Utt = ss "" ;
|
||||
lin no_Utt = ss "" ;
|
||||
lin yes_Utt = ss "" ;
|
||||
|
||||
|
||||
-------
|
||||
-- Verb
|
||||
|
||||
lin have_V2 =
|
||||
|
||||
lin can8know_VV = -- can (capacity)
|
||||
lin can_VV = -- can (possibility)
|
||||
lin must_VV =
|
||||
lin want_VV =
|
||||
|
||||
------
|
||||
-- Voc
|
||||
|
||||
lin please_Voc = ss "" ;
|
||||
-}
|
||||
|
||||
}
|
||||
73
src/TEMPLATE/SymbolTMP.gf
Normal file
73
src/TEMPLATE/SymbolTMP.gf
Normal file
@@ -0,0 +1,73 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
concrete SymbolTMP of Symbol = CatTMP **
|
||||
open Prelude, ParadigmsTMP, ResTMP, (Noun=NounTMP) in {
|
||||
|
||||
lin
|
||||
|
||||
-- : Symb -> PN ; -- x
|
||||
SymbPN i = mkPN_onRuntimeToken i.s ;
|
||||
|
||||
-- : Int -> PN ; -- 27
|
||||
IntPN i = mkPN_onRuntimeToken i.s ;
|
||||
|
||||
-- : Float -> PN ; -- 3.14159
|
||||
FloatPN i = mkPN_onRuntimeToken i.s ;
|
||||
|
||||
-- : Card -> PN ; -- twelve [as proper name]
|
||||
NumPN i = mkPN_onRuntimeToken (i.s ! NCard) ;
|
||||
|
||||
lin
|
||||
-- CNIntNP cn i = {} ;
|
||||
|
||||
-- : Det -> CN -> [Symb] -> NP ; -- (the) (2) numbers x and y
|
||||
CNSymbNP det cn xs =
|
||||
let cnSymb : CN = cn ** {postmod = cn.postmod ++ xs.s}
|
||||
in Noun.DetCN det cnSymb ;
|
||||
|
||||
-- : CN -> Card -> NP ; -- level five ; level 5
|
||||
CNNumNP cn i =
|
||||
let cnSymb : CN = cn ** {postmod = cn.postmod ++ i.s}
|
||||
in Noun.MassNP cnSymb ;
|
||||
|
||||
-- : Symb -> S ;
|
||||
SymbS sy = sy ;
|
||||
|
||||
-- : Symb -> Card ;
|
||||
SymbNum sy = mkNumeral_onRuntimeToken sy.s ;
|
||||
|
||||
-- : Symb -> Ord ;
|
||||
SymbOrd sy = sy ; ---- TODO: nothing added to it. Lincat of Ord is just SS from the beginning.
|
||||
|
||||
oper
|
||||
-- To make Card or PN from a runtime argument, cannot use the single + operation.
|
||||
-- See https://inariksit.github.io/gf/2018/08/28/gf-gotchas.html#unsupported-token-gluing
|
||||
|
||||
mkNumeral_onRuntimeToken : Str -> LinNumeral = \str -> {
|
||||
s = table {
|
||||
NCard => str ;
|
||||
NOrd => str ++ BIND ++ "th"
|
||||
} ;
|
||||
n = Pl ; -- NB. probably singular for number 1
|
||||
} ;
|
||||
|
||||
mkPN_onRuntimeToken : Str -> LinPN = \str -> {
|
||||
s =
|
||||
-- table {_ => -- If lincat of PN changes so that it's an inflection table, uncomment this
|
||||
str
|
||||
-- }
|
||||
;
|
||||
n = Sg ;
|
||||
} ;
|
||||
|
||||
lincat
|
||||
Symb, [Symb] = SS ;
|
||||
|
||||
lin
|
||||
MkSymb s = s ;
|
||||
|
||||
BaseSymb = infixSS "and" ; -- this comes between the last two ones
|
||||
ConsSymb = infixSS "," ;
|
||||
|
||||
|
||||
}
|
||||
114
src/TEMPLATE/VerbTMP.gf
Normal file
114
src/TEMPLATE/VerbTMP.gf
Normal file
@@ -0,0 +1,114 @@
|
||||
concrete VerbTMP of Verb = CatTMP ** open ResTMP, AdverbTMP, Prelude in {
|
||||
|
||||
|
||||
lin
|
||||
|
||||
-----
|
||||
-- VP
|
||||
-- : V -> VP
|
||||
-- NB. assumes that lincat V = lincat VP
|
||||
-- This will most likely change when you start working with VPs
|
||||
UseV v = v ;
|
||||
|
||||
{-
|
||||
-- : V2 -> VP ;
|
||||
PassV2 v2 =
|
||||
|
||||
-- : VPSlash -> VP ;
|
||||
ReflVP vps =
|
||||
|
||||
-- : VV -> VP -> VP ;
|
||||
ComplVV vv vp =
|
||||
|
||||
-- : VS -> S -> VP ;
|
||||
ComplVS vs s =
|
||||
|
||||
-- : VQ -> QS -> VP ;
|
||||
ComplVQ vq qs =
|
||||
|
||||
-- : VA -> AP -> VP ;
|
||||
ComplVA va ap =
|
||||
|
||||
-- : Comp -> VP ;
|
||||
UseComp comp =
|
||||
-}
|
||||
--------
|
||||
-- Slash
|
||||
{-
|
||||
-- : V2 -> VPSlash
|
||||
SlashV2a v2 =
|
||||
|
||||
-- : V3 -> NP -> VPSlash ; -- give it (to her)
|
||||
Slash2V3 v3 dobj =
|
||||
|
||||
-- : V3 -> NP -> VPSlash ; -- give (it) to her
|
||||
Slash3V3 v3 iobj =
|
||||
|
||||
SlashV2A v2 adj =
|
||||
|
||||
-- : V2S -> S -> VPSlash ; -- answer (to him) that it is good
|
||||
SlashV2S v2s s =
|
||||
|
||||
-- : V2V -> VP -> VPSlash ; -- beg (her) to go
|
||||
SlashV2V v2v vp = ;
|
||||
|
||||
-- : V2Q -> QS -> VPSlash ; -- ask (him) who came
|
||||
SlashV2Q v2q qs = ;
|
||||
|
||||
-- : V2A -> AP -> VPSlash ; -- paint (it) red
|
||||
SlashV2A v2a ap = ;
|
||||
|
||||
|
||||
-- : VPSlash -> NP -> VP
|
||||
-- Often VPSlash has a field called c2, which is used to pick right form of np complement
|
||||
ComplSlash vps np = vps ** {
|
||||
compl = np.s ! vps.c2
|
||||
} ;
|
||||
|
||||
-- : VV -> VPSlash -> VPSlash ;
|
||||
SlashVV vv vps = ComplVV vv vps ** {
|
||||
} ;
|
||||
|
||||
-- : V2V -> NP -> VPSlash -> VPSlash ; -- beg me to buy
|
||||
SlashV2VNP v2v np vps =
|
||||
|
||||
-- : VP -> Adv -> VP ; -- sleep here
|
||||
AdvVP vp adv =
|
||||
|
||||
-- : AdV -> VP -> VP ; -- always sleep
|
||||
AdVVP adv vp =
|
||||
|
||||
-- : VPSlash -> Adv -> VPSlash ; -- use (it) here
|
||||
AdvVPSlash = insertAdv ;
|
||||
|
||||
-- : VP -> Adv -> VP ; -- sleep , even though ...
|
||||
ExtAdvVP vp adv = ;
|
||||
|
||||
-- : AdV -> VPSlash -> VPSlash ; -- always use (it)
|
||||
AdVVPSlash adv vps = vps ** { adv = adv.s ++ vps.adv } ;
|
||||
|
||||
-- : VP -> Prep -> VPSlash ; -- live in (it)
|
||||
VPSlashPrep vp prep = vp ** {c2 = prep} ;
|
||||
|
||||
|
||||
--2 Complements to copula
|
||||
|
||||
-- Adjectival phrases, noun phrases, and adverbs can be used.
|
||||
|
||||
-- : AP -> Comp ;
|
||||
CompAP ap =
|
||||
|
||||
-- : CN -> Comp ;
|
||||
CompCN cn =
|
||||
|
||||
-- NP -> Comp ;
|
||||
CompNP np =
|
||||
|
||||
-- : Adv -> Comp ;
|
||||
CompAdv adv =
|
||||
|
||||
-- : VP -- Copula alone;
|
||||
UseCopula =
|
||||
-}
|
||||
|
||||
}
|
||||
9
src/TEMPLATE/unittest/nouns.gftest
Normal file
9
src/TEMPLATE/unittest/nouns.gftest
Normal file
@@ -0,0 +1,9 @@
|
||||
-----------------------------------
|
||||
-- Just some simple noun phrases --
|
||||
-----------------------------------
|
||||
|
||||
Lang: DetCN (DetQuant IndefArt NumSg) (UseN blood_N)
|
||||
LangTMP: a blood
|
||||
|
||||
Lang: DetCN (DetQuant DefArt NumSg) (UseN blood_N)
|
||||
LangTMP: the blood
|
||||
7
src/TEMPLATE/unittest/sentences.gftest
Normal file
7
src/TEMPLATE/unittest/sentences.gftest
Normal file
@@ -0,0 +1,7 @@
|
||||
--------------------------------
|
||||
-- Just some simple sentences --
|
||||
--------------------------------
|
||||
|
||||
-- Replace with some tests that make sense for your language!
|
||||
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN blood_N)) (UseV die_V)))) NoVoc
|
||||
LangTMP: the blood die
|
||||
@@ -93,6 +93,7 @@ abstract Cat = Common ** {
|
||||
|
||||
Numeral ; -- cardinal or ordinal in words e.g. "five/fifth"
|
||||
Digits ; -- cardinal or ordinal in digits e.g. "1,000/1,000th"
|
||||
Decimal ; -- decimal number e.g. "1/2/3.14/-1"
|
||||
|
||||
--2 Structural words
|
||||
|
||||
|
||||
@@ -27,9 +27,11 @@ abstract Extend = Cat ** {
|
||||
|
||||
CompBareCN : CN -> Comp ; -- (is) teacher
|
||||
|
||||
PiedPipingQuestSlash : IP -> ClSlash -> QCl ; -- with whom does John live
|
||||
PiedPipingRelSlash : RP -> ClSlash -> RCl ; -- with whom John lives
|
||||
StrandQuestSlash : IP -> ClSlash -> QCl ; -- whom does John live with
|
||||
StrandRelSlash : RP -> ClSlash -> RCl ; -- that he lives in
|
||||
EmptyRelSlash : ClSlash -> RCl ; -- he lives in
|
||||
StrandRelSlash : RP -> ClSlash -> RCl ; -- that he lives with
|
||||
EmptyRelSlash : ClSlash -> RCl ; -- he lives with
|
||||
|
||||
|
||||
-- $VP$ conjunction, separate categories for finite and infinitive forms (VPS and VPI, respectively)
|
||||
@@ -298,6 +300,9 @@ fun
|
||||
CardCNCard : Card -> CN -> Card ; -- three million, four lakh, six dozen etc
|
||||
|
||||
fun
|
||||
AnaphPron : NP -> Pron ;
|
||||
TPastSimple : Tense ;
|
||||
|
||||
fun
|
||||
SubjunctRelCN : CN -> RS -> CN ; -- e.g. Romance languages when subjunctive/conjunctive is needed
|
||||
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ abstract Noun = Cat ** {
|
||||
|
||||
data
|
||||
NumDigits : Digits -> Card ; -- 51
|
||||
NumFloat : Digits -> Digits -> Card ; -- 3.14
|
||||
NumDecimal : Decimal -> Card ; -- 3.14, -1, etc
|
||||
NumNumeral : Numeral -> Card ; -- fifty-one
|
||||
|
||||
-- The construction of numerals is defined in [Numeral Numeral.html].
|
||||
@@ -158,7 +158,6 @@ abstract Noun = Cat ** {
|
||||
|
||||
--2 Quantities
|
||||
|
||||
QuantityNP : Digits -> MU -> NP ;
|
||||
QuantityFloatNP : Digits -> Digits -> MU -> NP ;
|
||||
QuantityNP : Decimal -> MU -> NP ;
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
-- parts of a numeral, which is often incorrect - more work on
|
||||
-- (un)lexing is needed to solve this problem.
|
||||
|
||||
abstract Numeral = Cat [Numeral,Digits] ** {
|
||||
abstract Numeral = Cat [Numeral,Digits,Decimal] ** {
|
||||
|
||||
cat
|
||||
Digit ; -- 2..9
|
||||
@@ -29,7 +29,9 @@ cat
|
||||
Sub1000000000000 ; -- 1..999999999999
|
||||
|
||||
data
|
||||
|
||||
num : Sub1000000 -> Numeral ; -- 123456 [coercion to top category]
|
||||
---- num : Sub1000000000000 -> Numeral ; ---- should be this, but not yet available in most langs AR 6/2/2024
|
||||
|
||||
n2, n3, n4, n5, n6, n7, n8, n9 : Digit ;
|
||||
|
||||
@@ -53,18 +55,18 @@ data
|
||||
pot3 : Sub1000 -> Sub1000000 ; -- m * 1000
|
||||
pot3plus : Sub1000 -> Sub1000 -> Sub1000000 ; -- m * 1000 + n
|
||||
pot3as4 : Sub1000000 -> Sub1000000000 ; -- coercion of 1..999999
|
||||
pot3float : Float -> Sub1000000 ; -- 3.5 thousand
|
||||
pot3decimal : Decimal -> Sub1000000 ; -- 3.5 thousand
|
||||
|
||||
pot41 : Sub1000000000 ; -- a million instead of one million
|
||||
pot4 : Sub1000 -> Sub1000000000 ; -- m * 1000000000
|
||||
pot4plus : Sub1000 -> Sub1000000 -> Sub1000000000 ; -- m * 1000000000 + n
|
||||
pot4as5 : Sub1000000000 -> Sub1000000000000 ; -- coercion of 1..999999999
|
||||
pot4float : Float -> Sub1000000000 ; -- 3.5 million
|
||||
pot4decimal : Decimal -> Sub1000000000 ; -- 3.5 million
|
||||
|
||||
pot51 : Sub1000000000000 ; -- a billion instead of one billion
|
||||
pot5 : Sub1000 -> Sub1000000000000 ; -- m * 1000000000
|
||||
pot5plus : Sub1000 -> Sub1000000000 -> Sub1000000000000 ; -- m * 1000000000 + n
|
||||
pot5float : Float -> Sub1000000000000 ; -- 3.5 billion
|
||||
pot5decimal : Decimal -> Sub1000000000000 ; -- 3.5 billion
|
||||
|
||||
-- Numerals as sequences of digits have a separate, simpler grammar
|
||||
|
||||
@@ -77,4 +79,8 @@ data
|
||||
|
||||
D_0, D_1, D_2, D_3, D_4, D_5, D_6, D_7, D_8, D_9 : Dig ;
|
||||
|
||||
PosDecimal : Digits -> Decimal ; -- 8
|
||||
NegDecimal : Digits -> Decimal ; -- -8
|
||||
IFrac : Decimal -> Dig -> Decimal ; -- 3.14 -> 3.141
|
||||
|
||||
}
|
||||
|
||||
@@ -62,6 +62,7 @@ concrete CatAfr of Cat =
|
||||
|
||||
Numeral = {s : CardOrd => Str ; n : Number } ;
|
||||
Digits = {s : CardOrd => Str ; n : Number } ;
|
||||
Decimal = {s : CardOrd => Str ; n : Number ; hasDot : Bool} ;
|
||||
|
||||
-- Structural
|
||||
|
||||
@@ -83,6 +84,22 @@ concrete CatAfr of Cat =
|
||||
N = Noun ;
|
||||
N2 = {s : NForm => Str ; g : Gender} ** {c2 : Preposition} ;
|
||||
N3 = {s : NForm => Str ; g : Gender} ** {c2,c3 : Preposition} ;
|
||||
GN, SN, LN, PN = {s : NPCase => Str} ;
|
||||
PN = {s : NPCase => Str} ;
|
||||
GN = {s : NPCase => Str; g : Sex} ;
|
||||
SN = {s : Sex => NPCase => Str; pl : NPCase => Str} ;
|
||||
LN = {s : Adjf => NPCase => Str ; hasArt : Bool ; n : Number} ;
|
||||
|
||||
lindef
|
||||
VPSlash = \s -> {
|
||||
s = {s = \\_ => s; prefix = ""; aux = VHebben; vtype = VAct} ;
|
||||
a1 = \\_ => "" ;
|
||||
n0 = \\_ => "" ;
|
||||
n2 = \\_ => "" ;
|
||||
a2 = "" ;
|
||||
isAux = False ;
|
||||
inf = <"",False> ;
|
||||
ext = "" ;
|
||||
c2 = ""
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -29,9 +29,9 @@ lin
|
||||
} ;
|
||||
|
||||
InflectionLN = \ln -> {
|
||||
t = "ln" ;
|
||||
t = "pn" ;
|
||||
s1 = heading1 "Naam" ;
|
||||
s2 = paragraph (ln.s ! NPNom)
|
||||
s2 = paragraph (ln.s ! Strong ! NPNom)
|
||||
} ;
|
||||
|
||||
InflectionGN = \pn -> {
|
||||
@@ -43,7 +43,7 @@ lin
|
||||
InflectionSN = \pn -> {
|
||||
t = "van" ;
|
||||
s1 = heading1 "Van" ;
|
||||
s2 = paragraph (pn.s ! NPNom)
|
||||
s2 = paragraph (pn.s ! Male ! NPNom)
|
||||
} ;
|
||||
|
||||
InflectionA, InflectionA2 = \adj ->
|
||||
|
||||
@@ -1,9 +1,40 @@
|
||||
concrete NamesAfr of Names = CatAfr ** open ResAfr, Prelude in {
|
||||
|
||||
lin GivenName, MaleSurname, FemaleSurname = \n -> {s = n.s ; a = agrP3 Sg ; isPron = False} ;
|
||||
lin FullName gn sn =
|
||||
{s = \\c => gn.s ! NPNom ++ sn.s ! c ; a = agrP3 Sg ; isPron = False} ;
|
||||
lin GivenName = \n -> {s = n.s ; a = agrP3 Sg ; isPron = False} ;
|
||||
lin MaleSurname = \n -> {s = n.s ! Male ; a = agrP3 Sg ; isPron = False} ;
|
||||
lin FemaleSurname = \n -> {s = n.s ! Female; a = agrP3 Sg ; isPron = False} ;
|
||||
lin PlSurname = \n -> {s = n.pl ; a = agrP3 Sg ; isPron = False} ;
|
||||
|
||||
lin UseLN pn = {s = pn.s ; a = agrP3 Sg ; isPron = False} ;
|
||||
lin FullName gn sn =
|
||||
{s = \\c => gn.s ! NPNom ++ sn.s ! gn.g ! c ; a = agrP3 Sg ; isPron = False} ;
|
||||
|
||||
lin UseLN ln = {
|
||||
s = \\c => case ln.hasArt of {
|
||||
True => "die" ++ ln.s ! Weak ! c ;
|
||||
False => ln.s ! Strong ! c
|
||||
} ;
|
||||
a = agrP3 ln.n ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
PlainLN ln = {
|
||||
s = \\c => ln.s ! Strong ! c ;
|
||||
a = agrP3 ln.n ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
InLN ln = {
|
||||
s = appPrep "in" (\\c => case ln.hasArt of {
|
||||
True => "die" ++ ln.s ! Weak ! c ;
|
||||
False => ln.s ! Strong ! c
|
||||
})
|
||||
} ;
|
||||
|
||||
AdjLN ap ln = ln ** {
|
||||
s = \\a,c =>
|
||||
preOrPost ap.isPre
|
||||
(ap.s ! agrAdj Neutr a (NF ln.n Nom))
|
||||
(ln.s ! a ! c) ;
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ concrete NounAfr of Noun = CatAfr ** open ResAfr, Prelude in {
|
||||
NumDigits numeral = {s = \\g,c => numeral.s ! NCard g c; n = numeral.n } ;
|
||||
OrdDigits numeral = {s = \\af => numeral.s ! NOrd af} ;
|
||||
|
||||
NumFloat n1 n2 = {s = \\g,c => n1.s ! NCard Neutr Nom ++ BIND ++ "." ++ BIND ++ n1.s ! NCard g c; n = Pl } ;
|
||||
NumDecimal dec = {s = \\g,c => dec.s ! NCard g c; n = dec.n } ;
|
||||
|
||||
NumNumeral numeral = {s = \\g,c => numeral.s ! NCard g c; n = numeral.n } ;
|
||||
OrdNumeral numeral = {s = \\af => numeral.s ! NOrd af} ;
|
||||
@@ -185,10 +185,4 @@ concrete NounAfr of Noun = CatAfr ** open ResAfr, Prelude in {
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
QuantityFloatNP n1 n2 m = {
|
||||
s = \\c => preOrPost m.isPre m.s (n1.s ! NCard Neutr Nom ++ BIND ++ "." ++ BIND ++ n1.s ! NCard Neutr Nom) ;
|
||||
a = agrP3 Pl ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
concrete NumeralAfr of Numeral = CatAfr [Numeral,Digits] ** open ResAfr, Prelude in {
|
||||
concrete NumeralAfr of Numeral = CatAfr [Numeral,Digits,Decimal] ** open ResAfr, Prelude in {
|
||||
|
||||
flags optimize = all_subs ;
|
||||
coding=utf8 ;
|
||||
@@ -75,6 +75,20 @@ lin
|
||||
D_8 = mkDig "8" ;
|
||||
D_9 = mkDig "9" ;
|
||||
|
||||
PosDecimal d = d ** {hasDot=False} ;
|
||||
NegDecimal d = {
|
||||
s = \\o => "-" ++ BIND ++ d.s ! o ;
|
||||
n = Pl ;
|
||||
hasDot=False
|
||||
} ;
|
||||
IFrac d i = {
|
||||
s = \\o => d.s ! invNum ++
|
||||
if_then_Str d.hasDot BIND (BIND++"."++BIND) ++
|
||||
i.s ! o;
|
||||
n = Pl ;
|
||||
hasDot=True
|
||||
} ;
|
||||
|
||||
oper
|
||||
mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ;
|
||||
mkDig : Str -> TDigit = \c -> mk2Dig c (c + "e") ;
|
||||
|
||||
@@ -73,6 +73,25 @@ oper
|
||||
mkPN : Str -> PN ; -- proper name
|
||||
} ;
|
||||
|
||||
mkGN = overload { -- given name
|
||||
mkGN : Str -> GN = \s -> lin GN {s = \\_ => s; g = Male} ;
|
||||
mkGN : Str -> Sex -> GN = \s,g -> lin GN {s = \\_ => s; g = g} ;
|
||||
} ;
|
||||
|
||||
mkSN = overload { -- given name
|
||||
mkSN : Str -> SN = \s -> lin SN {s = \\_,_ => s; pl = \\_=>s} ;
|
||||
mkSN : Str -> Str -> Str -> SN = \male,female,pl -> lin SN {s = table {Male=>\\_=>male; Female=>\\_=>female}; pl=\\_=>pl} ;
|
||||
} ;
|
||||
|
||||
mkLN = overload {
|
||||
mkLN : Str -> LN -- location name
|
||||
= \s -> lin LN {s = \\_,_ => s; hasArt = False; n = Sg} ;
|
||||
mkLN : Str -> Number -> LN -- location name
|
||||
= \s,n -> lin LN {s = \\_,_ => s; hasArt = False; n = n} ;
|
||||
} ;
|
||||
|
||||
defLN : LN -> LN = \n -> n ** {hasArt = True} ;
|
||||
|
||||
|
||||
--2 Adjectives
|
||||
|
||||
@@ -205,6 +224,8 @@ oper
|
||||
feminine = Neutr ;
|
||||
het,neuter = Neutr ;
|
||||
de,utrum = Neutr ;
|
||||
male = Male ;
|
||||
female = Female ;
|
||||
|
||||
mkA = overload {
|
||||
mkA : (vers : Str) -> A = \a -> lin A (regAdjective a) ;
|
||||
|
||||
@@ -315,7 +315,7 @@ param
|
||||
|
||||
--2 Transformations between parameter types
|
||||
|
||||
oper Agr : Type = {g : Gender ; n : Number ; p : Person} ;
|
||||
oper Agr : PType = {g : Gender ; n : Number ; p : Person} ;
|
||||
|
||||
oper
|
||||
agrP3 : Number -> Agr = agrgP3 Neutr ;
|
||||
|
||||
11
src/albanian/AdjectiveSqi.gf
Normal file
11
src/albanian/AdjectiveSqi.gf
Normal file
@@ -0,0 +1,11 @@
|
||||
concrete AdjectiveSqi of Adjective = CatSqi ** open ResSqi, Prelude in {
|
||||
|
||||
lin
|
||||
PositA a = {
|
||||
s = \\spec,c,g,n => case a.clit of {
|
||||
True => link_clitic ! spec ! c ! g ! n ++ a.s ! c ! g ! n ;
|
||||
False => a.s ! c ! g ! n
|
||||
}
|
||||
} ;
|
||||
|
||||
}
|
||||
4
src/albanian/AllSqi.gf
Normal file
4
src/albanian/AllSqi.gf
Normal file
@@ -0,0 +1,4 @@
|
||||
concrete AllSqi of AllSqiAbs =
|
||||
LangSqi
|
||||
**
|
||||
{} ;
|
||||
3
src/albanian/AllSqiAbs.gf
Normal file
3
src/albanian/AllSqiAbs.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
abstract AllSqiAbs =
|
||||
Lang
|
||||
** {}
|
||||
25
src/albanian/CatSqi.gf
Normal file
25
src/albanian/CatSqi.gf
Normal file
@@ -0,0 +1,25 @@
|
||||
concrete CatSqi of Cat = CommonX ** open ParamX, Prelude, ResSqi in {
|
||||
|
||||
lincat N = Noun ;
|
||||
lincat N2 = Noun ** {c2 : Compl} ;
|
||||
lincat N3 = Noun ** {c2,c3 : Compl} ;
|
||||
lincat A = Adj ;
|
||||
lincat A2 = Adj ** {c2 : Compl} ;
|
||||
lincat V, VA, VV, VS, VQ = Verb ;
|
||||
lincat V2, V2S, V2Q = Verb ** {c2 : Compl} ;
|
||||
lincat V3, V2A, V2V = Verb ** {c2,c3 : Compl} ;
|
||||
lincat Prep = Compl ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digits = {s : Str; n : Number; tail : DTail} ;
|
||||
lincat Decimal = {s : Str; n : Number; hasDot : Bool} ;
|
||||
|
||||
lincat AP = {s: Species => Case => Gender => Number => Str} ;
|
||||
lincat CN = Noun ;
|
||||
lincat Num = {s : Str; n : Number} ;
|
||||
lincat Quant = {s : Case => Gender => Number => Str; spec : Species} ;
|
||||
lincat Det = {s : Case => Gender => Str; spec : Species; n : Number} ;
|
||||
lincat NP = {s: Case => Str; a : Agr} ;
|
||||
lincat Pron = {s: Case => Str; acc_clit, dat_clit : Str; a : Agr} ;
|
||||
|
||||
}
|
||||
117
src/albanian/DocumentationSqi.gf
Normal file
117
src/albanian/DocumentationSqi.gf
Normal file
@@ -0,0 +1,117 @@
|
||||
concrete DocumentationSqi of Documentation = CatSqi ** open
|
||||
ParamX, ResSqi, Prelude, HTML in {
|
||||
|
||||
lincat
|
||||
Inflection = {t : Str; s1,s2,s3 : Str} ;
|
||||
Definition = {s : Str} ;
|
||||
Document = {s : Str} ;
|
||||
Tag = {s : Str} ;
|
||||
|
||||
lin InflectionN = \x -> {
|
||||
t="em" ;
|
||||
s1=heading1 ("Emër" ++
|
||||
case x.g of {
|
||||
Masc => "(mashkullor)" ;
|
||||
Fem => "(femëror)"
|
||||
}) ;
|
||||
s2=frameTable (
|
||||
tr (intagAttr "th" "colspan=\"2\"" "" ++ th "Sg" ++ th "Pl") ++
|
||||
tr (intagAttr "th" "rowspan=\"4\"" "Indef" ++ th "Nom" ++ td (x.s ! Indef ! Nom ! Sg) ++ td (x.s ! Indef ! Nom ! Pl)) ++
|
||||
tr (th "Acc" ++ td (x.s ! Indef ! Acc ! Sg) ++ td (x.s ! Indef ! Acc ! Pl)) ++
|
||||
tr (th "Dat" ++ td (x.s ! Indef ! Dat ! Sg) ++ td (x.s ! Indef ! Dat ! Pl)) ++
|
||||
tr (th "Ablat" ++ td (x.s ! Indef ! Ablat ! Sg) ++ td (x.s ! Indef ! Ablat ! Pl)) ++
|
||||
tr (intagAttr "th" "rowspan=\"4\"" "Def" ++ th "Nom" ++ td (x.s ! Def ! Nom ! Sg) ++ td (x.s ! Def ! Nom ! Pl)) ++
|
||||
tr (th "Acc" ++ td (x.s ! Def ! Acc ! Sg) ++ td (x.s ! Def ! Acc ! Pl)) ++
|
||||
tr (th "Dat" ++ td (x.s ! Def ! Dat ! Sg) ++ td (x.s ! Def ! Dat ! Pl)) ++
|
||||
tr (th "Ablat" ++ td (x.s ! Def ! Ablat ! Sg) ++ td (x.s ! Def ! Ablat ! Pl))) ;
|
||||
s3=[]
|
||||
} ;
|
||||
lin InflectionA = \x -> {
|
||||
t="mb" ;
|
||||
s1=heading1 "Mbiemër" ;
|
||||
s2=frameTable (
|
||||
tr (intagAttr "th" "colspan=\"2\"" "" ++ th "Sg" ++ th "Pl") ++
|
||||
tr (intagAttr "th" "rowspan=\"2\"" "Nom" ++ th "Masc" ++ td (y ! Nom ! Masc ! Sg) ++ td (y ! Nom ! Masc ! Pl)) ++
|
||||
tr (th "Fem" ++ td (y ! Nom ! Fem ! Sg) ++ td (y ! Nom ! Fem ! Pl)) ++
|
||||
tr (intagAttr "th" "rowspan=\"2\"" "Acc" ++ th "Masc" ++ td (y ! Acc ! Masc ! Sg) ++ td (y ! Acc ! Masc ! Pl)) ++
|
||||
tr (th "Fem" ++ td (y ! Acc ! Fem ! Sg) ++ td (y ! Acc ! Fem ! Pl)) ++
|
||||
tr (intagAttr "th" "rowspan=\"2\"" "Dat" ++ th "Masc" ++ td (y ! Dat ! Masc ! Sg) ++ td (y ! Dat ! Masc ! Pl)) ++
|
||||
tr (th "Fem" ++ td (y ! Dat ! Fem ! Sg) ++ td (y ! Dat ! Fem ! Pl)) ++
|
||||
tr (intagAttr "th" "rowspan=\"2\"" "Ablat" ++ th "Masc" ++ td (y ! Ablat ! Masc ! Sg) ++ td (y ! Ablat ! Masc ! Pl)) ++
|
||||
tr (th "Fem" ++ td (y ! Ablat ! Fem ! Sg) ++ td (y ! Ablat ! Fem ! Pl))) ;
|
||||
s3=[]
|
||||
} where {
|
||||
y : Case => Gender => Number => Str =
|
||||
\\c,g,n => case x.clit of {
|
||||
True => link_clitic ! Indef ! c ! g ! n ++ x.s ! c ! g ! n ;
|
||||
False => x.s ! c ! g ! n
|
||||
} ;
|
||||
} ;
|
||||
lin InflectionV = \x -> {
|
||||
t="fl" ;
|
||||
s1=heading1 "Folje" ;
|
||||
s2=frameTable (
|
||||
tr (intagAttr "th" "rowspan=\"24\"" "Indicative" ++ intagAttr "th" "rowspan=\"6\"" "Pres" ++ intagAttr "th" "rowspan=\"3\"" "Sg" ++ th "P1" ++ td (x.Indicative ! Pres ! Sg ! P1)) ++
|
||||
tr (th "P2" ++ td (x.Indicative ! Pres ! Sg ! P2)) ++
|
||||
tr (th "P3" ++ td (x.Indicative ! Pres ! Sg ! P3)) ++
|
||||
tr (intagAttr "th" "rowspan=\"3\"" "Pl" ++ th "P1" ++ td (x.Indicative ! Pres ! Pl ! P1)) ++
|
||||
tr (th "P2" ++ td (x.Indicative ! Pres ! Pl ! P2)) ++
|
||||
tr (th "P3" ++ td (x.Indicative ! Pres ! Pl ! P3)) ++
|
||||
tr (intagAttr "th" "rowspan=\"6\"" "Past" ++ intagAttr "th" "rowspan=\"3\"" "Sg" ++ th "P1" ++ td (x.Indicative ! Past ! Sg ! P1)) ++
|
||||
tr (th "P2" ++ td (x.Indicative ! Past ! Sg ! P2)) ++
|
||||
tr (th "P3" ++ td (x.Indicative ! Past ! Sg ! P3)) ++
|
||||
tr (intagAttr "th" "rowspan=\"3\"" "Pl" ++ th "P1" ++ td (x.Indicative ! Past ! Pl ! P1)) ++
|
||||
tr (th "P2" ++ td (x.Indicative ! Past ! Pl ! P2)) ++
|
||||
tr (th "P3" ++ td (x.Indicative ! Past ! Pl ! P3)) ++
|
||||
tr (intagAttr "th" "rowspan=\"6\"" "Aorist" ++ intagAttr "th" "rowspan=\"3\"" "Sg" ++ th "P1" ++ td (x.Indicative ! Aorist ! Sg ! P1)) ++
|
||||
tr (th "P2" ++ td (x.Indicative ! Aorist ! Sg ! P2)) ++
|
||||
tr (th "P3" ++ td (x.Indicative ! Aorist ! Sg ! P3)) ++
|
||||
tr (intagAttr "th" "rowspan=\"3\"" "Pl" ++ th "P1" ++ td (x.Indicative ! Aorist ! Pl ! P1)) ++
|
||||
tr (th "P2" ++ td (x.Indicative ! Aorist ! Pl ! P2)) ++
|
||||
tr (th "P3" ++ td (x.Indicative ! Aorist ! Pl ! P3)) ++
|
||||
tr (intagAttr "th" "rowspan=\"6\"" "Imperfect" ++ intagAttr "th" "rowspan=\"3\"" "Sg" ++ th "P1" ++ td (x.Indicative ! Imperfect ! Sg ! P1)) ++
|
||||
tr (th "P2" ++ td (x.Indicative ! Imperfect ! Sg ! P2)) ++
|
||||
tr (th "P3" ++ td (x.Indicative ! Imperfect ! Sg ! P3)) ++
|
||||
tr (intagAttr "th" "rowspan=\"3\"" "Pl" ++ th "P1" ++ td (x.Indicative ! Imperfect ! Pl ! P1)) ++
|
||||
tr (th "P2" ++ td (x.Indicative ! Imperfect ! Pl ! P2)) ++
|
||||
tr (th "P3" ++ td (x.Indicative ! Imperfect ! Pl ! P3)) ++
|
||||
tr (intagAttr "th" "rowspan=\"2\"" "Imperative" ++ th "Sg" ++ td (x.Imperative ! Sg)) ++
|
||||
tr (th "Pl" ++ td (x.Imperative ! Pl)) ++
|
||||
tr (th "participle" ++ td (x.participle)) ++
|
||||
tr (intagAttr "th" "rowspan=\"6\"" "pres_optative" ++ intagAttr "th" "rowspan=\"3\"" "Sg" ++ th "P1" ++ td (x.pres_optative ! Sg ! P1)) ++
|
||||
tr (th "P2" ++ td (x.pres_optative ! Sg ! P2)) ++
|
||||
tr (th "P3" ++ td (x.pres_optative ! Sg ! P3)) ++
|
||||
tr (intagAttr "th" "rowspan=\"3\"" "Pl" ++ th "P1" ++ td (x.pres_optative ! Pl ! P1)) ++
|
||||
tr (th "P2" ++ td (x.pres_optative ! Pl ! P2)) ++
|
||||
tr (th "P3" ++ td (x.pres_optative ! Pl ! P3)) ++
|
||||
tr (intagAttr "th" "rowspan=\"6\"" "perf_optative" ++ intagAttr "th" "rowspan=\"3\"" "Sg" ++ th "P1" ++ td (x.perf_optative ! Sg ! P1)) ++
|
||||
tr (th "P2" ++ td (x.perf_optative ! Sg ! P2)) ++
|
||||
tr (th "P3" ++ td (x.perf_optative ! Sg ! P3)) ++
|
||||
tr (intagAttr "th" "rowspan=\"3\"" "Pl" ++ th "P1" ++ td (x.perf_optative ! Pl ! P1)) ++
|
||||
tr (th "P2" ++ td (x.perf_optative ! Pl ! P2)) ++
|
||||
tr (th "P3" ++ td (x.perf_optative ! Pl ! P3)) ++
|
||||
tr (intagAttr "th" "rowspan=\"6\"" "pres_admirative" ++ intagAttr "th" "rowspan=\"3\"" "Sg" ++ th "P1" ++ td (x.pres_admirative ! Sg ! P1)) ++
|
||||
tr (th "P2" ++ td (x.pres_admirative ! Sg ! P2)) ++
|
||||
tr (th "P3" ++ td (x.pres_admirative ! Sg ! P3)) ++
|
||||
tr (intagAttr "th" "rowspan=\"3\"" "Pl" ++ th "P1" ++ td (x.pres_admirative ! Pl ! P1)) ++
|
||||
tr (th "P2" ++ td (x.pres_admirative ! Pl ! P2)) ++
|
||||
tr (th "P3" ++ td (x.pres_admirative ! Pl ! P3)) ++
|
||||
tr (intagAttr "th" "rowspan=\"6\"" "imperf_admirative" ++ intagAttr "th" "rowspan=\"3\"" "Sg" ++ th "P1" ++ td (x.imperf_admirative ! Sg ! P1)) ++
|
||||
tr (th "P2" ++ td (x.imperf_admirative ! Sg ! P2)) ++
|
||||
tr (th "P3" ++ td (x.imperf_admirative ! Sg ! P3)) ++
|
||||
tr (intagAttr "th" "rowspan=\"3\"" "Pl" ++ th "P1" ++ td (x.imperf_admirative ! Pl ! P1)) ++
|
||||
tr (th "P2" ++ td (x.imperf_admirative ! Pl ! P2)) ++
|
||||
tr (th "P3" ++ td (x.imperf_admirative ! Pl ! P3))) ;
|
||||
s3=[]
|
||||
} ;
|
||||
lin InflectionAdv = \x -> {
|
||||
t="nd" ;
|
||||
s1=heading1 "Ndajfolje" ;
|
||||
s2=frameTable (
|
||||
tr (th "s" ++ td (x.s))) ;
|
||||
s3=[]
|
||||
} ;
|
||||
lin
|
||||
NoDefinition t = {s=t.s};
|
||||
MkDefinition t d = {s="<p><b>Definition:</b>"++t.s++d.s++"</p>"};
|
||||
MkDefinitionEx t d e = {s="<p><b>Definition:</b>"++t.s++d.s++"</p><p><b>Example:</b>"++e.s++"</p>"};lin MkDocument d i e = {s = i.s1 ++ d.s ++ i.s2 ++ i.s3 ++ e.s} ; MkTag i = {s = i.t} ;}
|
||||
9
src/albanian/GrammarSqi.gf
Normal file
9
src/albanian/GrammarSqi.gf
Normal file
@@ -0,0 +1,9 @@
|
||||
concrete GrammarSqi of Grammar =
|
||||
NounSqi,
|
||||
AdjectiveSqi,
|
||||
NumeralSqi,
|
||||
PhraseSqi,
|
||||
StructuralSqi
|
||||
** {
|
||||
|
||||
} ;
|
||||
10
src/albanian/LangSqi.gf
Normal file
10
src/albanian/LangSqi.gf
Normal file
@@ -0,0 +1,10 @@
|
||||
--# -path=.:../abstract
|
||||
concrete LangSqi of Lang =
|
||||
GrammarSqi,
|
||||
LexiconSqi
|
||||
,DocumentationSqi --# notpresent
|
||||
** {
|
||||
|
||||
flags startcat = Phr ;
|
||||
|
||||
}
|
||||
8
src/albanian/LexiconSqi.gf
Normal file
8
src/albanian/LexiconSqi.gf
Normal file
@@ -0,0 +1,8 @@
|
||||
concrete LexiconSqi of Lexicon = CatSqi ** open ParadigmsSqi in {
|
||||
|
||||
lin
|
||||
airplane_N = mkN032 "aeroplan" ;
|
||||
apple_N = mkN069 "mollë" ;
|
||||
good_A = mkA "mirë" ;
|
||||
|
||||
}
|
||||
42501
src/albanian/MorphoSqi.gf
Normal file
42501
src/albanian/MorphoSqi.gf
Normal file
File diff suppressed because it is too large
Load Diff
40
src/albanian/NounSqi.gf
Normal file
40
src/albanian/NounSqi.gf
Normal file
@@ -0,0 +1,40 @@
|
||||
concrete NounSqi of Noun = CatSqi ** open MorphoSqi, ResSqi in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
DetCN det cn = {
|
||||
s = \\c => det.s ! c ! cn.g ++ cn.s ! det.spec ! c ! det.n ;
|
||||
a = agrgP3 cn.g det.n
|
||||
} ;
|
||||
|
||||
UsePron p = p ;
|
||||
|
||||
DetQuant quant num = {
|
||||
s = \\c,g => quant.s ! c ! g ! num.n ++ num.s ;
|
||||
n = num.n ;
|
||||
spec = quant.spec
|
||||
} ;
|
||||
|
||||
NumSg = {s = []; n = Sg} ;
|
||||
NumPl = {s = []; n = Pl} ;
|
||||
|
||||
DefArt = {
|
||||
s = \\c,g,n => [] ;
|
||||
spec = Def
|
||||
} ;
|
||||
|
||||
IndefArt = {
|
||||
s = \\c,g => table Number ["një"; []] ;
|
||||
spec = Indef
|
||||
} ;
|
||||
|
||||
UseN n = n ;
|
||||
UseN2 n = n ;
|
||||
|
||||
AdjCN ap cn = {
|
||||
s = \\spec,c,n => cn.s ! spec ! c ! n ++ ap.s ! spec ! c ! cn.g ! n ;
|
||||
g = cn.g
|
||||
} ;
|
||||
|
||||
}
|
||||
87
src/albanian/NumeralSqi.gf
Normal file
87
src/albanian/NumeralSqi.gf
Normal file
@@ -0,0 +1,87 @@
|
||||
concrete NumeralSqi of Numeral = CatSqi ** open ParamX, Prelude in {
|
||||
|
||||
oper bind : Str -> Str -> Str = \a -> \b -> a ++ b ;
|
||||
|
||||
param DForm = unit | teen | ten ;
|
||||
|
||||
oper LinDigit = {s : DForm => Str };
|
||||
oper LinSub100 = {s : Str } ;
|
||||
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = LinSub100 ;
|
||||
lincat Sub1000 = LinSub100 ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
oper mkNum : Str -> LinDigit = \tri ->
|
||||
{ s = table {unit => tri ; teen => tri + "mbë" + "dhjetë" ; ten => tri + "dhjetë" }};
|
||||
|
||||
lin num x = {s = x.s } ;
|
||||
|
||||
lin n2 = {s = table {unit => "dy" ; teen => "dy" + "mbë" + "dhjetë" ; ten => "njëzet" }};
|
||||
lin n3 = mkNum "tre" ;
|
||||
lin n4 = {s = table {unit => "katër" ; teen => "katër" + "mbë" + "dhjetë" ; ten => "dyzet" } };
|
||||
lin n5 = mkNum "pesë" ;
|
||||
lin n6 = mkNum "gjashtë";
|
||||
lin n7 = mkNum "shtatë";
|
||||
lin n8 = mkNum "tetë";
|
||||
lin n9 = mkNum "nëntë";
|
||||
|
||||
oper mkR : Str -> LinSub100 = \n -> {s = n } ;
|
||||
|
||||
lin pot01 = { s = table {_ => "një" }};
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = mkR "dhjetë" ;
|
||||
lin pot111 = mkR ("një" + "mbë" + "dhjetë") ;
|
||||
lin pot1to19 d = mkR (d.s ! teen) ;
|
||||
lin pot0as1 n = mkR (n.s ! unit) ;
|
||||
lin pot1 d = mkR (d.s ! ten) ;
|
||||
lin pot1plus d e = mkR ((d.s ! ten) ++ "e" ++ (e.s ! unit)) ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = mkR (bind (d.s ! unit) "qind") ;
|
||||
lin pot2plus d e = mkR ((bind (d.s ! unit) "qind") ++ "e" ++ e.s) ;
|
||||
lin pot2as3 n = {s = n.s };
|
||||
lin pot3 n = {s = n.s ++ "mijë" } ;
|
||||
lin pot3plus n m = {s = n.s ++ "mijë" ++ m.s} ;
|
||||
|
||||
|
||||
lincat Dig = {s : Str; n : Number} ;
|
||||
|
||||
lin IDig d = d ** {tail = T1} ;
|
||||
|
||||
IIDig d i = {
|
||||
s = d.s ++ spaceIf i.tail ++ i.s ;
|
||||
n = Pl ;
|
||||
tail = inc i.tail
|
||||
} ;
|
||||
|
||||
D_0 = mkDig "0" Pl ;
|
||||
D_1 = mkDig "1" Sg ;
|
||||
D_2 = mkDig "2" Pl ;
|
||||
D_3 = mkDig "3" Pl ;
|
||||
D_4 = mkDig "4" Pl ;
|
||||
D_5 = mkDig "5" Pl ;
|
||||
D_6 = mkDig "6" Pl ;
|
||||
D_7 = mkDig "7" Pl ;
|
||||
D_8 = mkDig "8" Pl ;
|
||||
D_9 = mkDig "9" Pl ;
|
||||
|
||||
lin PosDecimal d = d ** {hasDot=False} ;
|
||||
NegDecimal d = {s="-" ++ BIND ++ d.s; hasDot=False; n = Pl} ;
|
||||
IFrac d i = {
|
||||
s=d.s ++
|
||||
if_then_Str d.hasDot BIND (BIND++","++BIND) ++
|
||||
i.s ;
|
||||
hasDot=True;
|
||||
n = Pl
|
||||
} ;
|
||||
|
||||
oper
|
||||
mkDig : Str -> Number -> Dig = \s,n -> lin Dig {s=s; n=n} ;
|
||||
|
||||
spaceIf : DTail -> Str = \t -> case t of {
|
||||
T3 => "" ;
|
||||
_ => BIND
|
||||
} ;
|
||||
|
||||
}
|
||||
1375
src/albanian/ParadigmsSqi.gf
Normal file
1375
src/albanian/ParadigmsSqi.gf
Normal file
File diff suppressed because it is too large
Load Diff
14
src/albanian/PhraseSqi.gf
Normal file
14
src/albanian/PhraseSqi.gf
Normal file
@@ -0,0 +1,14 @@
|
||||
concrete PhraseSqi of Phrase = CatSqi ** open Prelude, ResSqi in {
|
||||
|
||||
lin
|
||||
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
|
||||
|
||||
UttS s = s ;
|
||||
UttNP np = {s = np.s ! Nom} ;
|
||||
UttInterj i = i ;
|
||||
|
||||
NoPConj = {s = []} ;
|
||||
|
||||
NoVoc = {s = []} ;
|
||||
|
||||
}
|
||||
261
src/albanian/ResSqi.gf
Normal file
261
src/albanian/ResSqi.gf
Normal file
@@ -0,0 +1,261 @@
|
||||
resource ResSqi = ParamX-[Tense,Past,Pres] ** open Prelude in {
|
||||
|
||||
oper Compl = {s : Str} ;
|
||||
|
||||
param Species = Indef | Def ;
|
||||
param Case = Nom | Acc | Dat | Ablat ;
|
||||
param Gender = Masc | Fem ;
|
||||
|
||||
param GenNum = GSg Gender | GPl ;
|
||||
oper Agr = {gn : GenNum; p : Person} ;
|
||||
|
||||
oper Noun = {s: Species => Case => Number => Str; g: Gender} ; -- 3978
|
||||
oper mkNoun : (_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_ : Str) -> Gender -> Noun =
|
||||
\f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,g ->
|
||||
{ s = table {
|
||||
Indef => table {
|
||||
Nom => table {
|
||||
Sg => f1 ;
|
||||
Pl => f2
|
||||
} ;
|
||||
Acc => table {
|
||||
Sg => f3 ;
|
||||
Pl => f4
|
||||
} ;
|
||||
Dat => table {
|
||||
Sg => f5 ;
|
||||
Pl => f6
|
||||
} ;
|
||||
Ablat => table {
|
||||
Sg => f7 ;
|
||||
Pl => f8
|
||||
}
|
||||
} ;
|
||||
Def => table {
|
||||
Nom => table {
|
||||
Sg => f9 ;
|
||||
Pl => f10
|
||||
} ;
|
||||
Acc => table {
|
||||
Sg => f11 ;
|
||||
Pl => f12
|
||||
} ;
|
||||
Dat => table {
|
||||
Sg => f13 ;
|
||||
Pl => f14
|
||||
} ;
|
||||
Ablat => table {
|
||||
Sg => f15 ;
|
||||
Pl => f16
|
||||
}
|
||||
}
|
||||
} ;
|
||||
g = g
|
||||
} ;
|
||||
|
||||
|
||||
oper Adj = {s: Case => Gender => Number => Str; clit: Bool} ; -- 462
|
||||
oper mkAdj : (_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_ : Str) -> Bool -> Adj =
|
||||
\f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,clit ->
|
||||
{ s = table {
|
||||
Nom => table {
|
||||
Masc => table {
|
||||
Sg => f1 ;
|
||||
Pl => f2
|
||||
} ;
|
||||
Fem => table {
|
||||
Sg => f3 ;
|
||||
Pl => f4
|
||||
}
|
||||
} ;
|
||||
Acc => table {
|
||||
Masc => table {
|
||||
Sg => f5 ;
|
||||
Pl => f6
|
||||
} ;
|
||||
Fem => table {
|
||||
Sg => f7 ;
|
||||
Pl => f8
|
||||
}
|
||||
} ;
|
||||
Dat => table {
|
||||
Masc => table {
|
||||
Sg => f9 ;
|
||||
Pl => f10
|
||||
} ;
|
||||
Fem => table {
|
||||
Sg => f11 ;
|
||||
Pl => f12
|
||||
}
|
||||
} ;
|
||||
Ablat => table {
|
||||
Masc => table {
|
||||
Sg => f13 ;
|
||||
Pl => f14
|
||||
} ;
|
||||
Fem => table {
|
||||
Sg => f15 ;
|
||||
Pl => f16
|
||||
}
|
||||
}
|
||||
} ;
|
||||
clit = clit
|
||||
} ;
|
||||
|
||||
|
||||
param Tense = Pres | Past | Imperfect | Aorist ;
|
||||
oper Verb = {Indicative: Tense => Number => Person => Str; Imperative: Number => Str; participle: Str; pres_optative: Number => Person => Str; perf_optative: Number => Person => Str; pres_admirative: Number => Person => Str; imperf_admirative: Number => Person => Str} ; -- 758
|
||||
oper mkVerb : (_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_ : Str) -> Verb =
|
||||
\f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,f18,f19,f20,f21,f22,f23,f24,f25,f26,f27,f28,f29,f30,f31,f32,f33,f34,f35,f36,f37,f38,f39,f40,f41,f42,f43,f44,f45,f46,f47,f48,f49,f50,f51 ->
|
||||
{ Indicative = table {
|
||||
Pres => table {
|
||||
Sg => table {
|
||||
P1 => f1 ;
|
||||
P2 => f2 ;
|
||||
P3 => f3
|
||||
} ;
|
||||
Pl => table {
|
||||
P1 => f4 ;
|
||||
P2 => f5 ;
|
||||
P3 => f6
|
||||
}
|
||||
} ;
|
||||
Past => table {
|
||||
Sg => table {
|
||||
P1 => f7 ;
|
||||
P2 => f8 ;
|
||||
P3 => f9
|
||||
} ;
|
||||
Pl => table {
|
||||
P1 => f10 ;
|
||||
P2 => f11 ;
|
||||
P3 => f12
|
||||
}
|
||||
} ;
|
||||
Aorist => table {
|
||||
Sg => table {
|
||||
P1 => f13 ;
|
||||
P2 => f14 ;
|
||||
P3 => f15
|
||||
} ;
|
||||
Pl => table {
|
||||
P1 => f16 ;
|
||||
P2 => f17 ;
|
||||
P3 => f18
|
||||
}
|
||||
} ;
|
||||
Imperfect => table {
|
||||
Sg => table {
|
||||
P1 => f19 ;
|
||||
P2 => f20 ;
|
||||
P3 => f21
|
||||
} ;
|
||||
Pl => table {
|
||||
P1 => f22 ;
|
||||
P2 => f23 ;
|
||||
P3 => f24
|
||||
}
|
||||
}
|
||||
} ;
|
||||
Imperative = table {
|
||||
Sg => f25 ;
|
||||
Pl => f26
|
||||
} ;
|
||||
participle = f27 ;
|
||||
pres_optative = table {
|
||||
Sg => table {
|
||||
P1 => f28 ;
|
||||
P2 => f29 ;
|
||||
P3 => f30
|
||||
} ;
|
||||
Pl => table {
|
||||
P1 => f31 ;
|
||||
P2 => f32 ;
|
||||
P3 => f33
|
||||
}
|
||||
} ;
|
||||
perf_optative = table {
|
||||
Sg => table {
|
||||
P1 => f34 ;
|
||||
P2 => f35 ;
|
||||
P3 => f36
|
||||
} ;
|
||||
Pl => table {
|
||||
P1 => f37 ;
|
||||
P2 => f38 ;
|
||||
P3 => f39
|
||||
}
|
||||
} ;
|
||||
pres_admirative = table {
|
||||
Sg => table {
|
||||
P1 => f40 ;
|
||||
P2 => f41 ;
|
||||
P3 => f42
|
||||
} ;
|
||||
Pl => table {
|
||||
P1 => f43 ;
|
||||
P2 => f44 ;
|
||||
P3 => f45
|
||||
}
|
||||
} ;
|
||||
imperf_admirative = table {
|
||||
Sg => table {
|
||||
P1 => f46 ;
|
||||
P2 => f47 ;
|
||||
P3 => f48
|
||||
} ;
|
||||
Pl => table {
|
||||
P1 => f49 ;
|
||||
P2 => f50 ;
|
||||
P3 => f51
|
||||
}
|
||||
}
|
||||
} ;
|
||||
|
||||
oper link_clitic : Species => Case => Gender => Number => Str =
|
||||
table {
|
||||
Indef => table {
|
||||
Nom => table {
|
||||
Masc => table {
|
||||
Sg => "i" ;
|
||||
Pl => "të"
|
||||
} ;
|
||||
Fem => table {
|
||||
Sg => "e" ;
|
||||
Pl => "të"
|
||||
}
|
||||
} ;
|
||||
_ => \\_,_ => "të"
|
||||
} ;
|
||||
Def => table {
|
||||
Nom => table {
|
||||
Masc => table {
|
||||
Sg => "i" ;
|
||||
Pl => "e"
|
||||
} ;
|
||||
Fem => table {
|
||||
Sg => "e" ;
|
||||
Pl => "e"
|
||||
}
|
||||
} ;
|
||||
Acc => \\_,_ => "e" ;
|
||||
_ => table {
|
||||
Masc => \\_ => "të" ;
|
||||
Fem => table {
|
||||
Sg => "së" ;
|
||||
Pl => "të"
|
||||
}
|
||||
}
|
||||
}
|
||||
} ;
|
||||
|
||||
oper genNum : Gender -> Number -> GenNum = \g,n ->
|
||||
case n of {
|
||||
Sg => GSg g ;
|
||||
Pl => GPl
|
||||
} ;
|
||||
|
||||
agrgP3 : Gender -> Number -> Agr =
|
||||
\g,n -> {gn=genNum g n; p=P3} ;
|
||||
|
||||
}
|
||||
19
src/albanian/StructuralSqi.gf
Normal file
19
src/albanian/StructuralSqi.gf
Normal file
@@ -0,0 +1,19 @@
|
||||
concrete StructuralSqi of Structural = CatSqi ** open ResSqi, ParadigmsSqi in {
|
||||
|
||||
lin i_Pron = mkPron "unë" "mua" "mua" "meje" "më" "më" (GSg Masc) P1 ;
|
||||
lin youSg_Pron = mkPron "ti" "ty" "ty" "teje" "të" "të" (GSg Masc) P2 ;
|
||||
lin he_Pron = mkPron "ai" "atë" "atij" "atij" "e" "i" (GSg Masc) P3 ;
|
||||
lin she_Pron = mkPron "ajo" "atë" "asaj" "asaj" "e" "i" (GSg Fem) P3 ;
|
||||
lin it_Pron = mkPron "ai" "atë" "atij" "atij" "e" "i" (GSg Masc) P3 ;
|
||||
lin we_Pron = mkPron "ne" "ne" "neve" "nesh" "na" "na" GPl P1 ;
|
||||
lin youPl_Pron = mkPron "ju" "ju" "juve" "jush" "ju" "ju" GPl P2 ;
|
||||
lin they_Pron = mkPron "ata" "ata" "atyre" "atyre" "i" "u" GPl P3 ;
|
||||
lin this_Quant = mkQuant "ky" "këta" "kjo" "këto"
|
||||
"këtë" "këtyre" "këtë" "këtyre"
|
||||
"këtij" "këtyre" "kësaj" "këtyre"
|
||||
"këtij" "këtyre" "kësaj" "këtyre" ;
|
||||
lin that_Quant = mkQuant "ai" "ata" "ajo" "ato"
|
||||
"atë" "ata" "atë" "ato"
|
||||
"atij" "atyre" "asaj" "atyre"
|
||||
"atij" "atyre" "asaj" "atyre" ;
|
||||
}
|
||||
@@ -22,6 +22,7 @@ lincat
|
||||
Prep = ResAmh.Prep;
|
||||
Numeral = ResAmh.Numeral; --{s : CardOrd => Case => Str ; n : Number} ;
|
||||
Digits = ResAmh.Digits;--{s : CardOrd => Case => Str ; n : Number ; tail : DTail} ;
|
||||
Decimal = ResAmh.Decimal;
|
||||
Ord = ResAmh.Ord ; --{ s : Case => Str } ;
|
||||
Num = ResAmh.Num;--{s : Case => Str ; n : Number ; hasCard : Bool} ;
|
||||
Card = ResAmh.Card;--{s : Case => Str ; n : Number} ;
|
||||
|
||||
@@ -94,6 +94,7 @@ lin
|
||||
NumCard n = {s = \\s,c => n.s!Masc!Sg!s!c ; n = Pl; hasCard = True} ;
|
||||
|
||||
NumDigits n = {s = n.s ! NCard } ;
|
||||
NumDecimal n = {s = n.s ! NCard } ;
|
||||
|
||||
NumNumeral numeral = {s = numeral.s ! NCard} ;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
concrete NumeralAmh of Numeral = CatAmh [Numeral,Digits] ** open ResAmh,ParamX,Prelude in {
|
||||
concrete NumeralAmh of Numeral = CatAmh [Numeral,Digits,Decimal] ** open ResAmh,ParamX,Prelude in {
|
||||
flags coding = utf8;
|
||||
lincat
|
||||
|
||||
@@ -91,17 +91,24 @@ lin pot3plus n m = {
|
||||
D_8 = mkDig "8" ;
|
||||
D_9 = mk2Dig "9" "9ኛ";
|
||||
|
||||
PosDecimal d = d ** {hasDot=False} ;
|
||||
NegDecimal d = {
|
||||
s = \\o,g,n,s,c => "-" ++ BIND ++ d.s !o!g!n!s!c ;
|
||||
hasDot=False
|
||||
} ;
|
||||
IFrac d i = {
|
||||
s = \\o,g,n,s,c => d.s!NCard!Masc!Sg!Indef!c ++
|
||||
if_then_Str d.hasDot BIND (BIND++"."++BIND) ++
|
||||
i.s ! o ! g ! n ! s ! c;
|
||||
hasDot=True
|
||||
} ;
|
||||
|
||||
oper
|
||||
commaIf : DTail -> Str = \t -> case t of {
|
||||
T3 => BIND++","++BIND ;
|
||||
_ => BIND
|
||||
} ;
|
||||
|
||||
inc : DTail -> DTail = \t -> case t of {
|
||||
T1 => T2 ;
|
||||
T2 => T3 ;
|
||||
T3 => T1
|
||||
} ;
|
||||
------------------ :) what a releif
|
||||
|
||||
mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o ;
|
||||
|
||||
@@ -161,6 +161,10 @@ resource ResAmh = PatternsAmh** open Prelude,MorphoAmh,ParamX in {
|
||||
s : CardOrd=>Gender=>Number=>Species=>Case => Str ;
|
||||
tail : DTail
|
||||
} ;
|
||||
Decimal = {
|
||||
s : CardOrd=>Gender=>Number=>Species=>Case => Str ;
|
||||
hasDot : Bool
|
||||
} ;
|
||||
|
||||
Ord = {s : Gender=>Number=>Species=>Case => Str} ;
|
||||
|
||||
@@ -991,8 +995,8 @@ pronNP : (N,A,G,D : Str) -> PerNumGen -> NP = \N,A,G,D,png-> {
|
||||
{
|
||||
s = \\c =>case c of
|
||||
{
|
||||
Gen|Dat => affix!c + word;
|
||||
_ => word + affix!c
|
||||
Gen|Dat => affix!c ++ Predef.BIND ++ word;
|
||||
_ => word ++ Predef.BIND ++ affix!c
|
||||
};
|
||||
a = {png = Per3 n Masc ; isPron = False };
|
||||
lock_NP = <>
|
||||
|
||||
@@ -90,6 +90,7 @@ concrete CatGrc of Cat = CommonX - [Temp,Tense] ** open ResGrc, Prelude in {
|
||||
|
||||
Numeral = {s : CardOrd => Str ; n : Number} ;
|
||||
Digits = {s : Str ; unit : Unit} ;
|
||||
Decimal = {s : Str ; unit : Unit ; hasDot : Bool} ;
|
||||
|
||||
-- Structural
|
||||
|
||||
|
||||
@@ -83,6 +83,8 @@ concrete NounGrc of Noun = CatGrc ** open Prelude, ResGrc, (M = MorphoGrc) in {
|
||||
-- TODO: check the following two:
|
||||
NumDigits digits = let num : Number = case digits.unit of {one => Sg ; _ => Pl}
|
||||
in {s = \\g,c => digits.s ++ "'"; n = num ; isCard = True} ;
|
||||
NumDecimal digits = let num : Number = case digits.unit of {one => Sg ; _ => Pl}
|
||||
in {s = \\g,c => digits.s ++ "'"; n = num ; isCard = True} ;
|
||||
NumNumeral numeral = {s = \\g,c => numeral.s ! NCard g c; n = numeral.n } ;
|
||||
|
||||
AdNum adn num = {s = \\g,c => adn.s ++ num.s ! g ! c ; n = num.n} ;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--# -path=.:../abstract:../common:../prelude:
|
||||
|
||||
concrete NumeralGrc of Numeral = CatGrc ** open ResGrc, MorphoGrc in {
|
||||
concrete NumeralGrc of Numeral = CatGrc ** open ResGrc, MorphoGrc, Prelude in {
|
||||
|
||||
lincat
|
||||
Digit = {s : DForm => CardOrd => Str} ;
|
||||
@@ -81,6 +81,8 @@ lin -- mkDigit d (d+10) (d*10) d-th d-times
|
||||
D_8 = mkDig "h" "p" "w" ;
|
||||
D_9 = mkDig "v" "K" "P" ; -- TODO: replace K by koppa, P by sampi (not in ut -ancientgreek)
|
||||
|
||||
PosDecimal d = d ** {hasDot=False} ;
|
||||
|
||||
oper
|
||||
TDigit = {
|
||||
s : Unit => Str
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
-- Author: Hans Leiß, LMU Munich, CIS
|
||||
|
||||
|
||||
resource ResGrc = ParamX - [Number,Sg,Pl,ImpForm,numImp,Tense,ImpF]
|
||||
resource ResGrc = ParamX - [Number,Sg,Pl,ImpForm,numImp,Tense,ImpF,inc,DTail]
|
||||
** open Prelude, PhonoGrc, Predef in {
|
||||
flags
|
||||
optimize = noexpand ; -- optimize=all is impossible with addAccent
|
||||
|
||||
15
src/api/CombinatorsSco.gf
Normal file
15
src/api/CombinatorsSco.gf
Normal file
@@ -0,0 +1,15 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsSco = Combinators - [ appCN, appCNc ] with
|
||||
(Cat = CatSco),
|
||||
(Structural = StructuralSco),
|
||||
(Noun = NounSco),
|
||||
(Constructors = ConstructorsSco) **
|
||||
{
|
||||
oper
|
||||
appCN : CN -> NP -> NP
|
||||
= \cn,x -> mkNP the_Art (PossNP cn x) ;
|
||||
appCNc : CN -> [NP] -> NP
|
||||
= \cn,xs -> let np : NP = mkNP and_Conj xs
|
||||
in mkNP the_Art (PossNP cn np) ;
|
||||
}
|
||||
3
src/api/ConstructorsSco.gf
Normal file
3
src/api/ConstructorsSco.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource ConstructorsSco = Constructors with (Grammar = GrammarSco) ;
|
||||
5
src/api/SymbolicSco.gf
Normal file
5
src/api/SymbolicSco.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:../english:../common:../abstract:../prelude
|
||||
|
||||
resource SymbolicSco = Symbolic with
|
||||
(Symbol = SymbolSco),
|
||||
(Grammar = GrammarSco) ;
|
||||
@@ -1,4 +1,4 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
--# -path=../abstract:.:alltenses:prelude:
|
||||
|
||||
instance SyntaxGer of Syntax = ConstructorsGer, CatGer, StructuralGer, CombinatorsGer ;
|
||||
|
||||
|
||||
5
src/api/SyntaxSco.gf
Normal file
5
src/api/SyntaxSco.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
instance SyntaxSco of Syntax =
|
||||
ConstructorsSco, CatSco, StructuralSco, CombinatorsSco ;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--# -path=.:../arabic:../common:../abstract:../prelude
|
||||
--# -path=.:../arabic:../common:../abstract:../prelude:../morphodict
|
||||
|
||||
resource TryAra = SyntaxAra, LexiconAra, ParadigmsAra - [mkAdN, mkAdv,mkOrd,mkQuant] **
|
||||
resource TryAra = SyntaxAra, LexiconAra, MorphoDictAra, ParadigmsAra - [mkAdN, mkAdv,mkOrd,mkQuant] **
|
||||
open (P = ParadigmsAra) in {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
--# -path=.:../danish:../scandinavian:../common:../abstract:../prelude
|
||||
|
||||
resource TryDan = SyntaxDan, LexiconDan, ParadigmsDan - [mkAdv] ;
|
||||
resource TryDan = SyntaxDan-[mkAdN], LexiconDan, ParadigmsDan - [mkAdv,mkAdN] **
|
||||
open (P = ParadigmsDan) in {
|
||||
|
||||
oper
|
||||
mkAdv = overload SyntaxDan {
|
||||
mkAdv : Str -> Adv = P.mkAdv ;
|
||||
} ;
|
||||
|
||||
mkAdN = overload {
|
||||
mkAdN : CAdv -> AdN = SyntaxDan.mkAdN ;
|
||||
mkAdN : Str -> AdN = P.mkAdN ;
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
--# -path=.:../basque:../common:../abstract:../prelude
|
||||
|
||||
resource TryEus = SyntaxEus, LexiconEus, ParadigmsEus - [mkAdv,mkAdN,mkDet,mkQuant,mkPConj] ;
|
||||
resource TryEus = SyntaxEus-[mkVoc], LexiconEus, ParadigmsEus - [mkAdv,mkAdN,mkDet,mkQuant,mkPConj,mkVoc] **
|
||||
open (P = ParadigmsEus) in {
|
||||
|
||||
oper
|
||||
mkAdv = overload SyntaxEus {
|
||||
mkAdv : Str -> Adv = P.mkAdv ;
|
||||
} ;
|
||||
|
||||
mkVoc = overload {
|
||||
mkVoc : NP -> Voc = SyntaxEus.mkVoc ;
|
||||
mkVoc : Str -> Voc = P.mkVoc ;
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
--# -path=.:../german:../common:../abstract:../prelude
|
||||
|
||||
resource TryGer = SyntaxGer, ExtraGer, LexiconGer, ParadigmsGer - [mkAdv], MakeStructuralGer ;
|
||||
resource TryGer = SyntaxGer, ExtraGer, LexiconGer, ParadigmsGer - [mkAdv,mkIAdv], MakeStructuralGer ;
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
--# -path=.:../greek:../common:../abstract:../prelude
|
||||
|
||||
resource TryGre = SyntaxGre, LexiconGre, ParadigmsGre ;
|
||||
|
||||
{-
|
||||
-[mkAdv, mkDet,mkQuant]**
|
||||
resource TryGre = SyntaxGre-[mkAdN,mkVoc], LexiconGre, ParadigmsGre - [mkAdN,mkAdv,mkVoc] **
|
||||
open (P = ParadigmsGre) in {
|
||||
|
||||
oper
|
||||
|
||||
oper
|
||||
mkAdv = overload SyntaxGre {
|
||||
mkAdv : Str -> Adv = P.mkAdv ;
|
||||
} ;
|
||||
|
||||
}
|
||||
mkVoc = overload {
|
||||
mkVoc : NP -> Voc = SyntaxGre.mkVoc ;
|
||||
mkVoc : Str -> Voc = P.mkVoc ;
|
||||
} ;
|
||||
|
||||
-}
|
||||
mkAdN = overload {
|
||||
mkAdN : CAdv -> AdN = SyntaxGre.mkAdN ;
|
||||
mkAdN : Str -> AdN = P.mkAdN ;
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
--# -path=.:../hungarian:../common:../abstract:../prelude
|
||||
|
||||
resource TryHun = SyntaxHun, LexiconHun, ParadigmsHun - [mkAdv] ;
|
||||
resource TryHun = SyntaxHun-[mkAdN], LexiconHun, ParadigmsHun - [mkAdv,mkAdN] **
|
||||
open (P = ParadigmsHun) in {
|
||||
|
||||
oper
|
||||
mkAdv = overload SyntaxHun {
|
||||
mkAdv : Str -> Adv = P.mkAdv ;
|
||||
} ;
|
||||
|
||||
mkAdN = overload {
|
||||
mkAdN : CAdv -> AdN = SyntaxHun.mkAdN ;
|
||||
mkAdN : Str -> AdN = P.mkAdN ;
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
--# -path=.:../icelandic:../common:../abstract:../prelude
|
||||
|
||||
resource TryIce = SyntaxIce, LexiconIce, ParadigmsIce - [mkAdv,mkAdN,mkOrd] ;
|
||||
resource TryIce = SyntaxIce-[mkVoc], LexiconIce, ParadigmsIce - [mkAdv,mkAdN,mkOrd,mkVoc] **
|
||||
open (P = ParadigmsIce) in {
|
||||
|
||||
oper
|
||||
mkVoc = overload {
|
||||
mkVoc : NP -> Voc = SyntaxIce.mkVoc ;
|
||||
mkVoc : Str -> Voc = P.mkVoc ;
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
--# -path=.:../nynorsk:../scandinavian:../common:../abstract:../prelude
|
||||
|
||||
resource TryNno = SyntaxNno, LexiconNno, ParadigmsNno - [mkAdv] ;
|
||||
resource TryNno = SyntaxNno-[mkAdN], LexiconNno, ParadigmsNno - [mkAdv,mkAdN] **
|
||||
open (P = ParadigmsNno) in {
|
||||
|
||||
oper
|
||||
mkAdv = overload SyntaxNno {
|
||||
mkAdv : Str -> Adv = P.mkAdv ;
|
||||
} ;
|
||||
|
||||
mkAdN = overload {
|
||||
mkAdN : CAdv -> AdN = SyntaxNno.mkAdN ;
|
||||
mkAdN : Str -> AdN = P.mkAdN ;
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
--# -path=.:../norwegian:../scandinavian:../common:../abstract:../prelude
|
||||
|
||||
resource TryNor = SyntaxNor, LexiconNor, ParadigmsNor - [mkAdv] ;
|
||||
resource TryNor = SyntaxNor-[mkAdN], LexiconNor, ParadigmsNor - [mkAdv,mkAdN] **
|
||||
open (P = ParadigmsNor) in {
|
||||
|
||||
oper
|
||||
mkAdv = overload SyntaxNor {
|
||||
mkAdv : Str -> Adv = P.mkAdv ;
|
||||
} ;
|
||||
|
||||
mkAdN = overload {
|
||||
mkAdN : CAdv -> AdN = SyntaxNor.mkAdN ;
|
||||
mkAdN : Str -> AdN = P.mkAdN ;
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
22
src/api/TrySco.gf
Normal file
22
src/api/TrySco.gf
Normal file
@@ -0,0 +1,22 @@
|
||||
--# -path=.:../english:../common:../abstract:../prelude
|
||||
|
||||
resource TrySco = SyntaxSco-[mkAdN], LexiconSco, ParadigmsSco - [mkAdv,mkAdN,mkOrd,mkQuant,mkVoc] **
|
||||
open (P = ParadigmsEng) in {
|
||||
|
||||
oper
|
||||
|
||||
mkAdv = overload SyntaxSco {
|
||||
mkAdv : Str -> Adv = P.mkAdv ;
|
||||
} ;
|
||||
|
||||
mkAdN = overload {
|
||||
mkAdN : CAdv -> AdN = SyntaxSco.mkAdN ;
|
||||
mkAdN : Str -> AdN = P.mkAdN ;
|
||||
} ;
|
||||
|
||||
mkOrd = overload SyntaxSco {
|
||||
mkOrd : Str -> Ord = P.mkOrd ;
|
||||
} ;
|
||||
|
||||
|
||||
}
|
||||
@@ -54,7 +54,7 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in {
|
||||
Card = ResAra.NumOrdCard ;
|
||||
Predet = ResAra.Predet ;
|
||||
|
||||
Det = ResAra.Det ;
|
||||
DAP, Det = ResAra.Det ;
|
||||
-- {s : Species => Gender => Case => Str ;
|
||||
-- d : State; n : Size; isNum : Bool } ;
|
||||
Quant = ResAra.Quant ;
|
||||
@@ -67,6 +67,8 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in {
|
||||
n : Size } ;
|
||||
Digits = {s : Str;
|
||||
n : Size};
|
||||
Decimal = {s : Str;
|
||||
n : Size; hasDot : Bool};
|
||||
|
||||
-- Structural
|
||||
|
||||
@@ -90,7 +92,8 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in {
|
||||
N = ResAra.Noun ;
|
||||
N2 = ResAra.Noun2 ;
|
||||
N3 = ResAra.Noun3 ;
|
||||
PN = {s : Case => Str; g : Gender; h : Species} ;
|
||||
GN, SN, PN = {s : Case => Str; g : Gender; h : Species} ;
|
||||
LN = ResAra.NP ;
|
||||
|
||||
linref
|
||||
|
||||
|
||||
@@ -31,15 +31,15 @@ lin
|
||||
|
||||
monthAdv january =
|
||||
let january_CN : CN = mkCN month_Timeunit (mkNP (mkPN january)) ;
|
||||
january_NP : NP = R.emptyNP **
|
||||
january_NP : NP = lin NP R.emptyNP **
|
||||
{s = \\c => R.cn2str january_CN R.Sg R.Const c ;
|
||||
a = {pgn = R.Per3 january_CN.g R.Sg ; isPron = False}} ;
|
||||
in SyntaxAra.mkAdv R.biPrep january_NP ;
|
||||
in SyntaxAra.mkAdv ParadigmsAra.biPrep january_NP ;
|
||||
|
||||
yearAdv y = SyntaxAra.mkAdv in_Prep y ;
|
||||
|
||||
-- dummy
|
||||
dayMonthAdv d m = SyntaxAra.mkAdv on_Prep (mkNP d) ; -- on 17 May
|
||||
dayMonthAdv d m = SyntaxAra.mkAdv on_Prep (mkNP m) ; -- on 17 May
|
||||
monthYearAdv m y = SyntaxAra.mkAdv on_Prep (mkNP m) ; -- in May 2012
|
||||
dayMonthYearAdv d m y = SyntaxAra.mkAdv on_Prep y ; -- on 17 May 2013
|
||||
|
||||
@@ -51,7 +51,7 @@ lin
|
||||
let ap = mkAP a in ap ** {
|
||||
s = \\s,g,n,d,c =>
|
||||
ap.s ! s ! g ! n ! d ! c
|
||||
++ (mkAdv R.biPrep (mkNP amount_N)).s
|
||||
++ (mkAdv ParadigmsAra.biPrep (mkNP amount_N)).s
|
||||
++ (mkNP card cn).s ! R.Bare ---- ? /IL
|
||||
} ;
|
||||
|
||||
@@ -60,26 +60,26 @@ oper
|
||||
amount_N : N = mkN "مِقْدَار" "مَقَادِير" masc nohum ;
|
||||
|
||||
-- hack used in the name constructions
|
||||
toNP : Bool -> NP -> NP = \b -> if_then_else NP b R.emptyNP ;
|
||||
toNP : Bool -> NP -> NP = \b -> if_then_else NP b (lin NP R.emptyNP) ;
|
||||
|
||||
lin
|
||||
-- : NP -> NP -> Cl
|
||||
have_name_Cl np nm =
|
||||
let subjPron : Pron = R.np2pron np ;
|
||||
let subjPron : Pron = lin Pron (R.np2pron np) ;
|
||||
me : NP = toNP np.a.isPron np ;
|
||||
myName : NP = E.ApposNP me (mkNP (mkDet subjPron) L.name_N) ;
|
||||
in mkCl myName nm ;
|
||||
|
||||
-- : NP -> QCl
|
||||
what_name_QCl np =
|
||||
let subjPron : Pron = R.np2pron np ;
|
||||
let subjPron : Pron = lin Pron (R.np2pron np) ;
|
||||
me : R.NP = toNP np.a.isPron np ;
|
||||
myName : NP = E.ApposNP me (mkNP (mkDet subjPron) L.name_N) ;
|
||||
what_IP : R.IP = R.mkIP "مَا هُوَ" R.Sg ;
|
||||
what_IP : IP = lin IP (R.mkIP "مَا هُوَ" R.Sg) ;
|
||||
in mkQCl what_IP myName ;
|
||||
|
||||
how_old_QCl np =
|
||||
let subjPron : Pron = R.np2pron np ;
|
||||
let subjPron : Pron = lin Pron (R.np2pron np) ;
|
||||
me : R.NP = toNP np.a.isPron np ;
|
||||
age_N = mkN "عُمر" ;
|
||||
myAge : NP = E.ApposNP me (mkNP (mkDet subjPron) L.name_N) ;
|
||||
|
||||
270
src/arabic/DocumentationAra.gf
Normal file
270
src/arabic/DocumentationAra.gf
Normal file
@@ -0,0 +1,270 @@
|
||||
--# -path=.:../abstract:../common
|
||||
|
||||
-- documenting Arabic inflection
|
||||
---- so far with English titles and tags, AR 2024-01-31
|
||||
|
||||
concrete DocumentationAra of Documentation = CatAra ** open
|
||||
ResAra,
|
||||
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 = "n" ;
|
||||
s1 = heading1 ("Noun" ++ case noun.g of {
|
||||
Masc => "(masculine)";
|
||||
Fem => "(feminine)"
|
||||
}) ;
|
||||
s2 = frameTable (
|
||||
tr (th "" ++ th "nominative" ++ th "genitive" ++ th "accusative") ++
|
||||
tr (th "singular" ++ td (noun.s ! Sg ! Indef ! Nom) ++ td (noun.s ! Sg ! Indef ! Gen) ++
|
||||
td (noun.s ! Sg ! Indef ! Acc)) ++
|
||||
tr (th "dual" ++ td (noun.s ! Dl ! Indef ! Nom) ++ td (noun.s ! Dl ! Indef ! Gen) ++
|
||||
td (noun.s ! Dl ! Indef ! Acc)) ++
|
||||
tr (th "plural" ++ td (noun.s ! Pl ! Indef ! Nom) ++ td (noun.s ! Pl ! Indef ! Gen) ++
|
||||
td (noun.s ! Pl ! Indef ! Acc))
|
||||
)
|
||||
} ;
|
||||
|
||||
InflectionPN, InflectionGN, InflectionSN = \pn -> { ---- TODO: special for LN, GN, SN
|
||||
t = "pn" ;
|
||||
s1 = heading1 ("Proper Name" ++
|
||||
case pn.g of {
|
||||
Masc => "(masculine)";
|
||||
Fem => "(feminine)"
|
||||
}) ;
|
||||
s2 = frameTable (
|
||||
tr (th "nominative" ++ th "genitive" ++ th "accusative") ++
|
||||
tr (td (pn.s ! Nom) ++ td (pn.s ! Gen) ++ td (pn.s ! Acc))
|
||||
)
|
||||
} ;
|
||||
|
||||
InflectionA, InflectionA2 = \adj -> {
|
||||
t = "a" ;
|
||||
s1 = heading1 "Adjective" ;
|
||||
s2 = frameTable (
|
||||
tr (th "" ++ th "Nominative" ++ th "Genitive" ++ th "Accusative") ++
|
||||
tr (th "Positive Masculine Singular" ++
|
||||
td (adj.s ! APosit Masc Sg Indef Nom) ++
|
||||
td (adj.s ! APosit Masc Sg Indef Gen) ++
|
||||
td (adj.s ! APosit Masc Sg Indef Acc)
|
||||
) ++
|
||||
tr (th "Positive Masculine Dual" ++
|
||||
td (adj.s ! APosit Masc Dl Indef Nom) ++
|
||||
td (adj.s ! APosit Masc Dl Indef Gen) ++
|
||||
td (adj.s ! APosit Masc Dl Indef Acc)
|
||||
) ++
|
||||
tr (th "Positive Masculine Plural" ++
|
||||
td (adj.s ! APosit Masc Pl Indef Nom) ++
|
||||
td (adj.s ! APosit Masc Pl Indef Gen) ++
|
||||
td (adj.s ! APosit Masc Pl Indef Acc)
|
||||
) ++
|
||||
tr (th "Positive Feminine Singular" ++
|
||||
td (adj.s ! APosit Fem Sg Indef Nom) ++
|
||||
td (adj.s ! APosit Fem Sg Indef Gen) ++
|
||||
td (adj.s ! APosit Fem Sg Indef Acc)
|
||||
) ++
|
||||
tr (th "Positive Feminine Dual" ++
|
||||
td (adj.s ! APosit Fem Dl Indef Nom) ++
|
||||
td (adj.s ! APosit Fem Dl Indef Gen) ++
|
||||
td (adj.s ! APosit Fem Dl Indef Acc)
|
||||
) ++
|
||||
tr (th "Positive Feminine Plural" ++
|
||||
td (adj.s ! APosit Fem Pl Indef Nom) ++
|
||||
td (adj.s ! APosit Fem Pl Indef Gen) ++
|
||||
td (adj.s ! APosit Fem Pl Indef Acc)
|
||||
) ++
|
||||
tr (th "Comparative" ++
|
||||
td (adj.s ! AComp Indef Nom) ++
|
||||
td (adj.s ! AComp Indef Gen) ++
|
||||
td (adj.s ! AComp Indef Acc)
|
||||
)
|
||||
)
|
||||
} ;
|
||||
|
||||
InflectionAdv, InflectionAdV, InflectionAdA, InflectionAdN = \adv -> {
|
||||
t = "adv" ;
|
||||
s1= heading1 "Adverb" ;
|
||||
s2= paragraph (adv.s) ;
|
||||
s3= ""
|
||||
} ;
|
||||
|
||||
InflectionPrep = \prep -> {
|
||||
t = "prep" ;
|
||||
s1= heading1 "Preposition" ;
|
||||
s2= paragraph (prep.s) ;
|
||||
s3= ""
|
||||
} ;
|
||||
|
||||
InflectionV,
|
||||
InflectionV3, InflectionV2A, InflectionV2Q, InflectionV2S, InflectionV2V, InflectionVA, InflectionVQ, InflectionVS, InflectionVV ----
|
||||
= \v -> {
|
||||
t = "v" ;
|
||||
s1= heading1 "Verb" ++
|
||||
paragraph (v.s ! (VPerf Act (Per3 Masc Sg)) ++
|
||||
pp "subject");
|
||||
s2= inflVerb v
|
||||
} ;
|
||||
|
||||
InflectionV2 v = {
|
||||
t = "v" ;
|
||||
s1= heading1 "Verb" ++
|
||||
paragraph (v.s ! (VPerf Act (Per3 Masc Sg)) ++
|
||||
pp "subject" ++
|
||||
pp "object") ;
|
||||
s2= inflVerb v
|
||||
} ;
|
||||
{-
|
||||
InflectionV3 v = {
|
||||
t = "v" ;
|
||||
s1= heading1 "Verb" ++
|
||||
paragraph (pp "subject" ++
|
||||
v.s ! VInf ++ v.p ++
|
||||
v.c2 ++ pp "arg1" ++
|
||||
v.c3 ++ pp "arg2") ;
|
||||
s2= inflVerb v
|
||||
} ;
|
||||
|
||||
InflectionV2V v = {
|
||||
t = "v" ;
|
||||
s1= heading1 "Verb" ++
|
||||
paragraph (pp "subject" ++
|
||||
v.s ! VInf ++ v.p ++
|
||||
v.c2 ++ pp "object" ++
|
||||
v.c3 ++ case v.typ of {
|
||||
VVAux => pp "verb" ;
|
||||
VVInf => "to" ++ pp "verb" ;
|
||||
VVPresPart => pp "verb+ing"
|
||||
}) ;
|
||||
s2= inflVerb v
|
||||
} ;
|
||||
|
||||
InflectionV2S v = {
|
||||
t = "v" ;
|
||||
s1= heading1 "Verb" ++
|
||||
paragraph (pp "subject" ++
|
||||
v.s ! VInf ++ v.p ++
|
||||
v.c2 ++ pp "object" ++
|
||||
"that" ++ pp "sentence") ;
|
||||
s2= inflVerb v
|
||||
} ;
|
||||
|
||||
InflectionV2Q v = {
|
||||
t = "v" ;
|
||||
s1= heading1 "Verb" ++
|
||||
paragraph (pp "subject" ++
|
||||
v.s ! VInf ++ v.p ++
|
||||
pp "question") ;
|
||||
s2= inflVerb v
|
||||
} ;
|
||||
|
||||
InflectionV2A v = {
|
||||
t = "v" ;
|
||||
s1= heading1 "Verb" ++
|
||||
paragraph (pp "subject" ++
|
||||
v.s ! VInf ++ v.p ++
|
||||
v.c2 ++ pp "object" ++
|
||||
pp "adjective") ;
|
||||
s2= inflVerb v
|
||||
} ;
|
||||
|
||||
InflectionVV v = {
|
||||
t = "v" ;
|
||||
s1= heading1 "Verb" ++
|
||||
paragraph (pp "subject" ++
|
||||
v.s ! VVF VInf ++ v.p ++
|
||||
case v.typ of {
|
||||
VVAux => pp "verb" ;
|
||||
VVInf => "to" ++ pp "verb" ;
|
||||
VVPresPart => pp "verb+ing"
|
||||
}) ;
|
||||
s2= frameTable (
|
||||
tr (th "infitive" ++ td (v.s ! VVF VInf)) ++
|
||||
tr (th "present" ++ td (v.s ! VVF VPres ++ " " ++ v.s ! VVPresNeg)) ++
|
||||
tr (th "past" ++ td (v.s ! VVF VPast ++ " " ++ v.s ! VVPastNeg)) ++ --# notpresent
|
||||
tr (th "past part." ++ td (v.s ! VVF VPPart)) ++
|
||||
tr (th "present part." ++ td (v.s ! VVF VPresPart))
|
||||
)
|
||||
} ;
|
||||
|
||||
InflectionVS v = {
|
||||
t = "v" ;
|
||||
s1= heading1 "Verb" ++
|
||||
paragraph (pp "subject" ++
|
||||
v.s ! VInf ++ v.p ++
|
||||
"that" ++ pp "sentence") ;
|
||||
s2= inflVerb v
|
||||
} ;
|
||||
|
||||
InflectionVQ v = {
|
||||
t = "v" ;
|
||||
s1= heading1 "Verb" ++
|
||||
paragraph (pp "subject" ++
|
||||
v.s ! VInf ++ v.p ++
|
||||
pp "question") ;
|
||||
s2= inflVerb v
|
||||
} ;
|
||||
|
||||
InflectionVA v = {
|
||||
t = "v" ;
|
||||
s1= heading1 "Verb" ++
|
||||
paragraph (pp "subject" ++
|
||||
v.s ! VInf ++ v.p ++
|
||||
pp "adjective") ;
|
||||
s2= inflVerb v
|
||||
} ;
|
||||
-}
|
||||
|
||||
oper
|
||||
inflVerb : Verb -> Str = \verb ->
|
||||
frameTable (
|
||||
tr (th "Active" ++ th "Perfect" ++ th "Imperfect Indicative" ++ th "Conjunctive" ++ th "Jussive" ++ th "Imperative") ++
|
||||
inflVerbRow "3 Masculine Singular" (Per3 Masc Sg) verb ++
|
||||
inflVerbRow "3 Feminine Singular" (Per3 Fem Sg) verb ++
|
||||
inflVerbRow "2 Masculine Singular" (Per2 Masc Sg) verb ++
|
||||
inflVerbRow "2 Feminine Singular" (Per2 Fem Sg) verb ++
|
||||
inflVerbRow "1 Singular" (Per1 Sing) verb ++
|
||||
inflVerbRow "3 Masculine Dual" (Per3 Masc Dl) verb ++
|
||||
inflVerbRow "3 Feminine Dual" (Per3 Fem Dl) verb ++
|
||||
inflVerbRow "2 Dual" (Per2 Masc Dl) verb ++
|
||||
inflVerbRow "3 Masculine Plural" (Per3 Masc Pl) verb ++
|
||||
inflVerbRow "3 Feminine Plural" (Per3 Fem Pl) verb ++
|
||||
inflVerbRow "2 Masculine Plural" (Per2 Masc Pl) verb ++
|
||||
inflVerbRow "2 Feminine Plural" (Per2 Fem Pl) verb ++
|
||||
inflVerbRow "1 Plural" (Per1 Plur) verb
|
||||
) ;
|
||||
|
||||
inflVerbRow : (h : Str) -> (pgn : PerGenNum) -> (verb : Verb) -> Str = \h, pgn, verb ->
|
||||
tr (th h ++
|
||||
td (verb.s ! (VPerf Act pgn)) ++
|
||||
td (verb.s ! (VImpf Ind Act pgn)) ++
|
||||
td (verb.s ! (VImpf Cnj Act pgn)) ++
|
||||
td (verb.s ! (VImpf Jus Act pgn)) ++
|
||||
td (imperativeForm pgn verb)
|
||||
) ;
|
||||
|
||||
imperativeForm : PerGenNum -> Verb -> Str = \pgn, verb ->
|
||||
case pgn of {
|
||||
Per2 g n => verb.s ! VImp g n ;
|
||||
_ => "-"
|
||||
} ;
|
||||
|
||||
|
||||
pp : Str -> Str = \s -> "<"+s+">";
|
||||
|
||||
lin
|
||||
NoDefinition t = {s=t.s};
|
||||
MkDefinition t d = {s="<p><b>Definition:</b>"++t.s++d.s++"</p>"};
|
||||
MkDefinitionEx t d e = {s="<p><b>Definition:</b>"++t.s++d.s++"</p><p><b>Example:</b>"++e.s++"</p>"};
|
||||
|
||||
lin
|
||||
MkDocument d i e = {s = i.s1 ++ d.s ++ i.s2 ++ paragraph e.s} ;
|
||||
MkTag i = {s = i.t} ;
|
||||
|
||||
}
|
||||
@@ -6,7 +6,9 @@ concrete ExtendAra of Extend =
|
||||
EmptyRelSlash, PredAPVP,
|
||||
ComplDirectVS, ComplDirectVQ, -- because of Utt
|
||||
VPS, MkVPS, PredVPS, BaseVPS, ConsVPS, ConjVPS,
|
||||
EmbedSSlash, AdjAsNP, GerundNP
|
||||
EmbedSSlash, AdjAsNP, GerundNP,
|
||||
PassVPSlash, ---- bogus implementation, see below
|
||||
CompoundN, UseDAP, UseDAPMasc, UseDAPFem
|
||||
]
|
||||
with (Grammar=GrammarAra)
|
||||
** open
|
||||
@@ -91,4 +93,43 @@ lin
|
||||
s = \\_ => np.s ! Nom ++ vps.s ! np.a.pgn -- first quick version with order always Nominal.
|
||||
} ; -- if necessary, change VPS into {s : PerGenNum => Order => {before,after : Str}}
|
||||
|
||||
|
||||
-- AR 24-02-08
|
||||
PassVPSlash vpslash = vpslash ** {s = \\pgn, vpf => vpslash.s ! pgn ! vpf} ;
|
||||
---- vpf does not have passive forms left,
|
||||
---- so this function is not possible with the current lincat of VP and VPSlash
|
||||
|
||||
---- very unsure about this as well
|
||||
CompoundN a b = b ** {
|
||||
s = \\n, s, c => b.s ! n ! Const ! c ++ a.s ! n ! s ! c ;
|
||||
s2 = \\n, s, c => b.s2 ! n ! Const ! c ++ a.s2 ! n ! s ! c
|
||||
} ;
|
||||
|
||||
lin UseDAP dap = case dap.isEmpty of {
|
||||
True => case <dap.d,dap.n> of { -- if the s field is empty, make up some other determiner
|
||||
<Def,One> => it_Pron ;
|
||||
<Def,_> => they_Pron ;
|
||||
<Indef,One> => emptyNP ** {s = someSg_Det.s ! NoHum ! Masc} ;
|
||||
_ => emptyNP ** {s = somePl_Det.s ! NoHum ! Masc}
|
||||
} ;
|
||||
False => emptyNP ** {s = dap.s ! NoHum ! Masc} } ;
|
||||
|
||||
lin UseDAPMasc dap = case dap.isEmpty of {
|
||||
True => case <dap.d,dap.n> of { -- if the s field is empty, make up some other determiner
|
||||
<Def,One> => it_Pron ;
|
||||
<Def,_> => theyMasc_Pron ;
|
||||
<Indef,One> => emptyNP ** {s = someSg_Det.s ! NoHum ! Masc} ;
|
||||
_ => emptyNP ** {s = somePl_Det.s ! NoHum ! Masc}
|
||||
} ;
|
||||
False => emptyNP ** {s = dap.s ! NoHum ! Masc} } ;
|
||||
|
||||
lin UseDAPFem dap = case dap.isEmpty of {
|
||||
True => case <dap.d,dap.n> of { -- if the s field is empty, make up some other determiner
|
||||
<Def,One> => it_Pron ;
|
||||
<Def,_> => theyFem_Pron ;
|
||||
<Indef,One> => emptyNP ** {s = someSg_Det.s ! NoHum ! Fem} ;
|
||||
_ => emptyNP ** {s = somePl_Det.s ! NoHum ! Fem}
|
||||
} ;
|
||||
False => emptyNP ** {s = dap.s ! NoHum ! Fem} } ;
|
||||
|
||||
}
|
||||
|
||||
@@ -14,7 +14,8 @@ concrete GrammarAra of Grammar =
|
||||
TextX - [Utt],
|
||||
StructuralAra,
|
||||
IdiomAra,
|
||||
TenseX - [Utt]
|
||||
TenseX - [Utt],
|
||||
NamesAra
|
||||
** {
|
||||
|
||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
concrete LangAra of Lang =
|
||||
GrammarAra,
|
||||
LexiconAra,
|
||||
ConstructionAra
|
||||
ConstructionAra,
|
||||
DocumentationAra
|
||||
** {
|
||||
|
||||
flags startcat = Phr ; unlexer = text ; lexer = text ; coding = utf8 ;
|
||||
|
||||
@@ -23,7 +23,7 @@ flags
|
||||
beautiful_A = sndA "جمل" "فَعِيل" ;
|
||||
become_VA = mkVA (v4 "صبح") ;
|
||||
beer_N = sdfN "بير" "فِعلة" Fem NoHum ;
|
||||
beg_V2V = mkV2V (mkVV (v5 "وسل")) noPrep ;
|
||||
beg_V2V = mkV2V (mkVV (v5 "وسل")) ParadigmsAra.noPrep ;
|
||||
big_A = sndA "كبر" "فَعِيل" ;
|
||||
bike_N = sdfN "درج" "فَعّالة" Fem NoHum ;
|
||||
bird_N = brkN "طير" "فَعل" "فُعُول" Masc NoHum;
|
||||
@@ -72,7 +72,7 @@ flags
|
||||
door_N = brkN "بوب" "فاع" "أَفعَال" Masc NoHum ;
|
||||
drink_V2 = dirV2 (regV "شَرِب") ;
|
||||
-- drink_V2 = dirV2 (v1 "شرب" i a) ;
|
||||
easy_A2V = mkA2 (sndA "سهل" "فَعل") liPrep ;
|
||||
easy_A2V = mkA2 (sndA "سهل" "فَعل") ParadigmsAra.liPrep ;
|
||||
eat_V2 = dirV2 (mkV "ءكل" FormI) ;
|
||||
empty_A = sndA "فرغ" "فاعِل" ;
|
||||
enemy_N = brkN "عدو" "فَعُلّ" "أَفعَاء" Masc Hum ;
|
||||
@@ -202,7 +202,7 @@ flags
|
||||
switch8off_V2 = dirV2 (v4 "طفء") ;
|
||||
switch8on_V2 = dirV2 (v4 "شعل") ;
|
||||
table_N = sdfN "طول" "فاعِلة" Fem NoHum ;
|
||||
talk_V3 = mkV3 (v5 "حدث") liPrep (mkPrep "عَن") ;
|
||||
talk_V3 = mkV3 (v5 "حدث") ParadigmsAra.liPrep (mkPrep "عَن") ;
|
||||
teacher_N = sdmN "علم" "مُفَعِّل" Masc Hum ; --mucal~imö
|
||||
teach_V2 = dirV2 (v2 "علم") ;
|
||||
television_N = mkN (sndf "تِلِفِزيُون") Masc NoHum ;
|
||||
|
||||
@@ -70,6 +70,8 @@ oper
|
||||
_ => "لِ"
|
||||
}) Dat ;
|
||||
biPrep : Preposition = mkPrefix "بِ" ;
|
||||
kaPrep : Preposition = mkPrefix "كَ" ;
|
||||
|
||||
accPrep : Preposition = mkPreposition [] Acc ; -- default object case in VP
|
||||
genPrep : Preposition = mkPreposition [] Gen ; -- default object case in N2
|
||||
|
||||
@@ -153,7 +155,8 @@ oper
|
||||
w + "ف" + x + "ع" + y + "ل" + z
|
||||
=> { h = w ; m1 = x; m2 = y; t = z} ;
|
||||
w + "ف" + x + ("ع"|"ل") + y
|
||||
=> { h = w ; m1 = x; m2 = ""; t = y}
|
||||
=> { h = w ; m1 = x; m2 = ""; t = y} ;
|
||||
_ => Predef.error("cannot get FCL pattern from" ++ pat)
|
||||
} ;
|
||||
|
||||
--opers to interdigitize (make words out of roots and patterns:
|
||||
@@ -204,7 +207,8 @@ oper
|
||||
=> mkAssimilated pat (mkRoot3 rS) ;
|
||||
? + ? + _ => mkBilit pat (mkRoot2 rS) ; --2=>
|
||||
_=> error rS ---- AR error "expected 3--6"
|
||||
}
|
||||
} ;
|
||||
_ => Predef.error("cannot get FCL pattern from" ++ pS)
|
||||
};
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
@@ -489,6 +493,28 @@ oper
|
||||
AComp d c => indeclN aHmar ! d ! c
|
||||
};
|
||||
|
||||
-- NTable = Number => State => Case => Str;
|
||||
-- Adj : Type = {s : AForm => Str} ;
|
||||
-- AForm = APosit Gender Number State Case | AComp State Case ;
|
||||
|
||||
ntablesAdj : (masc, fem, comp : NTable) -> Adj = \masc, fem, comp -> {
|
||||
s = table {
|
||||
APosit Masc n d c => masc ! n ! d ! c ;
|
||||
APosit Fem n d c => fem ! n ! d ! c ;
|
||||
AComp d c => comp ! Sg ! d ! c
|
||||
}
|
||||
} ;
|
||||
|
||||
mascFemCompAdj : (kabir, kabira, akbar : Str) -> Adj =
|
||||
\kabir, kabira, akbar ->
|
||||
ntablesAdj (positAdj kabir ! Masc) (positAdj kabir ! Fem) (positAdj akbar ! Masc) ;
|
||||
|
||||
mascFemAdj : (kabir, kabira : Str) -> Adj = \kabir, kabira ->
|
||||
mascFemCompAdj kabir kabira kabir ; ---- comp
|
||||
|
||||
mascAdj : (kabir : Str) -> Adj = \kabir ->
|
||||
mascFemAdj kabir (kabir + "َة") ;
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
18
src/arabic/NamesAra.gf
Normal file
18
src/arabic/NamesAra.gf
Normal file
@@ -0,0 +1,18 @@
|
||||
concrete NamesAra of Names = CatAra ** open ResAra, Prelude, (N=NounAra), (A=AdverbAra), (S=StructuralAra) in {
|
||||
|
||||
lin GivenName, MaleSurname, FemaleSurname, PlSurname = \n -> emptyNP ** {
|
||||
s = n.s ;
|
||||
a = {pgn = Per3 n.g Sg ; isPron = False} ;
|
||||
} ;
|
||||
lin FullName gn sn = emptyNP ** {
|
||||
s = \\c => gn.s ! c ++ sn.s ! c ;
|
||||
a = {pgn = Per3 gn.g Sg ; isPron = False} ;
|
||||
} ;
|
||||
|
||||
lin UseLN ln = ln ;
|
||||
|
||||
lin PlainLN ln = ln ;
|
||||
|
||||
lin InLN n = A.PrepNP S.in_Prep n ; ---- TODO: alternative prepositions
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user