def __init__(self, string="", token=[WORD, POS, CHUNK, PNP, REL, ANCHOR, LEMMA], language="en"):
        # Extract token format from TokenString or TaggedString if possible.
        if _is_tokenstring(string):
            token, language = string.tags, getattr(string, "language", language)
        # Convert to Unicode.
        if not isinstance(string, unicode):
            for encoding in (("utf-8",), ("windows-1252",), ("utf-8", "ignore")):
                try: string = string.decode(*encoding)
                except:
                    pass
        self.parent      = None # A Slice refers to the Sentence it is part of.
        self.text        = None # A Sentence refers to the Text it is part of.
        self.language    = language
        self.id          = _uid()
        self.token       = list(token)
        self.words       = []
        self.chunks      = [] # Words grouped into chunks.
        self.pnp         = [] # Words grouped into PNP chunks.
        self._anchors    = {} # Anchor tags related to anchor chunks or attached PNP's.
        self._relation   = None # Helper variable: the last chunk's relation and role.
        self._attachment = None # Helper variable: the last attachment tag (e.g., "P1") parsed in _do_pnp().
        self._previous   = None # Helper variable: the last token parsed in parse_token().
        self.relations   = {"SBJ":{}, "OBJ":{}, "VP":{}}
        # Split the slash-formatted token into the separate tags in the given order.
        # Append Word and Chunk objects according to the token's tags.        
        for chars in string.split(" "):
            if chars:
                self.append(*self.parse_token(chars, token))
A nested tree of sentence words, chunks and prepositions.
dataset/ETHPy150Open markuskiller/textblob-de/textblob_de/ext/_pattern/text/tree.py/Sentence.__init__