Exemplo n.º 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
Exemplo n.º 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()
Exemplo n.º 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()
Exemplo n.º 4
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)
Exemplo n.º 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)
Exemplo n.º 6
0
 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)
Exemplo n.º 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)
Exemplo n.º 9
0
 def test_short_locale(self):
     with self.assertRaises(LookupError):
         t = TextAnalyzer("some text","e")
Exemplo n.º 10
0
 def test_incorrect_locale(self):
     with self.assertRaises(LookupError):
         t = TextAnalyzer("some text","bad_locale")
Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 13
0
 def test_bad_simpleword_list(self):
     t = TextAnalyzer("some text")
     with self.assertRaises(ValueError):
         t.setSimpleWordsList("this string")
Exemplo n.º 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")