Exemplo 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']
Exemplo 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.']
Exemplo 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.']
Exemplo 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?']
Exemplo 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...']
Exemplo 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...']
Exemplo 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!']
Exemplo 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?']
Exemplo 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.']
Exemplo n.º 10
0
 def test_single_period(self):
     doc = 'That sure is a nice hat.'
     assert len(snippets._split_into_sentences(doc)) == 1