def _parse_sentence(self, paragraph, node, state):
text = state["<STR_LIT>"]["<STR_LIT:text>"]<EOL>field = state["<STR_LIT>"]["<STR_LIT>"]<EOL>name = node.attrib["<STR_LIT:name>"] if "<STR_LIT:name>" in node.attrib else None<EOL>document = state["<STR_LIT>"]<EOL>for parts in self.tokenize_and_split_sentences(text):<EOL><INDENT>parts["<STR_LIT>"] = document<EOL>parts["<STR_LIT>"] = state["<STR_LIT>"]["<STR_LIT>"]<EOL>abs_sentence_offset_end = (<EOL>state["<STR_LIT>"]["<STR_LIT>"]<EOL>+ parts["<STR_LIT>"][-<NUM_LIT:1>]<EOL>+ len(parts["<STR_LIT>"][-<NUM_LIT:1>])<EOL>)<EOL>parts["<STR_LIT>"] = construct_stable_id(<EOL>document,<EOL>"<STR_LIT>",<EOL>state["<STR_LIT>"]["<STR_LIT>"],<EOL>abs_sentence_offset_end,<EOL>)<EOL>parts["<STR_LIT:name>"] = name<EOL>state["<STR_LIT>"]["<STR_LIT>"] = abs_sentence_offset_end<EOL>if self.structural:<EOL><INDENT>context_node = node.getparent() if field == "<STR_LIT>" else node<EOL>tree = lxml.etree.ElementTree(state["<STR_LIT:root>"])<EOL>parts["<STR_LIT>"] = tree.getpath(context_node)<EOL>parts["<STR_LIT>"] = context_node.tag<EOL>parts["<STR_LIT>"] = [<EOL>"<STR_LIT:=>".join(x) for x in list(context_node.attrib.items())<EOL>]<EOL>cur_style_index = None<EOL>for index, attr in enumerate(parts["<STR_LIT>"]):<EOL><INDENT>if attr.find("<STR_LIT>") >= <NUM_LIT:0>:<EOL><INDENT>cur_style_index = index<EOL>break<EOL><DEDENT><DEDENT>head = state["<STR_LIT:root>"].find("<STR_LIT>")<EOL>styles = None<EOL>if head is not None:<EOL><INDENT>styles = head.find("<STR_LIT>")<EOL><DEDENT>if styles is not None:<EOL><INDENT>for x in list(context_node.attrib.items()):<EOL><INDENT>if x[<NUM_LIT:0>] == "<STR_LIT:class>":<EOL><INDENT>exp = r"<STR_LIT>" + x[<NUM_LIT:1>] + r"<STR_LIT>"<EOL>r = re.compile(exp, re.DOTALL)<EOL>if r.search(styles.text) is not None:<EOL><INDENT>if cur_style_index is not None:<EOL><INDENT>parts["<STR_LIT>"][cur_style_index] += (<EOL>r.search(styles.text)<EOL>.group(<NUM_LIT:3>)<EOL>.replace("<STR_LIT:\r>", "<STR_LIT>")<EOL>.replace("<STR_LIT:\n>", "<STR_LIT>")<EOL>.replace("<STR_LIT:\t>", "<STR_LIT>")<EOL>)<EOL><DEDENT>else:<EOL><INDENT>parts["<STR_LIT>"].extend(<EOL>[<EOL>"<STR_LIT>"<EOL>+ re.sub(<EOL>r"<STR_LIT>",<EOL>"<STR_LIT:U+0020>",<EOL>r.search(styles.text)<EOL>.group(<NUM_LIT:3>)<EOL>.replace("<STR_LIT:\r>", "<STR_LIT>")<EOL>.replace("<STR_LIT:\n>", "<STR_LIT>")<EOL>.replace("<STR_LIT:\t>", "<STR_LIT>")<EOL>.strip(),<EOL>)<EOL>]<EOL>)<EOL><DEDENT><DEDENT>break<EOL><DEDENT><DEDENT><DEDENT><DEDENT>if self.tabular:<EOL><INDENT>parts["<STR_LIT>"] = state["<STR_LIT>"]["<STR_LIT>"]<EOL>parent = paragraph<EOL>if isinstance(parent, Paragraph):<EOL><INDENT>parts["<STR_LIT>"] = parent.section<EOL>parts["<STR_LIT>"] = parent<EOL>if parent.cell:<EOL><INDENT>parts["<STR_LIT>"] = parent.cell.table<EOL>parts["<STR_LIT>"] = parent.cell<EOL>parts["<STR_LIT>"] = parent.cell.row_start<EOL>parts["<STR_LIT>"] = parent.cell.row_end<EOL>parts["<STR_LIT>"] = parent.cell.col_start<EOL>parts["<STR_LIT>"] = parent.cell.col_end<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise NotImplementedError("<STR_LIT>")<EOL><DEDENT><DEDENT>yield Sentence(**parts)<EOL>state["<STR_LIT>"]["<STR_LIT>"] += <NUM_LIT:1><EOL><DEDENT>
Parse the Sentences of the node.

        :param node: The lxml node to parse
        :param state: The global state necessary to place the node in context
            of the document as a whole.