ansible-later/env_27/lib/python2.7/site-packages/snowballstemmer/romanian_stemmer.py

901 lines
30 KiB
Python
Raw Normal View History

2019-04-11 13:56:20 +00:00
# self file was generated automatically by the Snowball to Python interpreter
from .basestemmer import BaseStemmer
from .among import Among
class RomanianStemmer(BaseStemmer):
'''
self class was automatically generated by a Snowball to Python interpreter
It implements the stemming algorithm defined by a snowball script.
'''
serialVersionUID = 1
a_0 = [
Among(u"", -1, 3),
Among(u"I", 0, 1),
Among(u"U", 0, 2)
]
a_1 = [
Among(u"ea", -1, 3),
Among(u"a\u0163ia", -1, 7),
Among(u"aua", -1, 2),
Among(u"iua", -1, 4),
Among(u"a\u0163ie", -1, 7),
Among(u"ele", -1, 3),
Among(u"ile", -1, 5),
Among(u"iile", 6, 4),
Among(u"iei", -1, 4),
Among(u"atei", -1, 6),
Among(u"ii", -1, 4),
Among(u"ului", -1, 1),
Among(u"ul", -1, 1),
Among(u"elor", -1, 3),
Among(u"ilor", -1, 4),
Among(u"iilor", 14, 4)
]
a_2 = [
Among(u"icala", -1, 4),
Among(u"iciva", -1, 4),
Among(u"ativa", -1, 5),
Among(u"itiva", -1, 6),
Among(u"icale", -1, 4),
Among(u"a\u0163iune", -1, 5),
Among(u"i\u0163iune", -1, 6),
Among(u"atoare", -1, 5),
Among(u"itoare", -1, 6),
Among(u"\u0103toare", -1, 5),
Among(u"icitate", -1, 4),
Among(u"abilitate", -1, 1),
Among(u"ibilitate", -1, 2),
Among(u"ivitate", -1, 3),
Among(u"icive", -1, 4),
Among(u"ative", -1, 5),
Among(u"itive", -1, 6),
Among(u"icali", -1, 4),
Among(u"atori", -1, 5),
Among(u"icatori", 18, 4),
Among(u"itori", -1, 6),
Among(u"\u0103tori", -1, 5),
Among(u"icitati", -1, 4),
Among(u"abilitati", -1, 1),
Among(u"ivitati", -1, 3),
Among(u"icivi", -1, 4),
Among(u"ativi", -1, 5),
Among(u"itivi", -1, 6),
Among(u"icit\u0103i", -1, 4),
Among(u"abilit\u0103i", -1, 1),
Among(u"ivit\u0103i", -1, 3),
Among(u"icit\u0103\u0163i", -1, 4),
Among(u"abilit\u0103\u0163i", -1, 1),
Among(u"ivit\u0103\u0163i", -1, 3),
Among(u"ical", -1, 4),
Among(u"ator", -1, 5),
Among(u"icator", 35, 4),
Among(u"itor", -1, 6),
Among(u"\u0103tor", -1, 5),
Among(u"iciv", -1, 4),
Among(u"ativ", -1, 5),
Among(u"itiv", -1, 6),
Among(u"ical\u0103", -1, 4),
Among(u"iciv\u0103", -1, 4),
Among(u"ativ\u0103", -1, 5),
Among(u"itiv\u0103", -1, 6)
]
a_3 = [
Among(u"ica", -1, 1),
Among(u"abila", -1, 1),
Among(u"ibila", -1, 1),
Among(u"oasa", -1, 1),
Among(u"ata", -1, 1),
Among(u"ita", -1, 1),
Among(u"anta", -1, 1),
Among(u"ista", -1, 3),
Among(u"uta", -1, 1),
Among(u"iva", -1, 1),
Among(u"ic", -1, 1),
Among(u"ice", -1, 1),
Among(u"abile", -1, 1),
Among(u"ibile", -1, 1),
Among(u"isme", -1, 3),
Among(u"iune", -1, 2),
Among(u"oase", -1, 1),
Among(u"ate", -1, 1),
Among(u"itate", 17, 1),
Among(u"ite", -1, 1),
Among(u"ante", -1, 1),
Among(u"iste", -1, 3),
Among(u"ute", -1, 1),
Among(u"ive", -1, 1),
Among(u"ici", -1, 1),
Among(u"abili", -1, 1),
Among(u"ibili", -1, 1),
Among(u"iuni", -1, 2),
Among(u"atori", -1, 1),
Among(u"osi", -1, 1),
Among(u"ati", -1, 1),
Among(u"itati", 30, 1),
Among(u"iti", -1, 1),
Among(u"anti", -1, 1),
Among(u"isti", -1, 3),
Among(u"uti", -1, 1),
Among(u"i\u015Fti", -1, 3),
Among(u"ivi", -1, 1),
Among(u"it\u0103i", -1, 1),
Among(u"o\u015Fi", -1, 1),
Among(u"it\u0103\u0163i", -1, 1),
Among(u"abil", -1, 1),
Among(u"ibil", -1, 1),
Among(u"ism", -1, 3),
Among(u"ator", -1, 1),
Among(u"os", -1, 1),
Among(u"at", -1, 1),
Among(u"it", -1, 1),
Among(u"ant", -1, 1),
Among(u"ist", -1, 3),
Among(u"ut", -1, 1),
Among(u"iv", -1, 1),
Among(u"ic\u0103", -1, 1),
Among(u"abil\u0103", -1, 1),
Among(u"ibil\u0103", -1, 1),
Among(u"oas\u0103", -1, 1),
Among(u"at\u0103", -1, 1),
Among(u"it\u0103", -1, 1),
Among(u"ant\u0103", -1, 1),
Among(u"ist\u0103", -1, 3),
Among(u"ut\u0103", -1, 1),
Among(u"iv\u0103", -1, 1)
]
a_4 = [
Among(u"ea", -1, 1),
Among(u"ia", -1, 1),
Among(u"esc", -1, 1),
Among(u"\u0103sc", -1, 1),
Among(u"ind", -1, 1),
Among(u"\u00E2nd", -1, 1),
Among(u"are", -1, 1),
Among(u"ere", -1, 1),
Among(u"ire", -1, 1),
Among(u"\u00E2re", -1, 1),
Among(u"se", -1, 2),
Among(u"ase", 10, 1),
Among(u"sese", 10, 2),
Among(u"ise", 10, 1),
Among(u"use", 10, 1),
Among(u"\u00E2se", 10, 1),
Among(u"e\u015Fte", -1, 1),
Among(u"\u0103\u015Fte", -1, 1),
Among(u"eze", -1, 1),
Among(u"ai", -1, 1),
Among(u"eai", 19, 1),
Among(u"iai", 19, 1),
Among(u"sei", -1, 2),
Among(u"e\u015Fti", -1, 1),
Among(u"\u0103\u015Fti", -1, 1),
Among(u"ui", -1, 1),
Among(u"ezi", -1, 1),
Among(u"\u00E2i", -1, 1),
Among(u"a\u015Fi", -1, 1),
Among(u"se\u015Fi", -1, 2),
Among(u"ase\u015Fi", 29, 1),
Among(u"sese\u015Fi", 29, 2),
Among(u"ise\u015Fi", 29, 1),
Among(u"use\u015Fi", 29, 1),
Among(u"\u00E2se\u015Fi", 29, 1),
Among(u"i\u015Fi", -1, 1),
Among(u"u\u015Fi", -1, 1),
Among(u"\u00E2\u015Fi", -1, 1),
Among(u"a\u0163i", -1, 2),
Among(u"ea\u0163i", 38, 1),
Among(u"ia\u0163i", 38, 1),
Among(u"e\u0163i", -1, 2),
Among(u"i\u0163i", -1, 2),
Among(u"\u00E2\u0163i", -1, 2),
Among(u"ar\u0103\u0163i", -1, 1),
Among(u"ser\u0103\u0163i", -1, 2),
Among(u"aser\u0103\u0163i", 45, 1),
Among(u"seser\u0103\u0163i", 45, 2),
Among(u"iser\u0103\u0163i", 45, 1),
Among(u"user\u0103\u0163i", 45, 1),
Among(u"\u00E2ser\u0103\u0163i", 45, 1),
Among(u"ir\u0103\u0163i", -1, 1),
Among(u"ur\u0103\u0163i", -1, 1),
Among(u"\u00E2r\u0103\u0163i", -1, 1),
Among(u"am", -1, 1),
Among(u"eam", 54, 1),
Among(u"iam", 54, 1),
Among(u"em", -1, 2),
Among(u"asem", 57, 1),
Among(u"sesem", 57, 2),
Among(u"isem", 57, 1),
Among(u"usem", 57, 1),
Among(u"\u00E2sem", 57, 1),
Among(u"im", -1, 2),
Among(u"\u00E2m", -1, 2),
Among(u"\u0103m", -1, 2),
Among(u"ar\u0103m", 65, 1),
Among(u"ser\u0103m", 65, 2),
Among(u"aser\u0103m", 67, 1),
Among(u"seser\u0103m", 67, 2),
Among(u"iser\u0103m", 67, 1),
Among(u"user\u0103m", 67, 1),
Among(u"\u00E2ser\u0103m", 67, 1),
Among(u"ir\u0103m", 65, 1),
Among(u"ur\u0103m", 65, 1),
Among(u"\u00E2r\u0103m", 65, 1),
Among(u"au", -1, 1),
Among(u"eau", 76, 1),
Among(u"iau", 76, 1),
Among(u"indu", -1, 1),
Among(u"\u00E2ndu", -1, 1),
Among(u"ez", -1, 1),
Among(u"easc\u0103", -1, 1),
Among(u"ar\u0103", -1, 1),
Among(u"ser\u0103", -1, 2),
Among(u"aser\u0103", 84, 1),
Among(u"seser\u0103", 84, 2),
Among(u"iser\u0103", 84, 1),
Among(u"user\u0103", 84, 1),
Among(u"\u00E2ser\u0103", 84, 1),
Among(u"ir\u0103", -1, 1),
Among(u"ur\u0103", -1, 1),
Among(u"\u00E2r\u0103", -1, 1),
Among(u"eaz\u0103", -1, 1)
]
a_5 = [
Among(u"a", -1, 1),
Among(u"e", -1, 1),
Among(u"ie", 1, 1),
Among(u"i", -1, 1),
Among(u"\u0103", -1, 1)
]
g_v = [17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 32, 0, 0, 4]
B_standard_suffix_removed = False
I_p2 = 0
I_p1 = 0
I_pV = 0
def copy_from(self, other):
self.B_standard_suffix_removed = other.B_standard_suffix_removed
self.I_p2 = other.I_p2
self.I_p1 = other.I_p1
self.I_pV = other.I_pV
super.copy_from(other)
def r_prelude(self):
# (, line 31
# repeat, line 32
try:
while True:
try:
v_1 = self.cursor
try:
# goto, line 32
try:
while True:
v_2 = self.cursor
try:
# (, line 32
if not self.in_grouping(RomanianStemmer.g_v, 97, 259):
raise lab4()
# [, line 33
self.bra = self.cursor
# or, line 33
try:
v_3 = self.cursor
try:
# (, line 33
# literal, line 33
if not self.eq_s(1, u"u"):
raise lab6()
# ], line 33
self.ket = self.cursor
if not self.in_grouping(RomanianStemmer.g_v, 97, 259):
raise lab6()
# <-, line 33
if not self.slice_from(u"U"):
return False
raise lab5()
except lab6: pass
self.cursor = v_3
# (, line 34
# literal, line 34
if not self.eq_s(1, u"i"):
raise lab4()
# ], line 34
self.ket = self.cursor
if not self.in_grouping(RomanianStemmer.g_v, 97, 259):
raise lab4()
# <-, line 34
if not self.slice_from(u"I"):
return False
except lab5: pass
self.cursor = v_2
raise lab3()
except lab4: pass
self.cursor = v_2
if self.cursor >= self.limit:
raise lab2()
self.cursor += 1
except lab3: pass
raise lab1()
except lab2: pass
self.cursor = v_1
raise lab0()
except lab1: pass
except lab0: pass
return True
def r_mark_regions(self):
# (, line 38
self.I_pV = self.limit;
self.I_p1 = self.limit;
self.I_p2 = self.limit;
# do, line 44
v_1 = self.cursor
try:
# (, line 44
# or, line 46
try:
v_2 = self.cursor
try:
# (, line 45
if not self.in_grouping(RomanianStemmer.g_v, 97, 259):
raise lab2()
# or, line 45
try:
v_3 = self.cursor
try:
# (, line 45
if not self.out_grouping(RomanianStemmer.g_v, 97, 259):
raise lab4()
# gopast, line 45
try:
while True:
try:
if not self.in_grouping(RomanianStemmer.g_v, 97, 259):
raise lab6()
raise lab5()
except lab6: pass
if self.cursor >= self.limit:
raise lab4()
self.cursor += 1
except lab5: pass
raise lab3()
except lab4: pass
self.cursor = v_3
# (, line 45
if not self.in_grouping(RomanianStemmer.g_v, 97, 259):
raise lab2()
# gopast, line 45
try:
while True:
try:
if not self.out_grouping(RomanianStemmer.g_v, 97, 259):
raise lab8()
raise lab7()
except lab8: pass
if self.cursor >= self.limit:
raise lab2()
self.cursor += 1
except lab7: pass
except lab3: pass
raise lab1()
except lab2: pass
self.cursor = v_2
# (, line 47
if not self.out_grouping(RomanianStemmer.g_v, 97, 259):
raise lab0()
# or, line 47
try:
v_6 = self.cursor
try:
# (, line 47
if not self.out_grouping(RomanianStemmer.g_v, 97, 259):
raise lab10()
# gopast, line 47
try:
while True:
try:
if not self.in_grouping(RomanianStemmer.g_v, 97, 259):
raise lab12()
raise lab11()
except lab12: pass
if self.cursor >= self.limit:
raise lab10()
self.cursor += 1
except lab11: pass
raise lab9()
except lab10: pass
self.cursor = v_6
# (, line 47
if not self.in_grouping(RomanianStemmer.g_v, 97, 259):
raise lab0()
# next, line 47
if self.cursor >= self.limit:
raise lab0()
self.cursor += 1
except lab9: pass
except lab1: pass
# setmark pV, line 48
self.I_pV = self.cursor
except lab0: pass
self.cursor = v_1
# do, line 50
v_8 = self.cursor
try:
# (, line 50
# gopast, line 51
try:
while True:
try:
if not self.in_grouping(RomanianStemmer.g_v, 97, 259):
raise lab15()
raise lab14()
except lab15: pass
if self.cursor >= self.limit:
raise lab13()
self.cursor += 1
except lab14: pass
# gopast, line 51
try:
while True:
try:
if not self.out_grouping(RomanianStemmer.g_v, 97, 259):
raise lab17()
raise lab16()
except lab17: pass
if self.cursor >= self.limit:
raise lab13()
self.cursor += 1
except lab16: pass
# setmark p1, line 51
self.I_p1 = self.cursor
# gopast, line 52
try:
while True:
try:
if not self.in_grouping(RomanianStemmer.g_v, 97, 259):
raise lab19()
raise lab18()
except lab19: pass
if self.cursor >= self.limit:
raise lab13()
self.cursor += 1
except lab18: pass
# gopast, line 52
try:
while True:
try:
if not self.out_grouping(RomanianStemmer.g_v, 97, 259):
raise lab21()
raise lab20()
except lab21: pass
if self.cursor >= self.limit:
raise lab13()
self.cursor += 1
except lab20: pass
# setmark p2, line 52
self.I_p2 = self.cursor
except lab13: pass
self.cursor = v_8
return True
def r_postlude(self):
# repeat, line 56
try:
while True:
try:
v_1 = self.cursor
try:
# (, line 56
# [, line 58
self.bra = self.cursor
# substring, line 58
among_var = self.find_among(RomanianStemmer.a_0, 3)
if among_var == 0:
raise lab2()
# ], line 58
self.ket = self.cursor
if among_var == 0:
raise lab2()
elif among_var == 1:
# (, line 59
# <-, line 59
if not self.slice_from(u"i"):
return False
elif among_var == 2:
# (, line 60
# <-, line 60
if not self.slice_from(u"u"):
return False
elif among_var == 3:
# (, line 61
# next, line 61
if self.cursor >= self.limit:
raise lab2()
self.cursor += 1
raise lab1()
except lab2: pass
self.cursor = v_1
raise lab0()
except lab1: pass
except lab0: pass
return True
def r_RV(self):
if not self.I_pV <= self.cursor:
return False
return True
def r_R1(self):
if not self.I_p1 <= self.cursor:
return False
return True
def r_R2(self):
if not self.I_p2 <= self.cursor:
return False
return True
def r_step_0(self):
# (, line 72
# [, line 73
self.ket = self.cursor
# substring, line 73
among_var = self.find_among_b(RomanianStemmer.a_1, 16)
if among_var == 0:
return False
# ], line 73
self.bra = self.cursor
# call R1, line 73
if not self.r_R1():
return False
if among_var == 0:
return False
elif among_var == 1:
# (, line 75
# delete, line 75
if not self.slice_del():
return False
elif among_var == 2:
# (, line 77
# <-, line 77
if not self.slice_from(u"a"):
return False
elif among_var == 3:
# (, line 79
# <-, line 79
if not self.slice_from(u"e"):
return False
elif among_var == 4:
# (, line 81
# <-, line 81
if not self.slice_from(u"i"):
return False
elif among_var == 5:
# (, line 83
# not, line 83
v_1 = self.limit - self.cursor
try:
# literal, line 83
if not self.eq_s_b(2, u"ab"):
raise lab0()
return False
except lab0: pass
self.cursor = self.limit - v_1
# <-, line 83
if not self.slice_from(u"i"):
return False
elif among_var == 6:
# (, line 85
# <-, line 85
if not self.slice_from(u"at"):
return False
elif among_var == 7:
# (, line 87
# <-, line 87
if not self.slice_from(u"a\u0163i"):
return False
return True
def r_combo_suffix(self):
# test, line 91
v_1 = self.limit - self.cursor
# (, line 91
# [, line 92
self.ket = self.cursor
# substring, line 92
among_var = self.find_among_b(RomanianStemmer.a_2, 46)
if among_var == 0:
return False
# ], line 92
self.bra = self.cursor
# call R1, line 92
if not self.r_R1():
return False
# (, line 92
if among_var == 0:
return False
elif among_var == 1:
# (, line 100
# <-, line 101
if not self.slice_from(u"abil"):
return False
elif among_var == 2:
# (, line 103
# <-, line 104
if not self.slice_from(u"ibil"):
return False
elif among_var == 3:
# (, line 106
# <-, line 107
if not self.slice_from(u"iv"):
return False
elif among_var == 4:
# (, line 112
# <-, line 113
if not self.slice_from(u"ic"):
return False
elif among_var == 5:
# (, line 117
# <-, line 118
if not self.slice_from(u"at"):
return False
elif among_var == 6:
# (, line 121
# <-, line 122
if not self.slice_from(u"it"):
return False
# set standard_suffix_removed, line 125
self.B_standard_suffix_removed = True
self.cursor = self.limit - v_1
return True
def r_standard_suffix(self):
# (, line 129
# unset standard_suffix_removed, line 130
self.B_standard_suffix_removed = False
# repeat, line 131
try:
while True:
try:
v_1 = self.limit - self.cursor
try:
# call combo_suffix, line 131
if not self.r_combo_suffix():
raise lab2()
raise lab1()
except lab2: pass
self.cursor = self.limit - v_1
raise lab0()
except lab1: pass
except lab0: pass
# [, line 132
self.ket = self.cursor
# substring, line 132
among_var = self.find_among_b(RomanianStemmer.a_3, 62)
if among_var == 0:
return False
# ], line 132
self.bra = self.cursor
# call R2, line 132
if not self.r_R2():
return False
# (, line 132
if among_var == 0:
return False
elif among_var == 1:
# (, line 148
# delete, line 149
if not self.slice_del():
return False
elif among_var == 2:
# (, line 151
# literal, line 152
if not self.eq_s_b(1, u"\u0163"):
return False
# ], line 152
self.bra = self.cursor
# <-, line 152
if not self.slice_from(u"t"):
return False
elif among_var == 3:
# (, line 155
# <-, line 156
if not self.slice_from(u"ist"):
return False
# set standard_suffix_removed, line 160
self.B_standard_suffix_removed = True
return True
def r_verb_suffix(self):
# setlimit, line 164
v_1 = self.limit - self.cursor
# tomark, line 164
if self.cursor < self.I_pV:
return False
self.cursor = self.I_pV
v_2 = self.limit_backward
self.limit_backward = self.cursor
self.cursor = self.limit - v_1
# (, line 164
# [, line 165
self.ket = self.cursor
# substring, line 165
among_var = self.find_among_b(RomanianStemmer.a_4, 94)
if among_var == 0:
self.limit_backward = v_2
return False
# ], line 165
self.bra = self.cursor
if among_var == 0:
self.limit_backward = v_2
return False
elif among_var == 1:
# (, line 200
# or, line 200
try:
v_3 = self.limit - self.cursor
try:
if not self.out_grouping_b(RomanianStemmer.g_v, 97, 259):
raise lab1()
raise lab0()
except lab1: pass
self.cursor = self.limit - v_3
# literal, line 200
if not self.eq_s_b(1, u"u"):
self.limit_backward = v_2
return False
except lab0: pass
# delete, line 200
if not self.slice_del():
return False
elif among_var == 2:
# (, line 214
# delete, line 214
if not self.slice_del():
return False
self.limit_backward = v_2
return True
def r_vowel_suffix(self):
# (, line 218
# [, line 219
self.ket = self.cursor
# substring, line 219
among_var = self.find_among_b(RomanianStemmer.a_5, 5)
if among_var == 0:
return False
# ], line 219
self.bra = self.cursor
# call RV, line 219
if not self.r_RV():
return False
if among_var == 0:
return False
elif among_var == 1:
# (, line 220
# delete, line 220
if not self.slice_del():
return False
return True
def _stem(self):
# (, line 225
# do, line 226
v_1 = self.cursor
try:
# call prelude, line 226
if not self.r_prelude():
raise lab0()
except lab0: pass
self.cursor = v_1
# do, line 227
v_2 = self.cursor
try:
# call mark_regions, line 227
if not self.r_mark_regions():
raise lab1()
except lab1: pass
self.cursor = v_2
# backwards, line 228
self.limit_backward = self.cursor
self.cursor = self.limit
# (, line 228
# do, line 229
v_3 = self.limit - self.cursor
try:
# call step_0, line 229
if not self.r_step_0():
raise lab2()
except lab2: pass
self.cursor = self.limit - v_3
# do, line 230
v_4 = self.limit - self.cursor
try:
# call standard_suffix, line 230
if not self.r_standard_suffix():
raise lab3()
except lab3: pass
self.cursor = self.limit - v_4
# do, line 231
v_5 = self.limit - self.cursor
try:
# (, line 231
# or, line 231
try:
v_6 = self.limit - self.cursor
try:
# Boolean test standard_suffix_removed, line 231
if not self.B_standard_suffix_removed:
raise lab6()
raise lab5()
except lab6: pass
self.cursor = self.limit - v_6
# call verb_suffix, line 231
if not self.r_verb_suffix():
raise lab4()
except lab5: pass
except lab4: pass
self.cursor = self.limit - v_5
# do, line 232
v_7 = self.limit - self.cursor
try:
# call vowel_suffix, line 232
if not self.r_vowel_suffix():
raise lab7()
except lab7: pass
self.cursor = self.limit - v_7
self.cursor = self.limit_backward
# do, line 234
v_8 = self.cursor
try:
# call postlude, line 234
if not self.r_postlude():
raise lab8()
except lab8: pass
self.cursor = v_8
return True
def equals(self, o):
return isinstance(o, RomanianStemmer)
def hashCode(self):
return hash("RomanianStemmer")
class lab0(BaseException): pass
class lab1(BaseException): pass
class lab2(BaseException): pass
class lab3(BaseException): pass
class lab4(BaseException): pass
class lab5(BaseException): pass
class lab6(BaseException): pass
class lab7(BaseException): pass
class lab8(BaseException): pass
class lab9(BaseException): pass
class lab10(BaseException): pass
class lab11(BaseException): pass
class lab12(BaseException): pass
class lab13(BaseException): pass
class lab14(BaseException): pass
class lab15(BaseException): pass
class lab16(BaseException): pass
class lab17(BaseException): pass
class lab18(BaseException): pass
class lab19(BaseException): pass
class lab20(BaseException): pass
class lab21(BaseException): pass