Esempio n. 1
0
    def __init__(self, text):
        """Init Paragraph.

        param text: tring to split
        type text: str
        """
        self.text = text
        log.debug('Init Paragraph: %s' % self.text)
Esempio n. 2
0
    def __init__(self, title, text):
        """Init Essay.

        param title: tring to split
        type title: str
        param text: body essay
        type text: str
        """
        self.title = title
        self.text = text
        self.paragraphs = [Paragraph(p) for p in get_paragraphs(text)]
        log.debug('Init Essay: %s' % self.title)
Esempio n. 3
0
 def paragraphs_count(self):
     """Paragraph count."""
     log.debug("Get the paragraphs count in the essay.")
     return len(self.paragraphs)
Esempio n. 4
0
 def words_count(self):
     """Words count."""
     log.debug("Get the words count in the essay.")
     return sum((p.words_count for p in self.paragraphs))
Esempio n. 5
0
 def chars_count(self):
     """Characters count."""
     log.debug("Get the characters count in the essay.")
     return len(self.text)
Esempio n. 6
0
 def size(self):
     """Paragraph size."""
     log.debug("Get paragraph size.")
     return len(self.text)
Esempio n. 7
0
 def sentences(self):
     """List of sentences."""
     log.debug("Get the sentences in the paragraph.")
     return get_sentences(self.text)
Esempio n. 8
0
 def words(self):
     """List of words."""
     log.debug("Get the words in the paragraph.")
     return tokenize(self.text)