How to use the snowballstemmer.portuguese_stemmer.PortugueseStemmer function in snowballstemmer

To help you get started, we’ve selected a few snowballstemmer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github shibukawa / snowball_py / snowballstemmer / portuguese_stemmer.py View on Github external
def r_standard_suffix(self):
        # (, line 76
        # [, line 77
        self.ket = self.cursor
        # substring, line 77
        among_var = self.find_among_b(PortugueseStemmer.a_5, 45)
        if among_var == 0:
            return False
        # ], line 77
        self.bra = self.cursor
        if among_var == 0:
            return False
        elif among_var == 1:
            # (, line 92
            # call R2, line 93
            if not self.r_R2():
                return False
            # delete, line 93
            if not self.slice_del():
                return False

        elif among_var == 2:
github shibukawa / snowball_py / snowballstemmer / portuguese_stemmer.py View on Github external
def r_verb_suffix(self):
        # setlimit, line 159
        v_1 = self.limit - self.cursor
        # tomark, line 159
        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 159
        # [, line 160
        self.ket = self.cursor
        # substring, line 160
        among_var = self.find_among_b(PortugueseStemmer.a_6, 120)
        if among_var == 0:
            self.limit_backward = v_2
            return False
        # ], line 160
        self.bra = self.cursor
        if among_var == 0:
            self.limit_backward = v_2
            return False
        elif among_var == 1:
            # (, line 179
            # delete, line 179
            if not self.slice_del():
                return False

        self.limit_backward = v_2
        return True
github shibukawa / snowball_py / snowballstemmer / portuguese_stemmer.py View on Github external
# (, line 133
            # call R2, line 134
            if not self.r_R2():
                return False
            # delete, line 134
            if not self.slice_del():
                return False

            # try, line 135
            v_3 = self.limit - self.cursor
            try:
                # (, line 135
                # [, line 136
                self.ket = self.cursor
                # substring, line 136
                among_var = self.find_among_b(PortugueseStemmer.a_4, 3)
                if among_var == 0:
                    self.cursor = self.limit - v_3
                    raise lab2()
                # ], line 136
                self.bra = self.cursor
                if among_var == 0:
                    self.cursor = self.limit - v_3
                    raise lab2()
                elif among_var == 1:
                    # (, line 139
                    # call R2, line 139
                    if not self.r_R2():
                        self.cursor = self.limit - v_3
                        raise lab2()
                    # delete, line 139
                    if not self.slice_del():
github shibukawa / snowball_py / snowballstemmer / portuguese_stemmer.py View on Github external
def r_postlude(self):
        # repeat, line 62
        try:
            while True:
                try:
                    v_1 = self.cursor
                    try:
                        # (, line 62
                        # [, line 63
                        self.bra = self.cursor
                        # substring, line 63
                        among_var = self.find_among(PortugueseStemmer.a_1, 3)
                        if among_var == 0:
                            raise lab2()
                        # ], line 63
                        self.ket = self.cursor
                        if among_var == 0:
                            raise lab2()
                        elif among_var == 1:
                            # (, line 64
                            # <-, line 64
                            if not self.slice_from(u"\u00E3"):
                                return False
                        elif among_var == 2:
                            # (, line 65
                            # <-, line 65
                            if not self.slice_from(u"\u00F5"):
                                return False
github shibukawa / snowball_py / snowballstemmer / portuguese_stemmer.py View on Github external
def r_residual_suffix(self):
        # (, line 183
        # [, line 184
        self.ket = self.cursor
        # substring, line 184
        among_var = self.find_among_b(PortugueseStemmer.a_7, 7)
        if among_var == 0:
            return False
        # ], line 184
        self.bra = self.cursor
        if among_var == 0:
            return False
        elif among_var == 1:
            # (, line 187
            # call RV, line 187
            if not self.r_RV():
                return False
            # delete, line 187
            if not self.slice_del():
                return False

        return True
github shibukawa / snowball_py / snowballstemmer / __init__.py View on Github external
from .spanish_stemmer import SpanishStemmer
from .swedish_stemmer import SwedishStemmer
from .turkish_stemmer import TurkishStemmer

_languages = {
    'danish': DanishStemmer,
    'dutch': DutchStemmer,
    'english': EnglishStemmer,
    'finnish': FinnishStemmer,
    'french': FrenchStemmer,
    'german': GermanStemmer,
    'hungarian': HungarianStemmer,
    'italian': ItalianStemmer,
    'norwegian': NorwegianStemmer,
    'porter': PorterStemmer,
    'portuguese': PortugueseStemmer,
    'romanian': RomanianStemmer,
    'russian': RussianStemmer,
    'spanish': SpanishStemmer,
    'swedish': SwedishStemmer,
    'turkish': TurkishStemmer,
}

try:
    import Stemmer
    cext_available = True
except ImportError:
    cext_available = False

def algorithms():
    if cext_available:
        return Stemmer.language()
github shibukawa / snowball_py / snowballstemmer / portuguese_stemmer.py View on Github external
# (, line 121
            # call R2, line 122
            if not self.r_R2():
                return False
            # delete, line 122
            if not self.slice_del():
                return False

            # try, line 123
            v_2 = self.limit - self.cursor
            try:
                # (, line 123
                # [, line 124
                self.ket = self.cursor
                # substring, line 124
                among_var = self.find_among_b(PortugueseStemmer.a_3, 3)
                if among_var == 0:
                    self.cursor = self.limit - v_2
                    raise lab1()
                # ], line 124
                self.bra = self.cursor
                if among_var == 0:
                    self.cursor = self.limit - v_2
                    raise lab1()
                elif among_var == 1:
                    # (, line 127
                    # call R2, line 127
                    if not self.r_R2():
                        self.cursor = self.limit - v_2
                        raise lab1()
                    # delete, line 127
                    if not self.slice_del():
github shibukawa / snowball_py / snowballstemmer / portuguese_stemmer.py View on Github external
def equals(self, o):
        return isinstance(o, PortugueseStemmer)
github shibukawa / snowball_py / snowballstemmer / portuguese_stemmer.py View on Github external
# (, line 109
            # call R1, line 110
            if not self.r_R1():
                return False
            # delete, line 110
            if not self.slice_del():
                return False

            # try, line 111
            v_1 = self.limit - self.cursor
            try:
                # (, line 111
                # [, line 112
                self.ket = self.cursor
                # substring, line 112
                among_var = self.find_among_b(PortugueseStemmer.a_2, 4)
                if among_var == 0:
                    self.cursor = self.limit - v_1
                    raise lab0()
                # ], line 112
                self.bra = self.cursor
                # call R2, line 112
                if not self.r_R2():
                    self.cursor = self.limit - v_1
                    raise lab0()
                # delete, line 112
                if not self.slice_del():
                    return False

                if among_var == 0:
                    self.cursor = self.limit - v_1
                    raise lab0()
github shibukawa / snowball_py / snowballstemmer / portuguese_stemmer.py View on Github external
raise lab2()
                                self.cursor += 1
                        except lab7: pass
                    except lab3: pass
                    raise lab1()
                except lab2: pass
                self.cursor = v_2
                # (, line 53
                if not self.out_grouping(PortugueseStemmer.g_v, 97, 250):
                    raise lab0()
                # or, line 53
                try:
                    v_6 = self.cursor
                    try:
                        # (, line 53
                        if not self.out_grouping(PortugueseStemmer.g_v, 97, 250):
                            raise lab10()
                        # gopast, line 53
                        try:
                            while True:
                                try:
                                    if not self.in_grouping(PortugueseStemmer.g_v, 97, 250):
                                        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