ranesi / text_analysis_django

0 stars 0 forks source link

Move text processing to 'submit' method under Document model #2

Open ranesi opened 7 years ago

ranesi commented 7 years ago

Done def submit(self): """ Process submitted text. """ self.date_submitted = timezone.now() # django utils

self.date_submitted = datetime.datetime.now()

    self.sentences, self.words, self.syllables, \
        self.characters, self.poly_syllables = analyze_string(
            self.text)

    self.readability_index = eq.fk_re(
        self.words, self.sentences, self.syllables)
    self.fk_grade_level = eq.fk_gl(
        self.words, self.sentences, self.syllables)
    self.ari = eq.ari(self.words, self.sentences, self.characters)
    self.smog = eq.smog(self.poly_syllables)