예제 #1
0
파일: models.py 프로젝트: 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)
예제 #2
0
파일: models.py 프로젝트: 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)
예제 #3
0
파일: models.py 프로젝트: 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
예제 #4
0
파일: models.py 프로젝트: 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