class documentation

class TestSequenceFunctions(unittest.TestCase): (source)

View In Hierarchy

Class containing unit tests for nltk.tgrep.

Method test_bad_operator Test error handling of undefined tgrep operators.
Method test_comments Test that comments are correctly filtered out of tgrep search strings.
Method test_examples Test the Basic Examples from the TGrep2 manual.
Method test_labeled_nodes Test labeled nodes.
Method test_multiple_conjs Test that multiple (3 or more) conjunctions of node relations are handled properly.
Method test_node_encoding Test that tgrep search strings handles bytes and strs the same way.
Method test_node_nocase Test selecting nodes using case insensitive node names.
Method test_node_noleaves Test node name matching with the search_leaves flag set to False.
Method test_node_printing Test that the tgrep print operator ' is properly ignored.
Method test_node_quoted Test selecting nodes using quoted node names.
Method test_node_regex Test regex matching on nodes.
Method test_node_regex_2 Test regex matching on nodes.
Method test_node_simple Test a simple use of tgrep for finding nodes matching a given pattern.
Method test_node_tree_position Test matching on nodes based on NLTK tree position.
Method test_rel_precedence Test matching nodes based on precedence relations.
Method test_rel_sister_nodes Test matching sister nodes in a tree.
Method test_tokenize_encoding Test that tokenization handles bytes and strs the same way.
Method test_tokenize_examples Test tokenization of the TGrep2 manual example patterns.
Method test_tokenize_link_types Test tokenization of basic link types.
Method test_tokenize_macros Test tokenization of macro definitions.
Method test_tokenize_node_labels Test tokenization of labeled nodes.
Method test_tokenize_nodenames Test tokenization of node names.
Method test_tokenize_quoting Test tokenization of quoting.
Method test_tokenize_segmented_patterns Test tokenization of segmented patterns.
Method test_tokenize_simple Simple test of tokenization.
Method test_trailing_semicolon Test that semicolons at the end of a tgrep2 search string won't cause a parse failure.
Method test_use_macros Test defining and using tgrep2 macros.
Method tests_rel_dominance Test matching nodes based on dominance relations.
Method tests_rel_indexed_children Test matching nodes based on their index in their parent node.
def test_bad_operator(self): (source)

Test error handling of undefined tgrep operators.

def test_comments(self): (source)

Test that comments are correctly filtered out of tgrep search strings.

def test_examples(self): (source)

Test the Basic Examples from the TGrep2 manual.

def test_labeled_nodes(self): (source)

Test labeled nodes.

Test case from Emily M. Bender.

def test_multiple_conjs(self): (source)

Test that multiple (3 or more) conjunctions of node relations are handled properly.

def test_node_encoding(self): (source)

Test that tgrep search strings handles bytes and strs the same way.

def test_node_nocase(self): (source)

Test selecting nodes using case insensitive node names.

def test_node_noleaves(self): (source)

Test node name matching with the search_leaves flag set to False.

def test_node_printing(self): (source)

Test that the tgrep print operator ' is properly ignored.

def test_node_quoted(self): (source)

Test selecting nodes using quoted node names.

def test_node_regex(self): (source)

Test regex matching on nodes.

def test_node_regex_2(self): (source)

Test regex matching on nodes.

def test_node_simple(self): (source)

Test a simple use of tgrep for finding nodes matching a given pattern.

def test_node_tree_position(self): (source)

Test matching on nodes based on NLTK tree position.

def test_rel_precedence(self): (source)

Test matching nodes based on precedence relations.

def test_rel_sister_nodes(self): (source)

Test matching sister nodes in a tree.

def test_tokenize_encoding(self): (source)

Test that tokenization handles bytes and strs the same way.

def test_tokenize_examples(self): (source)

Test tokenization of the TGrep2 manual example patterns.

def test_tokenize_link_types(self): (source)

Test tokenization of basic link types.

def test_tokenize_macros(self): (source)

Test tokenization of macro definitions.

def test_tokenize_node_labels(self): (source)

Test tokenization of labeled nodes.

def test_tokenize_nodenames(self): (source)

Test tokenization of node names.

def test_tokenize_quoting(self): (source)

Test tokenization of quoting.

def test_tokenize_segmented_patterns(self): (source)

Test tokenization of segmented patterns.

def test_tokenize_simple(self): (source)

Simple test of tokenization.

def test_trailing_semicolon(self): (source)

Test that semicolons at the end of a tgrep2 search string won't cause a parse failure.

def test_use_macros(self): (source)

Test defining and using tgrep2 macros.

def tests_rel_dominance(self): (source)

Test matching nodes based on dominance relations.

def tests_rel_indexed_children(self): (source)

Test matching nodes based on their index in their parent node.