def test_no_punctuation(self): doc = 'I want some Thai food' sentences = snippets._split_into_sentences(doc) assert sentences == ['I want some Thai food']
def test_double_period(self): doc = 'I am tired. Go away.' sentences = snippets._split_into_sentences(doc) assert sentences == ['I am tired.', 'Go away.']
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.']
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?']
def test_double_ellipsis(self): doc = 'Well whatever... Yeah whatever...' sentences = snippets._split_into_sentences(doc) print sentences assert sentences == ['Well whatever...', 'Yeah whatever...']
def test_single_ellipsis(self): doc = 'The food was alright...' sentences = snippets._split_into_sentences(doc) assert sentences == ['The food was alright...']
def test_single_exclamationmark(self): doc = 'Of course I do!' sentences = snippets._split_into_sentences(doc) assert sentences == ['Of course I do!']
def test_single_questionmark(self): doc = 'You like my hat?' sentences = snippets._split_into_sentences(doc) assert sentences == ['You like my hat?']
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.']
def test_single_period(self): doc = 'That sure is a nice hat.' assert len(snippets._split_into_sentences(doc)) == 1