예제 #1
0
파일: crawl.py 프로젝트: plamere/SixDegrees
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)
예제 #2
0
파일: crawl.py 프로젝트: plamere/SixDegrees
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)
예제 #3
0
파일: db.py 프로젝트: plamere/SixDegrees
def filter_name(text):
    text = text.lower()
    text = util.remove_accents(text)
    text = util.remove_punctuation(text)
    return text
예제 #4
0
 def category_without_accents(self):
     return remove_accents(self.category_trans)
예제 #5
0
 def name_without_accents(self):
     return remove_accents(self.name_trans)
예제 #6
0
파일: search.py 프로젝트: jbochi/to-a-pe
def get_words(text):
    splitter = re.compile(r'[\s|\-|\)|\(|/]+')
    return [s.lower() for s in splitter.split(remove_accents(text)) if s != '']