Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

aa

  • Loading branch information...
commit f8db69addc23757da0c06b02a510a71960e34fe0 1 parent d2d99dc
Guy Hizkiau authored
Showing with 13 additions and 6 deletions.
  1. +7 −4 tests/st_text_filter.py
  2. +6 −2 tests/test_steam.py
View
11 tests/st_text_filter.py
@@ -6,13 +6,14 @@
import unittest
from distutils import text_file
import s_text_filter
+import re
class Test(unittest.TestCase):
-
+
def setUp(self):
- pass
+ self.word_pattern = re.compile(r'[a-z]{3,}')
def tearDown(self):
@@ -40,8 +41,10 @@ def test_suffix_stem_complex_example4(self):
terms = ['inging']
self.assertEqual(s_text_filter.suffix_stem(terms), ['ing'])
- def test_suffix_stem_normal_words(self):
- pass
+ def test_suffix_stem_dont_lose_words(self):
+ terms = re.findall(self.word_pattern, text.lower())
+ for f in self.filter_func_list:
+ terms = f(terms)
def test_word_list_filter1(self):
print '== test_word_list_filter1 =='
View
8 tests/test_steam.py
@@ -224,7 +224,7 @@
Great little audio video device
'''
-def main():
+def main1():
terms = word_filter(the_text)
print "======== Terms ==========="
for t in terms: print t
@@ -234,7 +234,11 @@ def main():
print "======== Filteres ==========="
for t in terms: print t
-
+def main():
+ terms = word_filter(the_text)
+ terms1 = suffix_stem(terms)
+ print len(terms), len(terms1)
+ assert len(terms) == len(terms1)
if __name__ == '__main__':
main()
Please sign in to comment.
Something went wrong with that request. Please try again.