Commit dad261b1 authored by Shane Hathaway's avatar Shane Hathaway

Expanded the test slightly

parent 324922bb
......@@ -30,12 +30,14 @@ class UnicodeSplitterTests(unittest.TestCase):
def testStopwords(self):
""" testing splitter with stopwords """
text = 'The quick brown fox jumps over the lazy dog'
expected = [ u'quick',u'brown',u'fox',u'jumps',u'over',u'lazy',u'fox']
sw_dict = {'the':None,'dog':'fox'}
fields = list(UnicodeSplitter(text,sw_dict))
self.assertEquals( fields, expected )
text = 'The quick brown fox jumps over The lazy dog'
expected = [ u'quick',u'brown',u'fox',u'jumps',u'over',u'lazy',u'cat']
sw_dict = {'the':None,'dog':'cat'}
splitter = UnicodeSplitter(text,sw_dict)
fields = list(splitter)
self.assertEquals(fields, expected)
self.assertEquals(splitter.indexes('jumps'), [3])
def test_suite():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment