'Generate the document
:param input: string of the html content.
:param positive_keywords: regex or list of patterns in classes and ids
:param negative_keywords: regex or list of patterns in classes and ids
:param min_text_length: Tunable. Set to a higher value for more precise detection of longer texts.
:param retry_length: Tunable. Set to a lower value for better detection of very small texts.
:param xpath: If set to True, adds x="..." attribute to each HTML node,
containing xpath path pointing to original document path (allows to
reconstruct selected summary in original document).
Example:
positive_keywords=["news-item", "block"]
negative_keywords=["mysidebar", "related", "ads"]
The Document class is not re-enterable.
It is designed to create a new Document() for each HTML file to process it.
API methods:
.title() -- full title
.short_title() -- cleaned up title
.content() -- full content
.summary() -- cleaned up content'

def __init__(self, input, positive_keywords=None, negative_keywords=None, url=None, min_text_length=25, retry_length=250, xpath=False):

    self.input = input
    self.html = None
    self.encoding = None
    self.positive_keywords = compile_pattern(positive_keywords)
    self.negative_keywords = compile_pattern(negative_keywords)
    self.url = url
    self.min_text_length = min_text_length
    self.retry_length = retry_length
    self.xpath = xpath
