nltk.test.unit.test_stem module

class nltk.test.unit.test_stem.SnowballTest[source]

Bases: TestCase

test_arabic()[source]

this unit testing for test the snowball arabic light stemmer this stemmer deals with prefixes and suffixes

test_russian()[source]
test_german()[source]
test_spanish()[source]
test_short_strings_bug()[source]
class nltk.test.unit.test_stem.PorterTest[source]

Bases: TestCase

test_vocabulary_martin_mode()[source]

Tests all words from the test vocabulary provided by M Porter

The sample vocabulary and output were sourced from https://tartarus.org/martin/PorterStemmer/voc.txt and https://tartarus.org/martin/PorterStemmer/output.txt and are linked to from the Porter Stemmer algorithm’s homepage at https://tartarus.org/martin/PorterStemmer/

test_vocabulary_nltk_mode()[source]
test_vocabulary_original_mode()[source]
test_oed_bug()[source]

Test for bug https://github.com/nltk/nltk/issues/1581

Ensures that ‘oed’ can be stemmed without throwing an error.

test_lowercase_option()[source]

Test for improvement on https://github.com/nltk/nltk/issues/2507

Ensures that stems are lowercased when to_lowercase=True