Exemplo n.º 1
0
Arquivo: models.py Projeto: Foxas/369
 def update_word_stats(sender, instance, created, using, **kwargs):
     if not created:
         return
     text = ''.join((instance.content_ascii, instance.subject_title_ascii))
     text = unicode_to_ascii(text).lower()
     for word, count in count_words(text):
         Word.objects.increase_count(word, count)
Exemplo n.º 2
0
Arquivo: models.py Projeto: Foxas/369
 def update_word_stats(sender, instance, created, using, **kwargs):
     if not created:
         return
     text = ''.join((instance.content_ascii, instance.subject_title_ascii))
     text = unicode_to_ascii(text).lower()
     for word, count in count_words(text):
         Word.objects.increase_count(word, count)
Exemplo n.º 3
0
Arquivo: models.py Projeto: Foxas/369
 def word_stats(self):
     text = ' '.join([self.subject_title_ascii or "",
                      self.content_ascii or ""]).lower()
     count = count_words(text, r"[a-z0-9]{2}[a-zA-Z0-9]*")
     return count
Exemplo n.º 4
0
Arquivo: models.py Projeto: Foxas/369
 def word_stats(self):
     text = ' '.join(
         [self.subject_title_ascii or "", self.content_ascii
          or ""]).lower()
     count = count_words(text, r"[a-z0-9]{2}[a-zA-Z0-9]*")
     return count