Exemple #1
0
 def test_translate(self):
     blob = tb.Sentence("This is a sentence.")
     translated = blob.translate(to="es")
     assert_true(isinstance(translated, tb.Sentence))
     assert_equal(translated, "Esta es una frase.")
Exemple #2
0
 def test_correct(self):
     blob = tb.Sentence("I havv bad speling.")
     assert_true(isinstance(blob.correct(), tb.Sentence))
     assert_equal(blob.correct(), tb.Sentence("I have bad spelling."))
Exemple #3
0
 def setUp(self):
     self.raw_sentence = \
         'Any place with frites and Belgian beer has my vote.'
     self.sentence = tb.Sentence(self.raw_sentence)