-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapertium-ron-cat.cat-ron.t4x
147 lines (137 loc) · 4.05 KB
/
apertium-ron-cat.cat-ron.t4x
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- nxml -*- -->
<transfer>
<section-def-cats>
<def-cat n="ajust_genere">
<cat-item tags="adj.*"/>
<cat-item tags="det.*"/>
<cat-item tags="predet.*"/>
<cat-item tags="num.*"/>
<cat-item tags="prn.pro.*"/>
</def-cat>
</section-def-cats>
<section-def-attrs>
<def-attr n="a_tipus">
<attr-item tags="adj"/>
<attr-item tags="det.ind"/>
<attr-item tags="predet"/>
<attr-item tags="num"/>
<attr-item tags="prn.pro"/>
</def-attr>
<def-attr n="a_def">
<attr-item tags="def"/>
<attr-item tags="ind"/>
</def-attr>
<def-attr n="a_gen">
<attr-item tags="m"/>
<attr-item tags="f"/>
<attr-item tags="mf"/>
<attr-item tags="mn"/>
<attr-item tags="fn"/>
<attr-item tags="mfn"/>
<attr-item tags="nt"/>
</def-attr>
<def-attr n="a_nbr">
<attr-item tags="sg"/>
<attr-item tags="pl"/>
<attr-item tags="sp"/>
</def-attr>
<def-attr n="a_cas">
<attr-item tags="nom"/>
<attr-item tags="dg"/>
</def-attr>
</section-def-attrs>
<section-rules>
<rule comment="REGLA: ADJ/DET/PREDET/PRNPRO (ajusta el gènere perquè es generin correctament i elimina el determinant per als determinants)">
<pattern>
<pattern-item n="ajust_genere"/>
</pattern>
<action>
<choose>
<when>
<test>
<and>
<or>
<equal>
<clip pos="1" side="tl" part="a_gen"/>
<lit-tag v="m"/>
</equal>
<equal>
<clip pos="1" side="tl" part="a_gen"/>
<lit-tag v="nt"/>
</equal>
</or>
<equal>
<clip pos="1" side="tl" part="a_nbr"/>
<lit-tag v="sg"/>
</equal>
</and>
</test>
<let>
<clip pos="1" side="tl" part="a_gen"/>
<lit-tag v="mn"/>
</let>
</when>
<when>
<test>
<and>
<or>
<equal>
<clip pos="1" side="tl" part="a_gen"/>
<lit-tag v="f"/>
</equal>
<equal>
<clip pos="1" side="tl" part="a_gen"/>
<lit-tag v="nt"/>
</equal>
</or>
<equal>
<clip pos="1" side="tl" part="a_nbr"/>
<lit-tag v="pl"/>
</equal>
</and>
</test>
<let>
<clip pos="1" side="tl" part="a_gen"/>
<lit-tag v="fn"/>
</let>
</when>
</choose>
<choose>
<when>
<test>
<equal>
<clip pos="1" side="tl" part="a_tipus"/>
<lit-tag v="det.ind"/>
</equal>
</test>
<out>
<lu>
<clip pos="1" side="tl" part="lemh"/>
<clip pos="1" side="tl" part="a_tipus"/>
<clip pos="1" side="tl" part="a_gen"/>
<clip pos="1" side="tl" part="a_nbr"/>
<clip pos="1" side="tl" part="a_cas"/>
<clip pos="1" side="tl" part="lemq"/>
</lu>
</out>
</when>
<otherwise>
<out>
<lu>
<clip pos="1" side="tl" part="whole"/>
</lu>
</out>
</otherwise>
</choose>
</action>
</rule>
</section-rules>
</transfer>
<!--
Resources:
https://wiki.apertium.org/wiki/Chunking:_A_full_example
https://wiki.apertium.org/wiki/Chunking
https://wiki.apertium.org/wiki/Apertium_New_Language_Pair_HOWTO#Transfer_rules
https://wiki.apertium.org/wiki/A_long_introduction_to_transfer_rules
https://wiki.apertium.org/wiki/Transfer#Adding_structural_transfer_.28grammar.29_rules
-->