nltk.test.unit package

Submodules

nltk.test.unit.test_2x_compat module

Unit tests for nltk.compat. See also nltk/test/compat.doctest.

class nltk.test.unit.test_2x_compat.TestTextTransliteration(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_repr()[source]
test_str()[source]
txt = <Text: São Tomé and Príncipe...>
nltk.test.unit.test_2x_compat.setup_module(module)[source]

nltk.test.unit.test_classify module

Unit tests for nltk.classify. See also: nltk/test/classify.doctest

nltk.test.unit.test_classify.assert_classifier_correct(algorithm)[source]
nltk.test.unit.test_classify.test_megam()[source]
nltk.test.unit.test_classify.test_tadm()[source]

nltk.test.unit.test_collocations module

nltk.test.unit.test_collocations.close_enough(x, y)[source]

Verify that two sequences of n-gram association values are within _EPSILON of each other.

nltk.test.unit.test_collocations.test_bigram2()[source]
nltk.test.unit.test_collocations.test_bigram3()[source]
nltk.test.unit.test_collocations.test_bigram5()[source]

nltk.test.unit.test_corpora module

class nltk.test.unit.test_corpora.TestCess(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_catalan()[source]
test_esp()[source]
class nltk.test.unit.test_corpora.TestCoNLL2007(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_parsed_sents()[source]
test_sents()[source]
class nltk.test.unit.test_corpora.TestFloresta(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_words()[source]
class nltk.test.unit.test_corpora.TestIndian(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_tagged_words()[source]
test_words()[source]
class nltk.test.unit.test_corpora.TestPTB(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_categories()[source]
test_category_words()[source]
test_fileids()[source]
test_news_fileids()[source]
test_tagged_words()[source]
test_words()[source]
class nltk.test.unit.test_corpora.TestSinicaTreebank(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_parsed_sents()[source]
test_sents()[source]
class nltk.test.unit.test_corpora.TestUdhr(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_raw_unicode()[source]
test_words()[source]

nltk.test.unit.test_corpus_views module

Corpus View Regression Tests

class nltk.test.unit.test_corpus_views.TestCorpusViews(methodName='runTest')[source]

Bases: unittest.case.TestCase

data()[source]
linetok = <nltk.tokenize.simple.LineTokenizer object at 0x15395afd0>
names = ['corpora/inaugural/README', 'corpora/inaugural/1793-Washington.txt', 'corpora/inaugural/1909-Taft.txt']
test_correct_length()[source]
test_correct_values()[source]

nltk.test.unit.test_hmm module

nltk.test.unit.test_hmm.setup_module(module)[source]
nltk.test.unit.test_hmm.test_backward_probability()[source]
nltk.test.unit.test_hmm.test_forward_probability()[source]
nltk.test.unit.test_hmm.test_forward_probability2()[source]

nltk.test.unit.test_naivebayes module

class nltk.test.unit.test_naivebayes.NaiveBayesClassifierTest(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_simple()[source]

nltk.test.unit.test_seekable_unicode_stream_reader module

The following test performs a random series of reads, seeks, and tells, and checks that the results are consistent.

nltk.test.unit.test_seekable_unicode_stream_reader.check_reader(unicode_string, encoding, n=1000)[source]
nltk.test.unit.test_seekable_unicode_stream_reader.teardown_module(module=None)[source]
nltk.test.unit.test_seekable_unicode_stream_reader.test_reader()[source]
nltk.test.unit.test_seekable_unicode_stream_reader.test_reader_on_large_string()[source]

nltk.test.unit.test_stem module

class nltk.test.unit.test_stem.SnowballTest(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_german()[source]
test_russian()[source]
test_short_strings_bug()[source]

nltk.test.unit.test_tag module

nltk.test.unit.test_tag.setup_module(module)[source]
nltk.test.unit.test_tag.test_basic()[source]

nltk.test.unit.utils module

nltk.test.unit.utils.skip(reason)[source]

Unconditionally skip a test.

nltk.test.unit.utils.skipIf(condition, reason)[source]

Skip a test if the condition is true.

Module contents