Example #1
0
 def __init__(self, text, locale='en_GB'):
     TextAnalyzer.__init__(self, text, locale)
     self.setTextScores()
     self.reading_ease = 206.835 - (1.015 * self.scores['sentlen_average']
                                    ) - (84.6 *
                                         self.scores['wordlen_average'])
     self.min_age = None
Example #2
0
	def __init__(self, text, locale='en_GB'):
		TextAnalyzer.__init__(self,text,locale)
		self.setTextScores()
		self.avi = 0
		self.readingindex = 0
		self.setReadingIndex()
		self.setAvi()
		self.setMinimumAge()
Example #3
0
 def __init__(self, text, locale='en_GB'):
     TextAnalyzer.__init__(self, text, locale)
     self.setTextScores()
     self.avi = 0
     self.readingindex = 0
     self.setReadingIndex()
     self.setAvi()
     self.setMinimumAge()
 def __init__(self, text, locale='en_GB', simplewordlist=[]):
     TextAnalyzer.__init__(self, text, locale)
     self.setSimpleWordsList(simplewordlist)
     self.setTextScores()
     self.readingindex = 0
     self.us_grade = 0
     self.setReadingIndex()
     self.setGrade()
     self.min_age = getMinimumAgeFromUsGrade(self.us_grade)
Example #5
0
 def __init__(self, text, locale='en_GB', simplewordlist=[]):
     TextAnalyzer.__init__(self,text,locale)
     self.setSimpleWordsList(simplewordlist)
     self.setTextScores()
     self.readingindex = 0
     self.us_grade = 0
     self.setReadingIndex()
     self.setGrade()
     self.min_age = getMinimumAgeFromUsGrade(self.us_grade)
 def __init__(self, text, locale='en_GB'):
     TextAnalyzer.__init__(self,text,locale)
     self.setTextScores()
     self.us_grade = 0
     self.setGrade()
     self.min_age = getMinimumAgeFromUsGrade(self.us_grade)
Example #7
0
 def __init__(self, text, locale='en_GB'):
     TextAnalyzer.__init__(self,text,locale)
     self.setTextScores()
     self.reading_ease = 206.835 - ( 1.015 * self.scores['sentlen_average'] ) - ( 84.6 * self.scores['wordlen_average'] )
     self.min_age = None
 def __init__(self, text, locale='en_GB'):
     TextAnalyzer.__init__(self,text,locale)
     self.setTextScores()
     self.us_grade = 0
     self.setGrade()
     self.min_age = getMinimumAgeFromUsGrade(self.us_grade)
Example #9
0
 def test_short_locale(self):
     with self.assertRaises(LookupError):
         t = TextAnalyzer("some text","e")
Example #10
0
 def test_incorrect_locale(self):
     with self.assertRaises(LookupError):
         t = TextAnalyzer("some text","bad_locale")
Example #11
0
 def test_tokenize_language_exotic(self):
     t = TextAnalyzer("some text","zu_ZA")
     self.assertEqual(t.tokenize_language,"english","default tokenize_language should be english")
Example #12
0
 def test_tokenize_language_custom(self):
     t = TextAnalyzer("some text","nl_NL")
     self.assertEqual(t.tokenize_language,"dutch","set tokenize_language should be dutch")
Example #13
0
 def test_bad_simpleword_list(self):
     t = TextAnalyzer("some text")
     with self.assertRaises(ValueError):
         t.setSimpleWordsList("this string")
Example #14
0
 def test_correct_locale(self):
     try:
         t = TextAnalyzer("some text","nl_NL")
     except:
         fk = None
     self.assertTrue(hasattr(t,"scores"),"text analyzer not made with non default but correct locale")