Beispiel #1
0
def normalize_text(text):
	functions = [lambda x: remove_nonletters(x, ' '), lambda x: replace_white_spaces(x, ' '), lambda x: x.lower().strip()]
	return sreduce(functions, text)
Beispiel #2
0
def getWordsWithoutStopWords(text, stopwords):
    funs = [towords, lambda x: remstopwords(x, stopwords)]
    return list(sreduce(funs, text))
Beispiel #3
0
def stemAndRemoveAccents(words, lang):
    funs = [lambda x: tostems(x, lang), glmap(strip_accents)]
    return sreduce(funs, words)
Beispiel #4
0
def getRealWords(text, stopwords):
    funs = [
        towords, lambda x: remstopwords(x, stopwords),
        glmap(strip_accents)
    ]
    return sreduce(funs, text)
Beispiel #5
0
def stemAndRemoveAccents(words, lang):
	funs = [lambda x:tostems(x, lang), glmap(strip_accents)]
	return sreduce(funs, words)
Beispiel #6
0
def getWordsWithoutStopWords(text, stopwords):
	funs = [towords, lambda x: remstopwords(x, stopwords)]
	return list(sreduce(funs, text))
Beispiel #7
0
def getRealWords(text, stopwords):
	funs = [towords, lambda x: remstopwords(x, stopwords), glmap(strip_accents)]
	return sreduce(funs, text)
Beispiel #8
0
def normalize_text(text):
    functions = [
        lambda x: remove_nonletters(x, ' '),
        lambda x: replace_white_spaces(x, ' '), lambda x: x.lower().strip()
    ]
    return sreduce(functions, text)