예제 #1
0
파일: utils.py 프로젝트: sephii/appy
 def __init__(self, keywords, operator='AND'):
     # Clean the p_keywords that the user has entered.
     words = normalizeText(keywords)
     if words == '*': words = ''
     for c in self.toRemove: words = words.replace(c, ' ')
     self.keywords = words.split()
     # Store the operator to apply to the keywords (AND or OR)
     self.operator = operator
예제 #2
0
파일: utils.py 프로젝트: tonibagur/appy
 def __init__(self, keywords, operator='AND', ignore=2):
     # Clean the p_keywords that the user has entered
     words = sutils.normalizeText(keywords)
     if words == '*': words = ''
     for c in self.toRemove: words = words.replace(c, ' ')
     self.keywords = splitIntoWords(words, ignore=ignore)
     # Store the operator to apply to the keywords (AND or OR)
     self.operator = operator
예제 #3
0
 def __init__(self, keywords, operator='AND'):
     # Clean the p_keywords that the user has entered.
     words = normalizeText(keywords)
     if words == '*': words = ''
     for c in self.toRemove: words = words.replace(c, ' ')
     self.keywords = words.split()
     # Store the operator to apply to the keywords (AND or OR)
     self.operator = operator
예제 #4
0
 def process(self, texts):
     res = set()
     for text in texts:
         cleanText = normalizeText(text)
         res = res.union(splitIntoWords(cleanText))
     return list(res)
예제 #5
0
 def characters(self, content):
     c = normalizeText(content)
     if len(c) > 1: self.res.append(c)
예제 #6
0
파일: indexer.py 프로젝트: sephii/appy
 def characters(self, content):
     c = normalizeText(content)
     if len(c) > 1: self.res.append(c)
예제 #7
0
파일: indexer.py 프로젝트: sephii/appy
 def process(self, texts):
     res = set()
     for text in texts:
         cleanText = normalizeText(text)
         res = res.union(splitIntoWords(cleanText))
     return list(res)