NLTK Guides: Demonstration Code and Regression Tests

These files serve two purposes. First, they demonstrate to use NLTK to perform a variety of tasks. And second, they act as a regression test suite, to ensure that new bugs are not accidentally introduced into NLTK.

Each file typically begins with a description of the topic(s) covered by that file, followed by several sections containing explanatory examples. These examples should be helpful to anyone who wants to learn more about specific pieces of NLTK.

These explanatory sections are followed by "regression test" sections, which are meant to verify that NLTK's implementation is functioning properly. These sections tend to explore NLTK's behavior in a variety of exceptional cases. The "regression test" sections may be useful to NLTK users, but are mainly intended for testing purposes. In order to help develop complete test sets, we automatically determine which parts of NLTK's source code are covered by tests. Our goal is to have 100% coverage for all modules.

Topic Lines Tests Test Outcome
Chat-80 230 35 3 tests failed!
Chunking 370 80 0 tests failed!
Classifiers 130 16 1 test failed!
Collocations 250 60 1 test failed!
Combinatory Categorial Grammar 270 19 1 test failed!
Corpus Readers 2,200 440 2 tests failed!
Dependency Grammars 110 16 0 tests failed!
Discourse Checking 500 50 4 tests failed!
Discourse Representation Theory 320 100 0 tests failed!
EasyInstall Tests 70 22 0 tests failed!
Examples for Portuguese Processing 320 60 1 test failed!
Feature Grammar Parsing 600 80 0 tests failed!
Feature Structures & Unification 1,200 340 0 tests failed!
Glue Semantics 420 150 9 tests failed!
Information Extraction 260 26 1 test failed!
Loading Resources From the Data Package 290 60 0 tests failed!
Logic & Lambda Calculus 800 380 0 tests failed!
Logical Inference and Model Building 500 90 0 tests failed!
Metrics 190 33 0 tests failed!
Nonmonotonic Reasoning 280 120 0 tests failed!
Parsing 1,000 100 0 tests failed!
Probability 90 25 1 test failed!
Resolution Theorem Prover 210 90 0 tests failed!
Semantics 700 130 0 tests failed!
Stemmers 160 50 0 tests failed!
Taggers 420 70 0 tests failed!
Test Suites for Grammars 100 16 0 tests failed!
Tokenizers 310 60 0 tests failed!
Unit test cases for ''toolbox'' 300 110 0 tests failed!
Unit test cases for ''toolbox'' 13 4 2 tests failed!
Unit tests for nltk.tree.Tree 1,100 290 0 tests failed!
Unit tests for the TreeTransformation class 150 23 0 tests failed!
Unit tests for the miscellaneous sort functions. 110 19 0 tests failed!
Unit tests for the nltk.utilities module 150 48 0 tests failed!
WordNet Interface 370 80 0 tests failed!

Return to the NLTK Homepage