def match_tree(sentence, pattern):
if not verify_pattern(pattern):<EOL><INDENT>raise PatternSyntaxException(pattern)<EOL><DEDENT>def _match_node(t, p):<EOL><INDENT>pat_node = p.pop(<NUM_LIT:0>) if p else "<STR_LIT>"<EOL>return not pat_node or (_match_token(t, pat_node, False) and _match_edge(t.children,p))<EOL><DEDENT>def _match_edge(edges,p):<EOL><INDENT>pat_edge = p.pop(<NUM_LIT:0>) if p else "<STR_LIT>"<EOL>if not pat_edge:<EOL><INDENT>return True<EOL><DEDENT>elif not edges:<EOL><INDENT>return False<EOL><DEDENT>else:<EOL><INDENT>for (t) in edges:<EOL><INDENT>if (_match_token(t, pat_edge, True)) and _match_node(t, list(p)):<EOL><INDENT>return True<EOL><DEDENT>elif pat_edge == "<STR_LIT>" and _match_edge(t.children, ["<STR_LIT>"] + p):<EOL><INDENT>return True<EOL><DEDENT><DEDENT><DEDENT>return False<EOL><DEDENT>return _match_node(sentence.root, pattern.split("<STR_LIT:/>"))<EOL>
Matches given sentence with provided pattern.

        :param sentence: sentence from Spacy(see: http://spacy.io/docs/#doc-spans-sents) representing complete statement
        :param pattern: pattern to which sentence will be compared

        :return: True if sentence match to pattern, False otherwise

        :raises: PatternSyntaxException: if pattern has wrong syntax