Beispiel #1
0
def add_to_index(p, name, id):
    text = name.lower()
    text = util.remove_accents(text)
    text = util.remove_punctuation(text)
    words = text.split()
    swords = set(words)
    for word in swords:
        w = 'si-' + word
        p.sadd(w, id)
Beispiel #2
0
def artist_search(text):
    lwords = set()
    text = text.lower()
    text = util.remove_accents(text)
    text = util.remove_punctuation(text)
    words = text.split()
    swords = set(words)
    for word in swords:
        w = 'si-' + word
        lwords.append(w)
    aids = r.sinter(lwords)
    print 'as', lwords, aids
    return list(aids)
Beispiel #3
0
def filter_name(text):
    text = text.lower()
    text = util.remove_accents(text)
    text = util.remove_punctuation(text)
    return text
Beispiel #4
0
 def category_without_accents(self):
     return remove_accents(self.category_trans)
Beispiel #5
0
 def name_without_accents(self):
     return remove_accents(self.name_trans)
Beispiel #6
0
def get_words(text):
    splitter = re.compile(r'[\s|\-|\)|\(|/]+')
    return [s.lower() for s in splitter.split(remove_accents(text)) if s != '']