-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapertium-ckb.ckb.rlx
45 lines (42 loc) · 1.46 KB
/
apertium-ckb.ckb.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
# Firstly, we need to define what tags should be considered sentence delimiters. For this example, only full stop is set as delimiter.
DELIMITERS = "<.>" ;
# 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
LIST Dem = dem ;
LIST Det = det;
LIST N = n;
LIST Prop = np;
LIST Adj = adj;
LIST Top = top;
LIST Vbhaver = vbhaver;
LIST Px = px1sg px2sg px3sg px1pl px2pl px3pl ;
LIST CS = cnjsub;
LIST CC = cnjcoo;
LIST Pr = pr;
LIST Prs = prs;
LIST Pri = pri;
LIST Imp = imp;
LIST Cop = vbcop;
LIST Eza = ezalos ezaclo;
LIST Prn = prn;
LIST V = vblex vbcop vbhaver;
LIST NOMEN = prn n np ;
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)) ;
SELECT Px IF (0 Px OR Cop) (1 Vbhaver);
SELECT Prs IF (0C Imp OR Prs) (-1 Pri);
SELECT Prs IF (0C Imp OR Prs) (-1 CS);
SELECT Eza IF (0 Eza OR Cop) (1 NOMEN);
SELECT Dem IF (0 N + Dem OR Cop) (-1 Det);
SELECT Cop IF (0 Cop OR Px) (NOT 0* V);
SELECT N IF (0 N OR Adj) (-1 Pr);
REMOVE Eza IF (1 V);
# 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) ;
# 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