Interset/Tagset/BG/Conll.pm untested

filter: Statementstmt 0.0% 0 / 316 Branchbran 0.0% 0 / 38 Conditioncond 0.0% 0 / 36 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 13 Podpod 0.0% 0 / 7 totaltotal 0.0% 0 / 410 CC 20 SCAR 49.5
CC
20
Cov
0%
encode
272.0
decode
30.0
get_tagset_id
2.0
CRAP 141.4
1 # ABSTRACT: Driver for the Bulgarian tagset of the CoNLL 2006 Shared Task.
2 # (Documentation at http://www.bultreebank.org/TechRep/BTB-TR03.pdf)
3 # Copyright © 2007, 2009, 2011, 2014, 2017 Dan Zeman <zeman@ufal.mff.cuni.cz>
4 # 4.4.2009: numtype and numvalue separated from subpos, new generic numerals
5 # 5.4.2009: advtype separated from subpos
6  
7 package Lingua::Interset::Tagset::BG::Conll;
8 use strict;
9 use warnings;
10 our $VERSION = '3.014';
11  
12 use utf8;
13 use open ':utf8';
14 use namespace::autoclean;
15 use Moose;
16 extends 'Lingua::Interset::Tagset::Conll';
17  
18  
19  
20 has 'atoms' => ( isa => 'HashRef', is => 'ro', builder => '_create_atoms', lazy => 1 );
21  
22  
23  
24 #------------------------------------------------------------------------------
25 # Returns the tagset id that should be set as the value of the 'tagset' feature
26 # during decoding. Every derived class must (re)define this method! The result
27 # should correspond to the last two parts in package name, lowercased.
28 # Specifically, it should be the ISO 639-2 language code, followed by '::' and
29 # a language-specific tagset id. Example: 'cs::multext'.
30 #------------------------------------------------------------------------------
31 sub get_tagset_id
32 {
33 return 'bg::conll';
34 }
35  
36  
37  
38 #------------------------------------------------------------------------------
39 # Creates atomic drivers for surface features.
40 #------------------------------------------------------------------------------
41 sub _create_atoms
42 {
43 my $self = shift;
44 my %atoms;
45 # PART OF SPEECH ####################
46 $atoms{pos} = $self->create_atom
47 (
48 'tagset' => 'bg::conll',
49 'surfeature' => 'pos',
50 'decode_map' =>
51 {
52 # indeclinable foreign noun
53 'N' => ['pos' => 'noun', 'foreign' => 'yes'],
54 # common noun
55 'Nc' => ['pos' => 'noun', 'nountype' => 'com'],
56 # proper noun
57 'Np' => ['pos' => 'noun', 'nountype' => 'prop'],
58 # Nm = typo? (The only example is "lv." ("leva"). There are other abbreviations tagged as Nc. Even "lv." occurs many other times tagged as Nc!)
59 'Nm' => ['pos' => 'noun', 'other' => {'subpos' => 'Nm'}],
60 # H = hybrid between noun and adjective (surnames, names of villages - Ivanov, Ivanovo)
61 # Historically these words are possessive adjectives.
62 # Most word forms in this class can have two meanings:
63 # Ivanov = Ivanov (family name, noun)
64 # Ivanov = Ivan's (possessive adjective)
65 # subpos: H Hf Hm Hn
66 # The second character encodes gender.
67 # If there is no second character, it is plural, which is genderless.
68 # We do not decode the gender/number here, we are waiting for the features.
69 # We have to preserve tags like "H Hm _" where the gender is not in the features.
70 'H' => ['pos' => 'noun|adj', 'nountype' => 'prop', 'poss' => 'yes', 'other' => {'subpos' => 'H'}],
71 'Hm' => ['pos' => 'noun|adj', 'nountype' => 'prop', 'poss' => 'yes', 'other' => {'subpos' => 'Hm'}],
72 'Hf' => ['pos' => 'noun|adj', 'nountype' => 'prop', 'poss' => 'yes', 'other' => {'subpos' => 'Hf'}],
73 'Hn' => ['pos' => 'noun|adj', 'nountype' => 'prop', 'poss' => 'yes', 'other' => {'subpos' => 'Hn'}],
74 # adjective
75 # subpos: A Af Am An
76 # The second character encodes gender.
77 # If there is no second character, it is plural, which is genderless.
78 # We do not decode the gender/number here, we are waiting for the features.
79 # We have to preserve tags like "A Am _" where the gender is not in the features.
80 'A' => ['pos' => 'adj', 'other' => {'subpos' => 'A'}],
81 'Am' => ['pos' => 'adj', 'other' => {'subpos' => 'Am'}],
82 'Af' => ['pos' => 'adj', 'other' => {'subpos' => 'Af'}],
83 'An' => ['pos' => 'adj', 'other' => {'subpos' => 'An'}],
84 # pronoun
85 # subpos: P Pc Pd Pf Pi Pn Pp Pr Ps
86 # P = probably error; the only example is "za_razlika_ot" ("in contrast to")
87 'P' => ['pos' => 'noun|adj|adv', 'prontype' => 'prn'],
88 'Pp' => ['pos' => 'noun', 'prontype' => 'prs'],
89 'Ps' => ['pos' => 'adj', 'prontype' => 'prs', 'poss' => 'yes'],
90 'Pd' => ['pos' => 'noun|adj|adv', 'prontype' => 'dem'],
91 'Pi' => ['pos' => 'noun|adj|adv', 'prontype' => 'int'],
92 'Pr' => ['pos' => 'noun|adj|adv', 'prontype' => 'rel'],
93 'Pc' => ['pos' => 'noun|adj|adv', 'prontype' => 'tot'], # "collective pronoun"
94 'Pf' => ['pos' => 'noun|adj|adv', 'prontype' => 'ind'],
95 'Pn' => ['pos' => 'noun|adj|adv', 'prontype' => 'neg', 'polarity' => 'neg'],
96 # numeral
97 # subpos: Mc Mo Md My
98 # Mc = cardinals
99 'Mc' => ['pos' => 'num', 'numtype' => 'card'],
100 # Mo = ordinals
101 'Mo' => ['pos' => 'adj', 'numtype' => 'ord'],
102 # Md = adverbial numerals
103 # This does not mean that there are no "P Pf ref=q". There are. Examples: "nekolcina", "njakolko".
104 # poveče, malko, mnogo, măničko
105 'Md' => ['pos' => 'num', 'numtype' => 'card', 'prontype' => 'ind', 'other' => {'subpos' => 'Md'}],
106 # My = fuzzy numerals about people
107 # Only two varieties:
108 # M\tMy\t_
109 # M\tMy\tdef=i
110 # This is unlike N\tNc which either has "_" features, or always at least number, mostly also gender, in addition to definiteness.
111 # malcina = few people, mnozina = many people
112 # seems more like a noun (noun phrase) than a numeral
113 'My' => ['pos' => 'noun', 'other' => {'subpos' => 'My'}],
114 # verb
115 # V Vii Vni Vnp Vpi Vpp Vxi Vyp
116 # Vni = non-personal (has 3rd person only) imperfective verb
117 'Vni' => ['pos' => 'verb', 'aspect' => 'imp', 'other' => {'subpos' => 'nonpers'}],
118 # Vnp = non-personal perfective
119 'Vnp' => ['pos' => 'verb', 'aspect' => 'perf', 'other' => {'subpos' => 'nonpers'}],
120 # Vpi = personal imperfective
121 'Vpi' => ['pos' => 'verb', 'aspect' => 'imp', 'other' => {'subpos' => 'pers'}],
122 # Vpp = personal perfective
123 'Vpp' => ['pos' => 'verb', 'aspect' => 'perf', 'other' => {'subpos' => 'pers'}],
124 # Vxi = "săm" imperfective
125 'Vxi' => ['pos' => 'verb', 'verbtype' => 'aux', 'aspect' => 'imp', 'other' => {'subpos' => 'săm'}],
126 # Vyp = "băda" perfective
127 'Vyp' => ['pos' => 'verb', 'verbtype' => 'aux', 'aspect' => 'perf', 'other' => {'subpos' => 'băda'}],
128 # Vii = "bivam" imperfective
129 'Vii' => ['pos' => 'verb', 'verbtype' => 'aux', 'aspect' => 'imp', 'other' => {'subpos' => 'bivam'}],
130 # V ... probably a tagging error
131 'V' => ['pos' => 'verb'],
132 # adverb
133 'D' => ['pos' => 'adv'],
134 # Dm = adverb of manner
135 'Dm' => ['pos' => 'adv', 'advtype' => 'man'],
136 # Dl = adverb of location
137 'Dl' => ['pos' => 'adv', 'advtype' => 'loc'],
138 # Dt = adverb of time
139 'Dt' => ['pos' => 'adv', 'advtype' => 'tim'],
140 # Dq = adverb of quantity or degree
141 'Dq' => ['pos' => 'adv', 'advtype' => 'deg'],
142 # Dd = adverb of modal nature
143 'Dd' => ['pos' => 'adv', 'advtype' => 'mod'],
144 # preposition
145 'R' => ['pos' => 'adp', 'adpostype' => 'prep'],
146 # conjunction
147 # Cc = coordinative conjunction
148 'Cc' => ['pos' => 'conj', 'conjtype' => 'coor'],
149 # Cs = subordinative conjunction
150 'Cs' => ['pos' => 'conj', 'conjtype' => 'sub'],
151 # Cr = repetitive coordinative conjunction
152 # hem ... hem = either ... or
153 'Cr' => ['pos' => 'conj', 'conjtype' => 'coor', 'other' => {'subpos' => 'rep'}],
154 # Cp = single and repetitive coordinative conjunction
155 # i = and
156 'Cp' => ['pos' => 'conj', 'conjtype' => 'coor', 'other' => {'subpos' => 'srep'}],
157 # particle
158 # Ta Te Tg Ti Tm Tn Tv Tx
159 # Ta = affirmative particle
160 # da = yes
161 'Ta' => ['pos' => 'part', 'parttype' => 'res', 'polarity' => 'pos'],
162 # Tn = negative particle
163 # ne = no
164 'Tn' => ['pos' => 'part', 'parttype' => 'res', 'polarity' => 'neg'],
165 # Ti = interrogative particle
166 # li = question particle
167 'Ti' => ['pos' => 'part', 'prontype' => 'int'],
168 # Tx = auxiliary particle
169 # da = to
170 # šte = will
171 'Tx' => ['pos' => 'part', 'verbtype' => 'aux'],
172 # Tm = modal particle
173 # maj = possibly
174 'Tm' => ['pos' => 'part', 'parttype' => 'mod'],
175 # Tv = verbal particle
176 # neka = let
177 'Tv' => ['pos' => 'part', 'parttype' => 'mod', 'other' => {'subpos' => 'verb'}],
178 # Te = emphasis particle
179 # daže = even
180 'Te' => ['pos' => 'part', 'parttype' => 'emp'],
181 # Tg = gradable particle
182 # naj = most
183 'Tg' => ['pos' => 'part', 'degree' => 'sup'],
184 # interjection
185 # mjau = miao
186 # lele = gosh
187 'I' => ['pos' => 'int'],
188 # punctuation
189 'Punct' => ['pos' => 'punc']
190 },
191 'encode_map' =>
192  
193 { 'prontype' => { 'prs' => { 'poss' => { 'yes' => 'Ps',
194 '@' => 'Pp' }},
195 'dem' => 'Pd',
196 'int' => { 'pos' => { 'part' => 'Ti',
197 '@' => 'Pi' }},
198 'rel' => 'Pr',
199 'tot' => 'Pc',
200 'ind' => { 'numtype' => { 'card' => 'Md',
201 '@' => 'Pf' }},
202 'neg' => 'Pn',
203 'prn' => 'P',
204 '@' => { 'pos' => { 'noun' => { 'other/subpos' => { 'My' => 'My',
205 'Nm' => 'Nm',
206 '@' => { 'foreign' => { 'yes' => 'N',
207 '@' => { 'poss' => { 'yes' => { 'number' => { 'sing' => { 'gender' => { 'masc' => 'Hm',
208 'fem' => 'Hf',
209 'neut' => 'Hn',
210 '@' => 'H' }},
211 '@' => 'H' }},
212 '@' => { 'nountype' => { 'prop' => 'Np',
213 '@' => 'Nc' }}}}}}}},
214 'adj' => { 'numtype' => { 'ord' => 'Mo',
215 '@' => { 'other/subpos' => { 'Am' => 'Am',
216 'Af' => 'Af',
217 'An' => 'An',
218 'A' => 'A',
219 '@' => { 'poss' => { 'yes' => { 'number' => { 'sing' => { 'gender' => { 'masc' => 'Hm',
220 'fem' => 'Hf',
221 'neut' => 'Hn',
222 '@' => 'H' }},
223 '@' => 'H' }},
224 '@' => { 'number' => { 'sing' => { 'gender' => { 'masc' => 'Am',
225 'fem' => 'Af',
226 'neut' => 'An',
227 '@' => 'A' }},
228 '@' => 'A' }}}}}}}},
229 'num' => { 'other/subpos' => { 'Md' => 'Md',
230 'My' => 'My',
231 '@' => { 'numtype' => { 'ord' => 'Mo',
232 '@' => 'Mc' }}}},
233 'verb' => { 'aspect' => { 'imp' => { 'other/subpos' => { 'săm' => 'Vxi',
234 'bivam' => 'Vii',
235 'nonpers' => 'Vni',
236 '@' => { 'verbtype' => { 'aux' => 'Vxi',
237 '@' => 'Vpi' }}}},
238 'perf' => { 'other/subpos' => { 'băda' => 'Vyp',
239 'nonpers' => 'Vnp',
240 '@' => { 'verbtype' => { 'aux' => 'Vyp',
241 '@' => 'Vpp' }}}},
242 '@' => 'V' }},
243 'adv' => { 'advtype' => { 'mod' => 'Dd',
244 'deg' => 'Dq',
245 'loc' => 'Dl',
246 'tim' => 'Dt',
247 'man' => 'Dm',
248 '@' => 'D' }},
249 'adp' => 'R',
250 'conj' => { 'conjtype' => { 'sub' => 'Cs',
251 '@' => { 'other/subpos' => { 'rep' => 'Cr',
252 'srep' => 'Cp',
253 '@' => 'Cc' }}}},
254 'part' => { 'parttype' => { 'mod' => { 'other/subpos' => { 'verb' => 'Tv',
255 '@' => 'Tm' }},
256 'emp' => 'Te',
257 '@' => { 'polarity' => { 'pos' => 'Ta',
258 'neg' => 'Tn',
259 '@' => { 'prontype' => { 'int' => 'Ti',
260 '@' => { 'degree' => { 'sup' => 'Tg',
261 '@' => 'Tx' }}}}}}}},
262 'int' => 'I',
263 'punc' => 'Punct' }}}}
264 );
265 # ASPECT ####################
266 $atoms{aspect} = $self->create_simple_atom
267 (
268 'intfeature' => 'aspect',
269 'simple_decode_map' =>
270 {
271 'p' => 'perf'
272 }
273 );
274 # CASE ####################
275 $atoms{case} = $self->create_simple_atom
276 (
277 'intfeature' => 'case',
278 'simple_decode_map' =>
279 {
280 'n' => 'nom',
281 # dp = dative possessive case of pronouns
282 # We encode it as genitive.
283 'dp' => 'gen',
284 'd' => 'dat',
285 'a' => 'acc',
286 'v' => 'voc'
287 }
288 );
289 # CAUSE ####################
290 # Interrogative adverbs of cause: "zašto" = "why".
291 $atoms{cause} = $self->create_atom
292 (
293 'surfeature' => 'cause',
294 'decode_map' =>
295 {
296 'cause' => ['pos' => 'adv', 'prontype' => 'int', 'advtype' => 'cau']
297 },
298 'encode_map' =>
299  
300 { 'advtype' => { 'cau' => 'cause' }}
301 );
302 # DEFINITENESS ####################
303 $atoms{def} = $self->create_atom
304 (
305 'tagset' => 'bg::conll',
306 'surfeature' => 'def',
307 'decode_map' =>
308 {
309 'd' => ['definite' => 'def'],
310 # full definite article of masculines
311 # We cannot use variant = long because it would collide with the form feature of pronouns.
312 'f' => ['definite' => 'def', 'other' => {'definiteness' => 'f'}],
313 # short definite article of masculines
314 # We cannot use variant = short because it would collide with the form feature of pronouns.
315 'h' => ['definite' => 'def', 'other' => {'definiteness' => 'h'}],
316 'i' => ['definite' => 'ind']
317 },
318 'encode_map' =>
319  
320 { 'definite' => { 'def' => { 'other/definiteness' => { 'f' => 'f',
321 'h' => 'h',
322 '@' => 'd' }},
323 'ind' => 'i' }}
324 );
325 # FORM ####################
326 $atoms{form} = $self->create_atom
327 (
328 'surfeature' => 'form',
329 'decode_map' =>
330 {
331 # archaic long form of adjective
332 'ext' => ['style' => 'arch', 'variant' => 'long'],
333 # full form of personal or possessive pronoun
334 'f' => ['variant' => 'long'],
335 # short form (clitic) of personal or possessive pronoun
336 's' => ['variant' => 'short']
337 },
338 'encode_map' =>
339  
340 { 'variant' => { 'long' => { 'style' => { 'arch' => 'ext',
341 '@' => 'f' }},
342 'short' => 's' }}
343 );
344 # GENDER ####################
345 $atoms{gen} = $self->create_simple_atom
346 (
347 'intfeature' => 'gender',
348 'simple_decode_map' =>
349 {
350 'm' => 'masc',
351 'f' => 'fem',
352 'n' => 'neut'
353 }
354 );
355 # TRANSITIVITY ####################
356 $atoms{imtrans} = $self->create_simple_atom
357 (
358 'intfeature' => 'subcat',
359 'simple_decode_map' =>
360 {
361 'i' => 'intr',
362 't' => 'tran'
363 }
364 );
365 # MOOD ####################
366 $atoms{mood} = $self->create_atom
367 (
368 'surfeature' => 'mood',
369 'decode_map' =>
370 {
371 'i' => ['verbform' => 'fin', 'mood' => 'ind'],
372 'z' => ['verbform' => 'fin', 'mood' => 'imp'],
373 'u' => ['verbform' => 'fin', 'mood' => 'sub']
374 },
375 'encode_map' =>
376  
377 { 'mood' => { 'ind' => 'i',
378 'imp' => 'z',
379 'sub' => 'u' }}
380 );
381 # NUMBER ####################
382 $atoms{num} = $self->create_simple_atom
383 (
384 'intfeature' => 'number',
385 'simple_decode_map' =>
386 {
387 's' => 'sing',
388 'p' => 'plur',
389 # t = count form
390 # special ending for plural of inanimate nouns in counted noun phrases
391 # corresponds to the singular genitive ussage in Russian ("tri časa")
392 # we encode it as dual
393 't' => 'dual',
394 # pluralia tantum (nouns that only appear in plural: "The Alps")
395 'pia_tantum' => 'ptan'
396 }
397 );
398 # PAST ####################
399 $atoms{past} = $self->create_simple_atom
400 (
401 'intfeature' => 'tense',
402 'simple_decode_map' =>
403 {
404 'past' => 'past'
405 }
406 );
407 # PERSON ####################
408 $atoms{pers} = $self->create_simple_atom
409 (
410 'intfeature' => 'person',
411 'simple_decode_map' =>
412 {
413 '1' => '1',
414 '2' => '2',
415 '3' => '3'
416 }
417 );
418 # POSSGENDER ####################
419 # This was originally called "gen". We do not like two "gen"s in one tag, so we renamed it at the beginning of decoding.
420 $atoms{possgen} = $self->create_simple_atom
421 (
422 'intfeature' => 'possgender',
423 'simple_decode_map' =>
424 {
425 'm' => 'masc',
426 'f' => 'fem',
427 'n' => 'neut'
428 }
429 );
430 # REFERENT TYPE ####################
431 # Some pronouns are in fact pronominal numerals or adverbs. This feature distinguishes them semantically.
432 $atoms{'ref'} = $self->create_atom
433 (
434 'surfeature' => 'ref',
435 'decode_map' =>
436 {
437 # e = entity
438 'e' => ['pos' => 'noun'],
439 # r = reflexive
440 'r' => ['reflex' => 'yes'],
441 # a = attribute
442 'a' => ['pos' => 'adj'],
443 # p = possessor
444 # not normal possessive pronouns (my, his, our) but relative/indefinite/negative (whose, someone's, nobody's)
445 'p' => ['poss' => 'yes'],
446 # op = one possessor
447 'op' => ['poss' => 'yes', 'possnumber' => 'sing'],
448 # mp = many possessors
449 'mp' => ['poss' => 'yes', 'possnumber' => 'plur'],
450 # q = quantity or degree
451 'q' => ['pos' => 'num'],
452 # l = location
453 'l' => ['pos' => 'adv', 'advtype' => 'loc'],
454 # t = time
455 't' => ['pos' => 'adv', 'advtype' => 'tim'],
456 # m = manner
457 'm' => ['pos' => 'adv', 'advtype' => 'man']
458 },
459 'encode_map' =>
460  
461 { 'reflex' => { 'yes' => 'r',
462 '@' => { 'poss' => { 'yes' => { 'possnumber' => { 'sing' => 'op',
463 'plur' => 'mp',
464 '@' => 'p' }},
465 '@' => { 'pos' => { 'adj|adv|noun' => '',
466 'noun' => 'e',
467 'adj' => 'a',
468 'num' => 'q',
469 'adv' => { 'advtype' => { 'loc' => 'l',
470 'tim' => 't',
471 'man' => 'm' }}}}}}}}
472 );
473 # TENSE ####################
474 $atoms{tense} = $self->create_simple_atom
475 (
476 'intfeature' => 'tense',
477 'simple_decode_map' =>
478 {
479 # present
480 'r' => 'pres',
481 # aorist (past tense that is neither perfect, nor imperfect)
482 'o' => 'aor',
483 # m = imperfect; PROBLEM: verbs classified as perfective occur (although rarely) in the imperfect past tense
484 # Bulgarian has lexical aspect and grammatical aspect.
485 # Lexical aspect is inherent in verb lemma.
486 # Grammatical: imperfect tenses, perfect tenses, and aorist (aspect-neutral).
487 # Main clause: perfective verb with perfect tense or aorist; imperfective with imperfect or aorist.
488 # Relative clause: perfective verb can occur in imperfect tense, and vice versa.
489 # triple specification of aspect:
490 # detailed part of speech = Vpp (verb personal perfective)
491 # aspect = p (perfective)
492 # tense = m (imperfect)
493 'm' => 'imp'
494 }
495 );
496 # TRANSITIVITY ####################
497 $atoms{trans} = $self->create_simple_atom
498 (
499 'intfeature' => 'subcat',
500 'simple_decode_map' =>
501 {
502 'i' => 'intr',
503 't' => 'tran'
504 }
505 );
506 # TYPE OF VERB ####################
507 $atoms{type} = $self->create_simple_atom
508 (
509 'intfeature' => 'verbtype',
510 'simple_decode_map' =>
511 {
512 'aux' => 'aux'
513 }
514 );
515 # VERB FORM ####################
516 $atoms{vform} = $self->create_simple_atom
517 (
518 'intfeature' => 'verbform',
519 'simple_decode_map' =>
520 {
521 # c = participle: izbiran, navăršil, izkazanite, priet, dejstvašt
522 'c' => 'part',
523 # g = gerund: prevărtajki, demonstrirajki, stradajki, pišejki, otčitajki, izključaja
524 # what bultreebank calls gerund is in fact adverbial participle (called present transgressive in Czech)
525 'g' => 'conv'
526 }
527 );
528 # VOICE ####################
529 $atoms{voice} = $self->create_simple_atom
530 (
531 'intfeature' => 'voice',
532 'simple_decode_map' =>
533 {
534 'a' => 'act',
535 'v' => 'pass'
536 }
537 );
538 return \%atoms;
539 }
540  
541  
542  
543 #------------------------------------------------------------------------------
544 # Creates the list of all surface CoNLL features that can appear in the FEATS
545 # column. This list will be used in decode().
546 #------------------------------------------------------------------------------
547 sub _create_features_all
548 {
549 my $self = shift;
550 my @features = ('aspect', 'case', 'cause', 'def', 'form', 'gen', 'imtrans', 'mood', 'num', 'past', 'pers', 'possgen', 'ref', 'tense', 'trans', 'type', 'vform', 'voice');
551 return \@features;
552 }
553  
554  
555  
556 #------------------------------------------------------------------------------
557 # Creates the list of surface CoNLL features that can appear in the FEATS
558 # column with particular parts of speech. This list will be used in encode().
559 #------------------------------------------------------------------------------
560 sub _create_features_pos
561 {
562 my $self = shift;
563 my %features =
564 (
565 '@' => ['type', 'aspect', 'trans', 'vform', 'voice', 'mood', 'tense', 'past', 'ref', 'cause', 'gen', 'pers', 'num', 'case', 'def', 'form', 'possgen'],
566 'P' => ['ref', 'cause', 'form', 'case', 'num', 'pers', 'gen', 'def', 'possgen'],
567 'V' => ['type', 'aspect', 'trans', 'vform', 'voice', 'mood', 'tense', 'past', 'pers', 'num', 'gen', 'def'],
568 'T' => []
569 );
570 return \%features;
571 }
572  
573  
574  
575 #------------------------------------------------------------------------------
576 # Decodes a physical tag (string) and returns the corresponding feature
577 # structure.
578 #------------------------------------------------------------------------------
579 sub decode
580 {
581 my $self = shift;
582 my $tag = shift;
583 my $atoms = $self->atoms();
584 # Three components: coarse-grained pos, fine-grained pos, features
585 # Only features with non-empty values appear in the tag.
586 # example: N\tNC\tgender=neuter|number=sing|case=unmarked|def=indef
587 # This tag set is really a damn masterpiece. The "gen" feature can occur twice
588 # in a tag for possessive pronouns! If that happens, the first occurrence
589 # denotes the gender of the owned, the second one denotes the gender of the
590 # owner. We start with renaming the second to avoid later confusion.
591 $tag =~ s/\|gen=(.\|.*)\|gen=/\|gen=$1\|possgen=/;
592 # Also, if number is plural, there is only one gender but it is the possessor's.
593 $tag =~ s/\|num=p\|(.*)\|gen=/\|num=p\|$1\|possgen=/;
594 # Also, all indefinite pronouns start with def=i and there can (but need not) be another def at the end.
595 $tag =~ s/Pf\tdef=i\|/Pf\t/;
596 my $fs = $self->decode_conll($tag);
597 # Default feature values. Used to improve collaboration with other drivers.
598 if($fs->is_verb())
599 {
600 if($fs->verbform() eq '')
601 {
602 if($fs->person() ne '')
603 {
604 $fs->set_verbform('fin');
605 if($fs->mood() eq '')
606 {
607 $fs->set_mood('ind');
608 }
609 }
610 else
611 {
612 $fs->set_verbform('inf');
613 }
614 }
615 }
616 return $fs;
617 }
618  
619  
620  
621 #------------------------------------------------------------------------------
622 # Takes feature structure and returns the corresponding physical tag (string).
623 #------------------------------------------------------------------------------
624 sub encode
625 {
626 my $self = shift;
627 my $fs = shift; # Lingua::Interset::FeatureStructure
628 my $atoms = $self->atoms();
629 my $subpos = $atoms->{pos}->encode($fs);
630 my $pos = $subpos eq 'Punct' ? 'Punct' : substr($subpos, 0, 1);
631 my $fpos = $pos;
632 $fpos = '@' unless($fpos =~ m/^[PVT]$/);
633 my $feature_names = $self->get_feature_names($fpos);
634 my @feature_names = @{$feature_names};
635 my @features;
636 # def1
637 # The features of indefinite pronouns (Pf) always begin with "def=i".
638 # Another definiteness can occur at the end, this time not necessarily indefinite!
639 # Examples: edin i i, edinja i h, edinjat i f, ednata i d, nekolcina i i, nešta i i, neštata i d, njakolko i i.
640 # Note that we have to distinguish the indefinite pronouns from the Md numerals.
641 if($pos eq 'P' && $fs->contains('prontype', 'ind'))
642 {
643 push(@features, 'def=i');
644 }
645 foreach my $name (@feature_names)
646 {
647 # aspect
648 # Verbs explicitly specify only perfect aspect as feature (and it is superfluous because part of speech reflects aspect).
649 # The superfluous feature is present only for some subclasses of verbs.
650 if($name eq 'aspect')
651 {
652 if($fs->aspect() ne 'perf' ||
653 $fs->verbtype() ne 'aux' && ($fs->get_other_subfeature('bg::conll', 'subpos') eq 'nonpers' || $fs->subcat() eq ''))
654 {
655 next;
656 }
657 }
658 # transitivity of verbs
659 # The 'imtrans' feature occurs at nonpersonal imperfective verbs.
660 # Otherwise, the feature is called 'trans'.
661 if($name eq 'trans' && $fs->get_other_subfeature('bg::conll', 'subpos') eq 'nonpers' && $fs->aspect() eq 'imp')
662 {
663 $name = 'imtrans';
664 }
665 if(!defined($atoms->{$name}))
666 {
667 confess("Cannot find atom for '$name'");
668 }
669 # Only encode referent type for pronouns.
670 next if($name eq 'ref' && $pos ne 'P');
671 my $value = $atoms->{$name}->encode($fs);
672 if($value ne '')
673 {
674 if($name =~ m/^(cause|past)$/)
675 {
676 push(@features, $name);
677 }
678 elsif($name eq 'ref' && $value ne 'r' && $fs->prontype() eq 'prs' && $fs->person() eq '')
679 {
680 next;
681 }
682 elsif($name eq 'def' && $value eq 'd')
683 {
684 # Masculine definite morpheme can be either full ('f') or short ('s').
685 # Other genders have just one definite value ('d').
686 if($fs->gender() eq 'masc' && $fs->number() eq 'sing')
687 {
688 # We will make the full form default.
689 # Only the 'other' feature can toggle the short form (but then we would not be here because $value would be already 'h').
690 push(@features, 'def=f');
691 }
692 else
693 {
694 push(@features, 'def=d');
695 }
696 }
697 elsif($name eq 'possgen')
698 {
699 # Due to the endless wisdom of the creators of this tag set, the possessor's gender is encoded as a second "gen" at the end of the tag.
700 push(@features, "gen=$value");
701 }
702 else
703 {
704 push(@features, "$name=$value");
705 }
706 }
707 }
708 my $features = '_';
709 if(scalar(@features) > 0)
710 {
711 $features = join('|', @features);
712 }
713 my $tag = "$pos\t$subpos\t$features";
714 return $tag;
715 }
716  
717  
718  
719 #------------------------------------------------------------------------------
720 # Returns reference to list of known tags.
721 # cat bgtrain.conll bgtest.conll |\
722 # perl -pe '@x = split(/\s+/, $_); $_ = "$x[3]\t$x[4]\t$x[5]\n"' |\
723 # sort -u | wc -l
724 # 528 tags; extended manually to 533 tags
725 #------------------------------------------------------------------------------
726 sub list
727 {
728 my $self = shift;
729 my $list = <<end_of_list
730 A\tA\t_
731 A\tAf\t_
732 A\tAf\tgen=f|num=s|def=d
733 A\tAf\tgen=f|num=s|def=i
734 A\tAm\t_
735 A\tAm\tgen=m|num=s|def=f
736 A\tAm\tgen=m|num=s|def=h
737 A\tAm\tgen=m|num=s|def=i
738 A\tAm\tgen=m|num=s|form=ext
739 A\tAn\tgen=n|num=s|def=d
740 A\tAn\tgen=n|num=s|def=i
741 A\tA\tnum=p|def=d
742 A\tA\tnum=p|def=i
743 C\tCc\t_
744 C\tCp\t_
745 C\tCr\t_
746 C\tCs\t_
747 D\tD\t_
748 D\tDd\t_
749 D\tDl\t_
750 D\tDm\t_
751 D\tDq\t_
752 D\tDt\t_
753 H\tHf\tgen=f|num=s|def=i
754 H\tHm\tgen=m|num=s|def=f
755 H\tHm\tgen=m|num=s|def=i
756 H\tHn\tgen=n|num=s|def=i
757 H\tH\tnum=p|def=i
758 I\tI\t_
759 M\tMc\t_
760 M\tMc\tdef=d
761 M\tMc\tdef=i
762 M\tMc\tgen=f|def=d
763 M\tMc\tgen=f|def=i
764 M\tMc\tgen=f|num=s|def=d
765 M\tMc\tgen=f|num=s|def=i
766 M\tMc\tgen=m|def=d
767 M\tMc\tgen=m|def=i
768 M\tMc\tgen=m|num=s|def=f
769 M\tMc\tgen=m|num=s|def=i
770 M\tMc\tgen=n|def=d
771 M\tMc\tgen=n|def=i
772 M\tMc\tgen=n|num=s|def=d
773 M\tMc\tgen=n|num=s|def=i
774 M\tMd\t_
775 M\tMd\tdef=d
776 M\tMd\tdef=i
777 M\tMo\tgen=f|num=s|def=d
778 M\tMo\tgen=f|num=s|def=i
779 M\tMo\tgen=m|num=s|def=f
780 M\tMo\tgen=m|num=s|def=h
781 M\tMo\tgen=m|num=s|def=i
782 M\tMo\tgen=n|num=s|def=d
783 M\tMo\tgen=n|num=s|def=i
784 M\tMo\tnum=p|def=d
785 M\tMo\tnum=p|def=i
786 M\tMy\t_
787 M\tMy\tdef=i
788 N\tN\t_
789 N\tNc\t_
790 N\tNc\tdef=i
791 N\tNc\tgen=f|num=p|def=d
792 N\tNc\tgen=f|num=p|def=i
793 N\tNc\tgen=f|num=s|case=v
794 N\tNc\tgen=f|num=s|def=d
795 N\tNc\tgen=m|num=p|def=d
796 N\tNc\tgen=m|num=p|def=i
797 N\tNc\tgen=m|num=s|case=v
798 N\tNc\tgen=m|num=s|def=f
799 N\tNc\tgen=m|num=s|def=h
800 N\tNc\tgen=m|num=s|def=i
801 N\tNc\tgen=m|num=t
802 N\tNc\tgen=n|num=p|def=d
803 N\tNc\tgen=n|num=p|def=i
804 N\tNc\tgen=n|num=s|def=d
805 N\tNc\tgen=n|num=s|def=i
806 N\tNc\tnum=pia_tantum|def=d
807 N\tNc\tnum=pia_tantum|def=i
808 N\tNm\t_
809 N\tNp\t_
810 N\tNp\tgen=f|num=p|def=d
811 N\tNp\tgen=f|num=p|def=i
812 N\tNp\tgen=f|num=s|case=v
813 N\tNp\tgen=f|num=s|def=i
814 N\tNp\tgen=m|num=p|def=d
815 N\tNp\tgen=m|num=p|def=i
816 N\tNp\tgen=m|num=s|case=a
817 N\tNp\tgen=m|num=s|case=v
818 N\tNp\tgen=m|num=s|def=f
819 N\tNp\tgen=m|num=s|def=h
820 N\tNp\tgen=m|num=s|def=i
821 N\tNp\tgen=n|num=p|def=d
822 N\tNp\tgen=n|num=p|def=i
823 N\tNp\tgen=n|num=s|def=d
824 N\tNp\tgen=n|num=s|def=i
825 N\tNp\tnum=pia_tantum|def=i
826 P\tP\t_
827 P\tPc\tref=a|num=p
828 P\tPc\tref=a|num=s|gen=f
829 P\tPc\tref=a|num=s|gen=m
830 P\tPc\tref=a|num=s|gen=n
831 P\tPc\tref=e|case=a|num=s|gen=m
832 P\tPc\tref=e|case=n|num=p
833 P\tPc\tref=e|case=n|num=s|gen=f
834 P\tPc\tref=e|case=n|num=s|gen=m
835 P\tPc\tref=e|case=n|num=s|gen=n
836 P\tPc\tref=l
837 P\tPc\tref=q|num=p|def=d
838 P\tPc\tref=q|num=s|gen=n|def=d
839 P\tPc\tref=t
840 P\tPd\t_
841 P\tPd\tref=a|num=p
842 P\tPd\tref=a|num=s|gen=f
843 P\tPd\tref=a|num=s|gen=n
844 P\tPd\tref=e|case=n|num=p
845 P\tPd\tref=e|case=n|num=s|gen=f
846 P\tPd\tref=e|case=n|num=s|gen=m
847 P\tPd\tref=e|case=n|num=s|gen=n
848 P\tPd\tref=l
849 P\tPd\tref=m
850 P\tPd\tref=q
851 P\tPd\tref=t
852 P\tPf\tdef=i|ref=a|num=p
853 P\tPf\tdef=i|ref=a|num=s|gen=f
854 P\tPf\tdef=i|ref=a|num=s|gen=m
855 P\tPf\tdef=i|ref=a|num=s|gen=n
856 P\tPf\tdef=i|ref=e|case=a|num=s|gen=m
857 P\tPf\tdef=i|ref=e|case=d|num=s|gen=m
858 P\tPf\tdef=i|ref=e|case=n|num=p
859 P\tPf\tdef=i|ref=e|case=n|num=p|def=d
860 P\tPf\tdef=i|ref=e|case=n|num=p|def=i
861 P\tPf\tdef=i|ref=e|case=n|num=s|gen=f
862 P\tPf\tdef=i|ref=e|case=n|num=s|gen=f|def=d
863 P\tPf\tdef=i|ref=e|case=n|num=s|gen=f|def=i
864 P\tPf\tdef=i|ref=e|case=n|num=s|gen=m
865 P\tPf\tdef=i|ref=e|case=n|num=s|gen=m|def=f
866 P\tPf\tdef=i|ref=e|case=n|num=s|gen=m|def=h
867 P\tPf\tdef=i|ref=e|case=n|num=s|gen=m|def=i
868 P\tPf\tdef=i|ref=e|case=n|num=s|gen=n
869 P\tPf\tdef=i|ref=e|case=n|num=s|gen=n|def=d
870 P\tPf\tdef=i|ref=e|case=n|num=s|gen=n|def=i
871 P\tPf\tdef=i|ref=l
872 P\tPf\tdef=i|ref=m
873 P\tPf\tdef=i|ref=p|num=p
874 P\tPf\tdef=i|ref=q|def=i
875 P\tPf\tdef=i|ref=t
876 P\tPi\tcause
877 P\tPi\tref=a|num=p
878 P\tPi\tref=a|num=s|gen=f
879 P\tPi\tref=a|num=s|gen=m
880 P\tPi\tref=a|num=s|gen=n
881 P\tPi\tref=e|case=a|num=s|gen=m
882 P\tPi\tref=e|case=n|num=p
883 P\tPi\tref=e|case=n|num=s|gen=f
884 P\tPi\tref=e|case=n|num=s|gen=m
885 P\tPi\tref=e|case=n|num=s|gen=n
886 P\tPi\tref=l
887 P\tPi\tref=m
888 P\tPi\tref=p|num=s|gen=f
889 P\tPi\tref=p|num=s|gen=m
890 P\tPi\tref=q
891 P\tPi\tref=t
892 P\tPn\t_
893 P\tPn\tref=a|num=p
894 P\tPn\tref=a|num=s|gen=f
895 P\tPn\tref=a|num=s|gen=m
896 P\tPn\tref=a|num=s|gen=n
897 P\tPn\tref=e|case=a|num=s|gen=m
898 P\tPn\tref=e|case=d|num=s|gen=m
899 P\tPn\tref=e|case=n|num=s|gen=f
900 P\tPn\tref=e|case=n|num=s|gen=m
901 P\tPn\tref=e|case=n|num=s|gen=n
902 P\tPn\tref=e|case=n|num=s|gen=n|def=d
903 P\tPn\tref=l
904 P\tPn\tref=m
905 P\tPn\tref=p|num=s|gen=f
906 P\tPn\tref=t
907 P\tPp\t_
908 P\tPp\tref=e|case=n|num=p|pers=1
909 P\tPp\tref=e|case=n|num=p|pers=2
910 P\tPp\tref=e|case=n|num=p|pers=3
911 P\tPp\tref=e|case=n|num=s|pers=1
912 P\tPp\tref=e|case=n|num=s|pers=2
913 P\tPp\tref=e|case=n|num=s|pers=3|gen=f
914 P\tPp\tref=e|case=n|num=s|pers=3|gen=m
915 P\tPp\tref=e|case=n|num=s|pers=3|gen=n
916 P\tPp\tref=e|form=f|case=a|num=p|pers=1
917 P\tPp\tref=e|form=f|case=a|num=p|pers=2
918 P\tPp\tref=e|form=f|case=a|num=p|pers=3
919 P\tPp\tref=e|form=f|case=a|num=s|pers=1
920 P\tPp\tref=e|form=f|case=a|num=s|pers=2
921 P\tPp\tref=e|form=f|case=a|num=s|pers=3|gen=f
922 P\tPp\tref=e|form=f|case=a|num=s|pers=3|gen=m
923 P\tPp\tref=e|form=f|case=a|num=s|pers=3|gen=n
924 P\tPp\tref=e|form=f|case=d|num=p|pers=1
925 P\tPp\tref=e|form=f|case=d|num=s|pers=1
926 P\tPp\tref=e|form=f|case=d|num=s|pers=2
927 P\tPp\tref=e|form=f|case=d|num=s|pers=3|gen=m
928 P\tPp\tref=e|form=s|case=a|num=p|pers=1
929 P\tPp\tref=e|form=s|case=a|num=p|pers=2
930 P\tPp\tref=e|form=s|case=a|num=p|pers=3
931 P\tPp\tref=e|form=s|case=a|num=s|pers=1
932 P\tPp\tref=e|form=s|case=a|num=s|pers=2
933 P\tPp\tref=e|form=s|case=a|num=s|pers=3|gen=f
934 P\tPp\tref=e|form=s|case=a|num=s|pers=3|gen=m
935 P\tPp\tref=e|form=s|case=a|num=s|pers=3|gen=n
936 P\tPp\tref=e|form=s|case=d|num=p|pers=1
937 P\tPp\tref=e|form=s|case=d|num=p|pers=2
938 P\tPp\tref=e|form=s|case=d|num=p|pers=3
939 P\tPp\tref=e|form=s|case=d|num=s|pers=1
940 P\tPp\tref=e|form=s|case=d|num=s|pers=2
941 P\tPp\tref=e|form=s|case=d|num=s|pers=3|gen=f
942 P\tPp\tref=e|form=s|case=d|num=s|pers=3|gen=m
943 P\tPp\tref=e|form=s|case=d|num=s|pers=3|gen=n
944 P\tPp\tref=e|form=s|case=dp|num=p|pers=1
945 P\tPp\tref=e|form=s|case=dp|num=p|pers=2
946 P\tPp\tref=e|form=s|case=dp|num=p|pers=3
947 P\tPp\tref=e|form=s|case=dp|num=s|pers=1
948 P\tPp\tref=e|form=s|case=dp|num=s|pers=2
949 P\tPp\tref=e|form=s|case=dp|num=s|pers=3|gen=f
950 P\tPp\tref=e|form=s|case=dp|num=s|pers=3|gen=m
951 P\tPp\tref=r|form=f|case=a
952 P\tPp\tref=r|form=s|case=a
953 P\tPp\tref=r|form=s|case=d
954 P\tPp\tref=r|form=s|case=dp
955 P\tPr\t_
956 P\tPr\tref=a|num=p
957 P\tPr\tref=a|num=s|gen=f
958 P\tPr\tref=a|num=s|gen=m
959 P\tPr\tref=a|num=s|gen=n
960 P\tPr\tref=e|case=a|num=s|gen=m
961 P\tPr\tref=e|case=d|num=s|gen=m
962 P\tPr\tref=e|case=n|num=p
963 P\tPr\tref=e|case=n|num=s|gen=f
964 P\tPr\tref=e|case=n|num=s|gen=m
965 P\tPr\tref=e|case=n|num=s|gen=n
966 P\tPr\tref=e|num=s
967 P\tPr\tref=l
968 P\tPr\tref=m
969 P\tPr\tref=p|num=p
970 P\tPr\tref=p|num=s|gen=f
971 P\tPr\tref=p|num=s|gen=m
972 P\tPr\tref=p|num=s|gen=n
973 P\tPr\tref=q
974 P\tPr\tref=t
975 P\tPs\t_
976 P\tPs\tref=mp|form=f|num=p|pers=1|def=d
977 P\tPs\tref=mp|form=f|num=p|pers=1|def=i
978 P\tPs\tref=mp|form=f|num=p|pers=2|def=d
979 P\tPs\tref=mp|form=f|num=p|pers=3|def=d
980 P\tPs\tref=mp|form=f|num=p|pers=3|def=i
981 P\tPs\tref=mp|form=f|num=s|pers=1|gen=f|def=d
982 P\tPs\tref=mp|form=f|num=s|pers=1|gen=f|def=i
983 P\tPs\tref=mp|form=f|num=s|pers=1|gen=m|def=f
984 P\tPs\tref=mp|form=f|num=s|pers=1|gen=m|def=h
985 P\tPs\tref=mp|form=f|num=s|pers=1|gen=m|def=i
986 P\tPs\tref=mp|form=f|num=s|pers=1|gen=n|def=d
987 P\tPs\tref=mp|form=f|num=s|pers=1|gen=n|def=i
988 P\tPs\tref=mp|form=f|num=s|pers=2|gen=f|def=d
989 P\tPs\tref=mp|form=f|num=s|pers=2|gen=f|def=i
990 P\tPs\tref=mp|form=f|num=s|pers=2|gen=m|def=f
991 P\tPs\tref=mp|form=f|num=s|pers=2|gen=m|def=h
992 P\tPs\tref=mp|form=f|num=s|pers=2|gen=m|def=i
993 P\tPs\tref=mp|form=f|num=s|pers=2|gen=n|def=d
994 P\tPs\tref=mp|form=f|num=s|pers=2|gen=n|def=i
995 P\tPs\tref=mp|form=f|num=s|pers=3|gen=f|def=d
996 P\tPs\tref=mp|form=f|num=s|pers=3|gen=f|def=i
997 P\tPs\tref=mp|form=f|num=s|pers=3|gen=m|def=f
998 P\tPs\tref=mp|form=f|num=s|pers=3|gen=m|def=h
999 P\tPs\tref=mp|form=f|num=s|pers=3|gen=m|def=i
1000 P\tPs\tref=mp|form=f|num=s|pers=3|gen=n|def=d
1001 P\tPs\tref=mp|form=f|num=s|pers=3|gen=n|def=i
1002 P\tPs\tref=mp|form=s|pers=1
1003 P\tPs\tref=mp|form=s|pers=2
1004 P\tPs\tref=mp|form=s|pers=3
1005 P\tPs\tref=op|form=f|num=p|pers=1|def=d
1006 P\tPs\tref=op|form=f|num=p|pers=1|def=i
1007 P\tPs\tref=op|form=f|num=p|pers=2|def=d
1008 P\tPs\tref=op|form=f|num=p|pers=3|def=d|gen=f
1009 P\tPs\tref=op|form=f|num=p|pers=3|def=d|gen=m
1010 P\tPs\tref=op|form=f|num=p|pers=3|def=d|gen=n
1011 P\tPs\tref=op|form=f|num=p|pers=3|def=i|gen=f
1012 P\tPs\tref=op|form=f|num=p|pers=3|def=i|gen=m
1013 P\tPs\tref=op|form=f|num=s|pers=1|gen=f|def=d
1014 P\tPs\tref=op|form=f|num=s|pers=1|gen=f|def=i
1015 P\tPs\tref=op|form=f|num=s|pers=1|gen=m|def=f
1016 P\tPs\tref=op|form=f|num=s|pers=1|gen=m|def=h
1017 P\tPs\tref=op|form=f|num=s|pers=1|gen=m|def=i
1018 P\tPs\tref=op|form=f|num=s|pers=1|gen=n|def=d
1019 P\tPs\tref=op|form=f|num=s|pers=1|gen=n|def=i
1020 P\tPs\tref=op|form=f|num=s|pers=2|gen=f|def=d
1021 P\tPs\tref=op|form=f|num=s|pers=2|gen=f|def=i
1022 P\tPs\tref=op|form=f|num=s|pers=2|gen=n|def=i
1023 P\tPs\tref=op|form=f|num=s|pers=3|gen=f|def=d|gen=f
1024 P\tPs\tref=op|form=f|num=s|pers=3|gen=f|def=d|gen=m
1025 P\tPs\tref=op|form=f|num=s|pers=3|gen=f|def=d|gen=n
1026 P\tPs\tref=op|form=f|num=s|pers=3|gen=f|def=i|gen=f
1027 P\tPs\tref=op|form=f|num=s|pers=3|gen=f|def=i|gen=m
1028 P\tPs\tref=op|form=f|num=s|pers=3|gen=m|def=f|gen=f
1029 P\tPs\tref=op|form=f|num=s|pers=3|gen=m|def=f|gen=m
1030 P\tPs\tref=op|form=f|num=s|pers=3|gen=m|def=h|gen=f
1031 P\tPs\tref=op|form=f|num=s|pers=3|gen=m|def=h|gen=m
1032 P\tPs\tref=op|form=f|num=s|pers=3|gen=m|def=f|gen=n
1033 P\tPs\tref=op|form=f|num=s|pers=3|gen=m|def=h|gen=n
1034 P\tPs\tref=op|form=f|num=s|pers=3|gen=m|def=i|gen=f
1035 P\tPs\tref=op|form=f|num=s|pers=3|gen=m|def=i|gen=m
1036 P\tPs\tref=op|form=f|num=s|pers=3|gen=m|def=i|gen=n
1037 P\tPs\tref=op|form=f|num=s|pers=3|gen=n|def=d|gen=f
1038 P\tPs\tref=op|form=f|num=s|pers=3|gen=n|def=d|gen=m
1039 P\tPs\tref=op|form=f|num=s|pers=3|gen=n|def=d|gen=n
1040 P\tPs\tref=op|form=f|num=s|pers=3|gen=n|def=i|gen=f
1041 P\tPs\tref=op|form=f|num=s|pers=3|gen=n|def=i|gen=m
1042 P\tPs\tref=op|form=f|num=s|pers=3|gen=n|def=i|gen=n
1043 P\tPs\tref=op|form=s|pers=1
1044 P\tPs\tref=op|form=s|pers=2
1045 P\tPs\tref=op|form=s|pers=3|gen=f
1046 P\tPs\tref=op|form=s|pers=3|gen=m
1047 P\tPs\tref=op|form=s|pers=3|gen=n
1048 P\tPs\tref=r|form=f|case=n|num=p|def=d
1049 P\tPs\tref=r|form=f|case=n|num=p|def=i
1050 P\tPs\tref=r|form=f|case=n|num=s|gen=f|def=d
1051 P\tPs\tref=r|form=f|case=n|num=s|gen=m|def=f
1052 P\tPs\tref=r|form=f|case=n|num=s|gen=m|def=h
1053 P\tPs\tref=r|form=f|case=n|num=s|gen=m|def=i
1054 P\tPs\tref=r|form=f|case=n|num=s|gen=n|def=d
1055 P\tPs\tref=r|form=f|case=n|num=s|gen=n|def=i
1056 P\tPs\tref=r|form=s|case=n
1057 Punct\tPunct\t_
1058 R\tR\t_
1059 T\tTa\t_
1060 T\tTe\t_
1061 T\tTg\t_
1062 T\tTi\t_
1063 T\tTm\t_
1064 T\tTn\t_
1065 T\tTv\t_
1066 T\tTx\t_
1067 V\tV\t_
1068 V\tVii\ttype=aux|trans=t|mood=i|tense=r|pers=3|num=p
1069 V\tVii\ttype=aux|trans=t|mood=i|tense=r|pers=3|num=s
1070 V\tVni\timtrans=i|mood=i|tense=m|pers=3|num=s
1071 V\tVni\timtrans=i|mood=i|tense=o|pers=3|num=s
1072 V\tVni\timtrans=i|mood=i|tense=r|pers=3|num=s
1073 V\tVni\timtrans=i|vform=c|voice=a|tense=m|num=s|gen=n|def=i
1074 V\tVni\timtrans=i|vform=c|voice=a|tense=o|num=s|gen=n|def=i
1075 V\tVni\timtrans=t|mood=i|tense=m|pers=3|num=s
1076 V\tVni\timtrans=t|mood=i|tense=o|pers=3|num=s
1077 V\tVni\timtrans=t|mood=i|tense=r|pers=3|num=s
1078 V\tVni\timtrans=t|vform=c|voice=a|tense=m|num=s|gen=n|def=i
1079 V\tVni\timtrans=t|vform=c|voice=a|tense=o|num=s|gen=n|def=i
1080 V\tVnp\ttrans=i|mood=i|tense=o|pers=3|num=s
1081 V\tVnp\ttrans=i|mood=i|tense=r|pers=3|num=s
1082 V\tVnp\ttrans=i|vform=c|voice=a|tense=o|num=s|gen=n|def=i
1083 V\tVnp\ttrans=t|mood=i|tense=m|pers=3|num=s
1084 V\tVnp\ttrans=t|vform=c|voice=a|tense=o|num=s|gen=n|def=i
1085 V\tVpi\t_
1086 V\tVpi\ttrans=i|mood=i|tense=m|pers=1|num=p
1087 V\tVpi\ttrans=i|mood=i|tense=m|pers=1|num=s
1088 V\tVpi\ttrans=i|mood=i|tense=m|pers=2|num=s
1089 V\tVpi\ttrans=i|mood=i|tense=m|pers=3|num=p
1090 V\tVpi\ttrans=i|mood=i|tense=m|pers=3|num=s
1091 V\tVpi\ttrans=i|mood=i|tense=o|pers=1|num=p
1092 V\tVpi\ttrans=i|mood=i|tense=o|pers=1|num=s
1093 V\tVpi\ttrans=i|mood=i|tense=o|pers=3|num=p
1094 V\tVpi\ttrans=i|mood=i|tense=o|pers=3|num=s
1095 V\tVpi\ttrans=i|mood=i|tense=r|pers=1|num=p
1096 V\tVpi\ttrans=i|mood=i|tense=r|pers=1|num=s
1097 V\tVpi\ttrans=i|mood=i|tense=r|pers=2|num=p
1098 V\tVpi\ttrans=i|mood=i|tense=r|pers=2|num=s
1099 V\tVpi\ttrans=i|mood=i|tense=r|pers=3|num=p
1100 V\tVpi\ttrans=i|mood=i|tense=r|pers=3|num=s
1101 V\tVpi\ttrans=i|mood=z|pers=2|num=p
1102 V\tVpi\ttrans=i|mood=z|pers=2|num=s
1103 V\tVpi\ttrans=i|vform=c|voice=a|tense=m|num=p|def=i
1104 V\tVpi\ttrans=i|vform=c|voice=a|tense=m|num=s|gen=f|def=i
1105 V\tVpi\ttrans=i|vform=c|voice=a|tense=m|num=s|gen=m|def=i
1106 V\tVpi\ttrans=i|vform=c|voice=a|tense=m|num=s|gen=n|def=i
1107 V\tVpi\ttrans=i|vform=c|voice=a|tense=o|num=p|def=d
1108 V\tVpi\ttrans=i|vform=c|voice=a|tense=o|num=p|def=i
1109 V\tVpi\ttrans=i|vform=c|voice=a|tense=o|num=s|gen=f|def=i
1110 V\tVpi\ttrans=i|vform=c|voice=a|tense=o|num=s|gen=m|def=f
1111 V\tVpi\ttrans=i|vform=c|voice=a|tense=o|num=s|gen=m|def=i
1112 V\tVpi\ttrans=i|vform=c|voice=a|tense=o|num=s|gen=n|def=i
1113 V\tVpi\ttrans=i|vform=c|voice=a|tense=r|num=p|def=d
1114 V\tVpi\ttrans=i|vform=c|voice=a|tense=r|num=p|def=i
1115 V\tVpi\ttrans=i|vform=c|voice=a|tense=r|num=s|gen=f|def=d
1116 V\tVpi\ttrans=i|vform=c|voice=a|tense=r|num=s|gen=f|def=i
1117 V\tVpi\ttrans=i|vform=c|voice=a|tense=r|num=s|gen=m|def=f
1118 V\tVpi\ttrans=i|vform=c|voice=a|tense=r|num=s|gen=m|def=h
1119 V\tVpi\ttrans=i|vform=c|voice=a|tense=r|num=s|gen=m|def=i
1120 V\tVpi\ttrans=i|vform=c|voice=a|tense=r|num=s|gen=n|def=d
1121 V\tVpi\ttrans=i|vform=c|voice=a|tense=r|num=s|gen=n|def=i
1122 V\tVpi\ttrans=i|vform=g
1123 V\tVpi\ttrans=t|mood=i|tense=m|pers=1|num=p
1124 V\tVpi\ttrans=t|mood=i|tense=m|pers=1|num=s
1125 V\tVpi\ttrans=t|mood=i|tense=m|pers=2|num=p
1126 V\tVpi\ttrans=t|mood=i|tense=m|pers=2|num=s
1127 V\tVpi\ttrans=t|mood=i|tense=m|pers=3|num=p
1128 V\tVpi\ttrans=t|mood=i|tense=m|pers=3|num=s
1129 V\tVpi\ttrans=t|mood=i|tense=o|pers=1|num=p
1130 V\tVpi\ttrans=t|mood=i|tense=o|pers=1|num=s
1131 V\tVpi\ttrans=t|mood=i|tense=o|pers=2|num=p
1132 V\tVpi\ttrans=t|mood=i|tense=o|pers=2|num=s
1133 V\tVpi\ttrans=t|mood=i|tense=o|pers=3|num=p
1134 V\tVpi\ttrans=t|mood=i|tense=o|pers=3|num=s
1135 V\tVpi\ttrans=t|mood=i|tense=r|pers=1|num=p
1136 V\tVpi\ttrans=t|mood=i|tense=r|pers=1|num=s
1137 V\tVpi\ttrans=t|mood=i|tense=r|pers=2|num=p
1138 V\tVpi\ttrans=t|mood=i|tense=r|pers=2|num=s
1139 V\tVpi\ttrans=t|mood=i|tense=r|pers=3|num=p
1140 V\tVpi\ttrans=t|mood=i|tense=r|pers=3|num=s
1141 V\tVpi\ttrans=t|mood=z|pers=2|num=p
1142 V\tVpi\ttrans=t|mood=z|pers=2|num=s
1143 V\tVpi\ttrans=t|vform=c|voice=a|tense=m|num=p|def=i
1144 V\tVpi\ttrans=t|vform=c|voice=a|tense=m|num=s|gen=f|def=i
1145 V\tVpi\ttrans=t|vform=c|voice=a|tense=m|num=s|gen=m|def=i
1146 V\tVpi\ttrans=t|vform=c|voice=a|tense=m|num=s|gen=n|def=i
1147 V\tVpi\ttrans=t|vform=c|voice=a|tense=o|num=p|def=i
1148 V\tVpi\ttrans=t|vform=c|voice=a|tense=o|num=s|gen=f|def=i
1149 V\tVpi\ttrans=t|vform=c|voice=a|tense=o|num=s|gen=m|def=i
1150 V\tVpi\ttrans=t|vform=c|voice=a|tense=o|num=s|gen=n|def=i
1151 V\tVpi\ttrans=t|vform=c|voice=a|tense=r|num=p|def=d
1152 V\tVpi\ttrans=t|vform=c|voice=a|tense=r|num=p|def=i
1153 V\tVpi\ttrans=t|vform=c|voice=a|tense=r|num=s|gen=f|def=d
1154 V\tVpi\ttrans=t|vform=c|voice=a|tense=r|num=s|gen=f|def=i
1155 V\tVpi\ttrans=t|vform=c|voice=a|tense=r|num=s|gen=m|def=f
1156 V\tVpi\ttrans=t|vform=c|voice=a|tense=r|num=s|gen=m|def=h
1157 V\tVpi\ttrans=t|vform=c|voice=a|tense=r|num=s|gen=n|def=d
1158 V\tVpi\ttrans=t|vform=c|voice=a|tense=r|num=s|gen=n|def=i
1159 V\tVpi\ttrans=t|vform=c|voice=v|num=p|def=d
1160 V\tVpi\ttrans=t|vform=c|voice=v|num=p|def=i
1161 V\tVpi\ttrans=t|vform=c|voice=v|num=s|gen=f|def=d
1162 V\tVpi\ttrans=t|vform=c|voice=v|num=s|gen=f|def=i
1163 V\tVpi\ttrans=t|vform=c|voice=v|num=s|gen=m|def=f
1164 V\tVpi\ttrans=t|vform=c|voice=v|num=s|gen=m|def=h
1165 V\tVpi\ttrans=t|vform=c|voice=v|num=s|gen=m|def=i
1166 V\tVpi\ttrans=t|vform=c|voice=v|num=s|gen=n|def=d
1167 V\tVpi\ttrans=t|vform=c|voice=v|num=s|gen=n|def=i
1168 V\tVpi\ttrans=t|vform=g
1169 V\tVpp\t_
1170 V\tVpp\taspect=p|trans=i|mood=i|tense=m|pers=3|num=p
1171 V\tVpp\taspect=p|trans=i|mood=i|tense=m|pers=3|num=s
1172 V\tVpp\taspect=p|trans=i|mood=i|tense=o|pers=1|num=p
1173 V\tVpp\taspect=p|trans=i|mood=i|tense=o|pers=1|num=s
1174 V\tVpp\taspect=p|trans=i|mood=i|tense=o|pers=2|num=p
1175 V\tVpp\taspect=p|trans=i|mood=i|tense=o|pers=2|num=s
1176 V\tVpp\taspect=p|trans=i|mood=i|tense=o|pers=3|num=p
1177 V\tVpp\taspect=p|trans=i|mood=i|tense=o|pers=3|num=s
1178 V\tVpp\taspect=p|trans=i|mood=i|tense=r|pers=1|num=p
1179 V\tVpp\taspect=p|trans=i|mood=i|tense=r|pers=1|num=s
1180 V\tVpp\taspect=p|trans=i|mood=i|tense=r|pers=2|num=p
1181 V\tVpp\taspect=p|trans=i|mood=i|tense=r|pers=2|num=s
1182 V\tVpp\taspect=p|trans=i|mood=i|tense=r|pers=3|num=p
1183 V\tVpp\taspect=p|trans=i|mood=i|tense=r|pers=3|num=s
1184 V\tVpp\taspect=p|trans=i|mood=z|pers=2|num=p
1185 V\tVpp\taspect=p|trans=i|mood=z|pers=2|num=s
1186 V\tVpp\taspect=p|trans=i|vform=c|voice=a|tense=m|num=s|gen=n|def=i
1187 V\tVpp\taspect=p|trans=i|vform=c|voice=a|tense=o|num=p|def=d
1188 V\tVpp\taspect=p|trans=i|vform=c|voice=a|tense=o|num=p|def=i
1189 V\tVpp\taspect=p|trans=i|vform=c|voice=a|tense=o|num=s|gen=f|def=d
1190 V\tVpp\taspect=p|trans=i|vform=c|voice=a|tense=o|num=s|gen=f|def=i
1191 V\tVpp\taspect=p|trans=i|vform=c|voice=a|tense=o|num=s|gen=m|def=f
1192 V\tVpp\taspect=p|trans=i|vform=c|voice=a|tense=o|num=s|gen=m|def=h
1193 V\tVpp\taspect=p|trans=i|vform=c|voice=a|tense=o|num=s|gen=m|def=i
1194 V\tVpp\taspect=p|trans=i|vform=c|voice=a|tense=o|num=s|gen=n|def=d
1195 V\tVpp\taspect=p|trans=i|vform=c|voice=a|tense=o|num=s|gen=n|def=i
1196 V\tVpp\taspect=p|trans=t|mood=i|tense=m|pers=1|num=p
1197 V\tVpp\taspect=p|trans=t|mood=i|tense=m|pers=1|num=s
1198 V\tVpp\taspect=p|trans=t|mood=i|tense=m|pers=3|num=p
1199 V\tVpp\taspect=p|trans=t|mood=i|tense=m|pers=3|num=s
1200 V\tVpp\taspect=p|trans=t|mood=i|tense=o|pers=1|num=p
1201 V\tVpp\taspect=p|trans=t|mood=i|tense=o|pers=1|num=s
1202 V\tVpp\taspect=p|trans=t|mood=i|tense=o|pers=2|num=p
1203 V\tVpp\taspect=p|trans=t|mood=i|tense=o|pers=2|num=s
1204 V\tVpp\taspect=p|trans=t|mood=i|tense=o|pers=3|num=p
1205 V\tVpp\taspect=p|trans=t|mood=i|tense=o|pers=3|num=s
1206 V\tVpp\taspect=p|trans=t|mood=i|tense=r|pers=1|num=p
1207 V\tVpp\taspect=p|trans=t|mood=i|tense=r|pers=1|num=s
1208 V\tVpp\taspect=p|trans=t|mood=i|tense=r|pers=2|num=p
1209 V\tVpp\taspect=p|trans=t|mood=i|tense=r|pers=2|num=s
1210 V\tVpp\taspect=p|trans=t|mood=i|tense=r|pers=3|num=p
1211 V\tVpp\taspect=p|trans=t|mood=i|tense=r|pers=3|num=s
1212 V\tVpp\taspect=p|trans=t|mood=z|pers=2|num=p
1213 V\tVpp\taspect=p|trans=t|mood=z|pers=2|num=s
1214 V\tVpp\taspect=p|trans=t|vform=c|voice=a|tense=m|num=s|gen=m|def=i
1215 V\tVpp\taspect=p|trans=t|vform=c|voice=a|tense=o|num=p|def=d
1216 V\tVpp\taspect=p|trans=t|vform=c|voice=a|tense=o|num=p|def=i
1217 V\tVpp\taspect=p|trans=t|vform=c|voice=a|tense=o|num=s|gen=f|def=d
1218 V\tVpp\taspect=p|trans=t|vform=c|voice=a|tense=o|num=s|gen=f|def=i
1219 V\tVpp\taspect=p|trans=t|vform=c|voice=a|tense=o|num=s|gen=m|def=f
1220 V\tVpp\taspect=p|trans=t|vform=c|voice=a|tense=o|num=s|gen=m|def=h
1221 V\tVpp\taspect=p|trans=t|vform=c|voice=a|tense=o|num=s|gen=m|def=i
1222 V\tVpp\taspect=p|trans=t|vform=c|voice=a|tense=o|num=s|gen=n|def=d
1223 V\tVpp\taspect=p|trans=t|vform=c|voice=a|tense=o|num=s|gen=n|def=i
1224 V\tVpp\taspect=p|trans=t|vform=c|voice=v|num=p|def=d
1225 V\tVpp\taspect=p|trans=t|vform=c|voice=v|num=p|def=i
1226 V\tVpp\taspect=p|trans=t|vform=c|voice=v|num=s|gen=f|def=d
1227 V\tVpp\taspect=p|trans=t|vform=c|voice=v|num=s|gen=f|def=i
1228 V\tVpp\taspect=p|trans=t|vform=c|voice=v|num=s|gen=m|def=f
1229 V\tVpp\taspect=p|trans=t|vform=c|voice=v|num=s|gen=m|def=h
1230 V\tVpp\taspect=p|trans=t|vform=c|voice=v|num=s|gen=m|def=i
1231 V\tVpp\taspect=p|trans=t|vform=c|voice=v|num=s|gen=n|def=d
1232 V\tVpp\taspect=p|trans=t|vform=c|voice=v|num=s|gen=n|def=i
1233 V\tVxi\ttype=aux|trans=t|mood=i|past|pers=1|num=p
1234 V\tVxi\ttype=aux|trans=t|mood=i|past|pers=1|num=s
1235 V\tVxi\ttype=aux|trans=t|mood=i|past|pers=2|num=p
1236 V\tVxi\ttype=aux|trans=t|mood=i|past|pers=2|num=s
1237 V\tVxi\ttype=aux|trans=t|mood=i|past|pers=3|num=p
1238 V\tVxi\ttype=aux|trans=t|mood=i|past|pers=3|num=s
1239 V\tVxi\ttype=aux|trans=t|mood=i|tense=r|pers=1|num=p
1240 V\tVxi\ttype=aux|trans=t|mood=i|tense=r|pers=1|num=s
1241 V\tVxi\ttype=aux|trans=t|mood=i|tense=r|pers=2|num=p
1242 V\tVxi\ttype=aux|trans=t|mood=i|tense=r|pers=2|num=s
1243 V\tVxi\ttype=aux|trans=t|mood=i|tense=r|pers=3|num=p
1244 V\tVxi\ttype=aux|trans=t|mood=i|tense=r|pers=3|num=s
1245 V\tVxi\ttype=aux|trans=t|mood=u|tense=o|pers=1|num=p
1246 V\tVxi\ttype=aux|trans=t|mood=u|tense=o|pers=1|num=s
1247 V\tVxi\ttype=aux|trans=t|mood=u|tense=o|pers=2|num=p
1248 V\tVxi\ttype=aux|trans=t|mood=u|tense=o|pers=2|num=s
1249 V\tVxi\ttype=aux|trans=t|mood=u|tense=o|pers=3|num=p
1250 V\tVxi\ttype=aux|trans=t|mood=u|tense=o|pers=3|num=s
1251 V\tVxi\ttype=aux|trans=t|vform=c|voice=a|past|num=p|def=i
1252 V\tVxi\ttype=aux|trans=t|vform=c|voice=a|past|num=s|gen=f|def=i
1253 V\tVxi\ttype=aux|trans=t|vform=c|voice=a|past|num=s|gen=m|def=i
1254 V\tVxi\ttype=aux|trans=t|vform=c|voice=a|past|num=s|gen=n|def=i
1255 V\tVyp\ttype=aux|aspect=p|trans=t|mood=i|tense=o|pers=3|num=s
1256 V\tVyp\ttype=aux|aspect=p|trans=t|mood=i|tense=r|pers=1|num=p
1257 V\tVyp\ttype=aux|aspect=p|trans=t|mood=i|tense=r|pers=1|num=s
1258 V\tVyp\ttype=aux|aspect=p|trans=t|mood=i|tense=r|pers=2|num=p
1259 V\tVyp\ttype=aux|aspect=p|trans=t|mood=i|tense=r|pers=2|num=s
1260 V\tVyp\ttype=aux|aspect=p|trans=t|mood=i|tense=r|pers=3|num=p
1261 V\tVyp\ttype=aux|aspect=p|trans=t|mood=i|tense=r|pers=3|num=s
1262 V\tVyp\ttype=aux|aspect=p|trans=t|mood=z|pers=2|num=s
1263 end_of_list
1264 ;
1265 # Protect from editors that replace tabs by spaces.
1266 $list =~ s/ \s+/\t/sg;
1267 my @list = split(/\r?\n/, $list);
1268 return \@list;
1269 }
1270  
1271  
1272  
1273 1;
1274  
1275 __END__
1276  
1277 =pod
1278  
1279 =encoding UTF-8
1280  
1281 =head1 NAME
1282  
1283 Lingua::Interset::Tagset::BG::Conll - Driver for the Bulgarian tagset of the CoNLL 2006 Shared Task.
1284  
1285 =head1 VERSION
1286  
1287 version 3.014
1288  
1289 =head1 SYNOPSIS
1290  
1291 use Lingua::Interset::Tagset::BG::Conll;
1292 my $driver = Lingua::Interset::Tagset::BG::Conll->new();
1293 my $fs = $driver->decode("N\tNC\tgender=neuter|number=sing|case=unmarked|def=indef");
1294  
1295 or
1296  
1297 use Lingua::Interset qw(decode);
1298 my $fs = decode('bg::conll', "N\tNC\tgender=neuter|number=sing|case=unmarked|def=indef");
1299  
1300 =head1 DESCRIPTION
1301  
1302 Interset driver for the Bulgarian tagset of the CoNLL 2006 Shared Task.
1303 CoNLL tagsets in Interset are traditionally three values separated by tabs.
1304 The values come from the CoNLL columns CPOS, POS and FEAT. For Bulgarian,
1305 these values are derived from the tagset of the BulTreeBank.
1306  
1307 =head1 SEE ALSO
1308  
1309 L<Lingua::Interset>,
1310 L<Lingua::Interset::Tagset>,
1311 L<Lingua::Interset::Tagset::Conll>,
1312 L<Lingua::Interset::FeatureStructure>
1313  
1314 =head1 AUTHOR
1315  
1316 Dan Zeman <zeman@ufal.mff.cuni.cz>
1317  
1318 =head1 COPYRIGHT AND LICENSE
1319  
1320 This software is copyright (c) 2019 by Univerzita Karlova (Charles University).
1321  
1322 This is free software; you can redistribute it and/or modify it under
1323 the same terms as the Perl 5 programming language system itself.
1324  
1325 =cut