Beispiel #1
0
 def test_moses_detruecase_allcaps(self):
     moses = MosesDetruecaser()
     text = "MLB Baseball standings"
     expected = ["MLB", "Baseball", "standings"]
     expected_str = "MLB Baseball standings"
     assert moses.detruecase(text) == expected
     assert moses.detruecase(text, return_str=True) == expected_str
Beispiel #2
0
 def test_moses_detruecase_str(self):
     moses = MosesDetruecaser()
     text = 'the adventures of Sherlock Holmes'
     expected = ['The', 'adventures', 'of', 'Sherlock', 'Holmes']
     expected_str = 'The adventures of Sherlock Holmes'
     assert moses.detruecase(text) == expected
     assert moses.detruecase(text, return_str=True) == expected_str
Beispiel #3
0
 def test_moses_detruecase_headline(self):
     moses = MosesDetruecaser()
     text = "the adventures of Sherlock Holmes"
     expected = ["The", "Adventures", "of", "Sherlock", "Holmes"]
     expected_str = "The Adventures of Sherlock Holmes"
     assert moses.detruecase(text, is_headline=True) == expected
     assert moses.detruecase(text, is_headline=True, return_str=True) == expected_str