-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathguesser.lexc
162 lines (140 loc) · 5.81 KB
/
guesser.lexc
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
! guesser.lexc
!
! Released under the terms of the MIT License
! Copyright (c) 2011-2015 Çağrı Çöltekin <cagri@coltekin.net>
!
! Permission is hereby granted, free of charge, to any person obtaining a
! copy of this software and associated documentation files (the "Software"),
! to deal in the Software without restriction, including without limitation
! the rights to use, copy, modify, merge, publish, distribute, sublicense,
! and/or sell copies of the Software, and to permit persons to whom the
! Software is furnished to do so, subject to the following conditions:
!
! The above copyright notice and this permission notice shall be included in
! all copies or substantial portions of the Software.
!
! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
! IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
! FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
! AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
! LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
! FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
! DEALINGS IN THE SOFTWARE.
!
!
! The aim of this file to define lexical items with minimal/reasonable
! restrictions instead of list of stems. This allows us to guess the
! unknown words based on their morphological properties.
!
! This file defines lexicons for all word classes we use in
! morph.lexc.
!
! The file is PREPROCESSED using C preprocessor before passing to
! lexc compiler to avoid some repetition. The following symbols
! are replaced with corresponding sets of symbols
!
! - TRUC An uppercase character from the Turkish alphabet
! - TRLC A lowercase character from the Turkish alphabet
! - TRXUC TRUC and the letters Q, W, X. These are not officially
! in Turkish alphabet, but occur frequently in
! some terms and foreign (mostly English) origin words
! (and starting to be used often in some Kurdish words or
! names).
! - TRXLC Lowercase version of TRXUC
! - LATUC A wider range of uppercase characters from European
! languages, and languages writen with a Latin-based
! alphabet in general. This is particularly useful
! useful for catching proper names in other languages.
! - LATLC Lowercase version of LATUC.
!
!
!
#include "options.h"
#define TRUC_V E|İ|Ö|Ü|Î|A|I|O|U|Â|Û
#define TRLC_V e|i|ö|ü|î|a|ı|o|u|â|û
#define TRUC_C B|D|C|G|V|Z|J|F|Ğ|L|M|N|R|Y|P|T|Ç|K|F|S|Ş|H
#define TRLC_C b|d|c|g|v|z|j|f|ğ|l|m|n|r|y|p|t|ç|k|f|s|ş|h
#define DIGIT %0|1|2|3|4|5|6|7|8|9
#define TRUC TRUC_V|TRUC_C
#define TRLC TRLC_V|TRLC_C
#define TRXUC TRUC|Q|W|X
#define TRXLC TRLC|q|w|x
#define LATUC A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|À|Á|Â|Ã|Ä|Å|Æ|Ç|È|É|Ê|Ë|Ì|Í|Î|Ï|Ð|Ñ|Ò|Ó|Ô|Õ|Ö|Ø|Ù|Ú|Û|Ü|Ý|Þ|ß|Ĉ|Ć|Ą|Ā|Ă|Ċ|Č|Ď|Đ|Ē|Ĕ|Ė|Ę|Ě|Ĝ|Ğ|Ġ|Ģ|Ĥ|Ħ|Ĩ|Ī|Ĭ|Į|İ|IJ|Ĵ|Ķ|Ĺ|Ļ|Ľ|Ŀ|Ł|Ń|Ņ|Ň|Ŋ|Ō|Ŏ|Ő|Œ|Ŕ|Ŗ|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C|TRLC][TRLC]^{MIN,MAX}> V_AorAr;
<[TRUC|TRLC][TRLC]^{MIN,MAX}> V_CausAr_AorAr;
<[TRUC|TRLC][TRLC]^{MIN,MAX}> V_CausArt_AorAr;
<[TRUC|TRLC][TRLC]^{MIN,MAX}> V_CausAt_AorAr;
<[TRUC|TRLC][TRLC]^{MIN,MAX}> V_CausDir;
<[TRUC|TRLC][TRLC]^{MIN,MAX}> V_CausDir_AorAr;
<[TRUC|TRLC][TRLC]^{MIN,MAX}> V_CausIr_AorAr;
<[TRUC|TRLC][TRLC]^{MIN,MAX}> V_CausIrreg;
<[TRUC|TRLC][TRLC]^{MIN,MAX}> V_CausIrreg_AorAr;
<[TRUC|TRLC][TRLC]^{MIN,MAX}> V_CausIt_AorAr;
<[TRUC|TRLC][TRLC]^{MIN,MAX}> V_Rcp;
<[TRUC|TRLC][TRLC]^{MIN,MAX}> V_Rcp_AorAr;
<[TRUC|TRLC][TRLC]^{MIN,MAX}> V_Rcp_CausDir;
<[TRUC|TRLC][TRLC]^{MIN,MAX}> V_Rcp_CausDir_AorAr;
<[TRUC|TRLC][TRLC]^{MIN,MAX}> V_Rcp_CausIrreg_AorAr;
<[TRUC|TRLC][TRLC]^{MIN,MAX}> V_Rfl;
<[TRUC|TRLC][TRLC]^{MIN,MAX}> V_Rfl_AorAr;
<[TRUC|TRLC][TRLC]^{MIN,MAX}> V_Rfl_CausDir_AorAr;
<[TRUC|TRLC][TRLC]^{MIN,MAX}> V_Rfl_CausIrreg_AorAr;
<[TRUC|TRLC][TRLC]^{MIN,MAX}> V_Rfl_Rcp;
<[TRUC|TRLC][TRLC]^{MIN,MAX}> V_Rfl_Rcp_AorAr;
<[TRUC|TRLC][TRLC]^{MIN,MAX}> V_Rfl_Rcp_CausDir_AorAr;
<[TRUC|TRLC][TRLC]^{MIN,MAX}> V_Rfl_Rcp_CausIrreg;
! LEXICON InterjectionRoot
<[TRUC|TRLC][TRLC]^{MIN,MAX}> Interjection;
! LEXICON OnomRoot
<[TRUC|TRLC][TRLC]^{MIN,MAX}> Onom;
! LEXICON Abbreviation
<[TRUC|TRLC][TRLC]^{1,MAX}> N_unit;
<[TRUC]^{1,MAX}> N_abbr;
<[TRUC|%.]^{1,MAX}> NP_abbr;
!
! Guessing the following is not really necessary since all of these
! are closed-class words.
!
! LEXICON PrnRoot
<\?> Prn;
<\?> DemPrn;
<\?> LocPrn;
<\?> PersPrn;
! LEXICON DetRoot
<\?> Det;
! LEXICON CnjRoot
<\?> CnjCoo;
<\?> CnjAdv;
<\?> CnjSub;
#include "morph.cpp.lexc"