Commit dad261b1 authored by Shane Hathaway's avatar Shane Hathaway

Expanded the test slightly

parent 324922bb
...@@ -30,12 +30,14 @@ class UnicodeSplitterTests(unittest.TestCase): ...@@ -30,12 +30,14 @@ class UnicodeSplitterTests(unittest.TestCase):
def testStopwords(self): def testStopwords(self):
""" testing splitter with stopwords """ """ testing splitter with stopwords """
text = 'The quick brown fox jumps over the lazy dog' 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'] expected = [ u'quick',u'brown',u'fox',u'jumps',u'over',u'lazy',u'cat']
sw_dict = {'the':None,'dog':'fox'} sw_dict = {'the':None,'dog':'cat'}
fields = list(UnicodeSplitter(text,sw_dict)) splitter = UnicodeSplitter(text,sw_dict)
self.assertEquals( fields, expected ) fields = list(splitter)
self.assertEquals(fields, expected)
self.assertEquals(splitter.indexes('jumps'), [3])
def test_suite(): 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