Exemple #1
0
 def stem(self, rq, *args):
     from stemming import stemArabic
     w = rq.q.getfirst('word', '').decode('utf-8')
     s = ''
     if w:
         s = " ".join([stemArabic(i) for i in w.split()])
     return {u"script": rq.script, u"word": w, u"stem": s}
Exemple #2
0
 def stem(self, rq, *args):
   from stemming import stemArabic
   w=rq.q.getfirst('word','').decode('utf-8')
   s=''
   if w:
     s=" ".join([stemArabic(i) for i in w.split()])
   return {u"script":rq.script, u"word":w, u"stem":s}
def stemfn(word):
    return stemArabic(stem(word))
def stemfn(word): return stemArabic(stem(word))
# word_re = ur"[\w\u064e\u064b\u064f\u064c\u0650\u064d\u0652\u0651\u0640]"
analyzer = StandardAnalyzer(expression = ur"[\w\u064e\u064b\u064f\u064c\u0650\u064d\u0652\u0651\u0640]+(?:\.?[\w\u064e\u064b\u064f\u064c\u0650\u064d\u0652\u0651\u0640]+)*") | StemFilter(stemfn)