Esempio n. 1
0
 def test_no_punctuation(self):
     doc = 'I want some Thai food'
     sentences = snippets._split_into_sentences(doc)
     assert sentences == ['I want some Thai food']
Esempio n. 2
0
 def test_double_period(self):
     doc = 'I am tired. Go away.'
     sentences = snippets._split_into_sentences(doc) 
     assert sentences == ['I am tired.', 'Go away.']
Esempio n. 3
0
 def test_dollar_sign(self):
     doc = 'I paid $2.34 for it.'
     sentences = snippets._split_into_sentences(doc)
     print sentences
     assert sentences == ['I paid $2.34 for it.']
Esempio n. 4
0
 def test_double_marks(self):
     doc = 'I am tired! Would you leave?'
     sentences = snippets._split_into_sentences(doc) 
     assert sentences == ['I am tired!', 'Would you leave?']
Esempio n. 5
0
 def test_double_ellipsis(self):
     doc = 'Well whatever... Yeah whatever...'
     sentences = snippets._split_into_sentences(doc) 
     print sentences
     assert sentences == ['Well whatever...', 'Yeah whatever...']
Esempio n. 6
0
 def test_single_ellipsis(self):
     doc = 'The food was alright...'
     sentences = snippets._split_into_sentences(doc) 
     assert sentences == ['The food was alright...']
Esempio n. 7
0
 def test_single_exclamationmark(self):
     doc = 'Of course I do!'
     sentences = snippets._split_into_sentences(doc) 
     assert sentences == ['Of course I do!']
Esempio n. 8
0
 def test_single_questionmark(self):
     doc = 'You like my hat?'
     sentences = snippets._split_into_sentences(doc) 
     assert sentences == ['You like my hat?']
Esempio n. 9
0
 def test_single_with_comma(self):
     doc = 'I like apples, oranges, and peas.'
     sentences = snippets._split_into_sentences(doc) 
     assert sentences == ['I like apples, oranges, and peas.']
Esempio n. 10
0
 def test_single_period(self):
     doc = 'That sure is a nice hat.'
     assert len(snippets._split_into_sentences(doc)) == 1