-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapertium-zab.zab.rlx
49 lines (35 loc) · 1.23 KB
/
apertium-zab.zab.rlx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Firstly, we need to define what tags should be considered sentence delimiters. For this example, only full stop is set as delimiter.
DELIMITERS = "<.>" ;
SUBREADINGS = LTR ; # Alternate, left-to-right (main reading on the left)
# We can define sets for common tag clusters
LIST Case = (n s) (n p) ; # A set that matches either a Noun Singular or a Noun Plural
# Parts of speech
# ===============
LIST N = n ;
LIST Pron = prn ;
LIST Prop = np ;
# Subcategories
# =============
LIST IV = iv ;
LIST TV = tv ;
LIST DTV = dtv ;
# Sets
# ====
SET NOMINAL = N | Prop | Pron ;
SECTION
# If there is a singular noun to the right, I cannot be a verb or noun.
REMOVE (n) OR (v) IF (1 (n s)) ;
# If there is a conjunction followed by a certain cohort of the same CASE as me, choose me.
SELECT $$Case IF (1 (cnjcoo) LINK 1C $$Case) ;
# Choose ditransitive if ambiguous and three consecutive nominals
SELECT DTV IF
(0C TV OR DTV)
(0/1 NOMINAL)
(1 NOMINAL)
(2 NOMINAL) ;
# Resources:
# http://visl.sdu.dk/cg3.html
# http://groups.google.com/group/constraint-grammar
# http://kevindonnelly.org.uk/2010/05/constraint-grammar-tutorial/
# https://wiki.apertium.org/wiki/Constraint_Grammar
# https://wiki.apertium.org/wiki/Apertium_and_Constraint_Grammar