示例#1
0
    def test_consecutive_spaces_removed(self):
        statement = Statement(
            text='The       quick brown     fox      jumps over the lazy dog.')
        cleaned = preprocessors.clean_whitespace(statement)
        normal_text = 'The quick brown fox jumps over the lazy dog.'

        self.assertEqual(cleaned.text, normal_text)
示例#2
0
    def test_clean_whitespace(self):
        statement = Statement(
            text='\tThe quick \nbrown fox \rjumps over \vthe \alazy \fdog\\.')
        cleaned = preprocessors.clean_whitespace(statement)
        normal_text = 'The quick brown fox jumps over \vthe \alazy \fdog\\.'

        self.assertEqual(cleaned.text, normal_text)
示例#3
0
    def test_leading_or_trailing_whitespace_removed(self):
        statement = Statement(
            '     The quick brown fox jumps over the lazy dog.   ')
        cleaned = preprocessors.clean_whitespace(self.chatbot, statement)
        normal_text = 'The quick brown fox jumps over the lazy dog.'

        self.assertEqual(cleaned.text, normal_text)
    def test_consecutive_spaces_removed(self):
        statement = Statement(text='The       quick brown     fox      jumps over the lazy dog.')
        cleaned = preprocessors.clean_whitespace(statement)
        normal_text = 'The quick brown fox jumps over the lazy dog.'

        self.assertEqual(cleaned.text, normal_text)
    def test_clean_whitespace(self):
        statement = Statement(text='\tThe quick \nbrown fox \rjumps over \vthe \alazy \fdog\\.')
        cleaned = preprocessors.clean_whitespace(statement)
        normal_text = 'The quick brown fox jumps over \vthe \alazy \fdog\\.'

        self.assertEqual(cleaned.text, normal_text)
    def test_leading_or_trailing_whitespace_removed(self):
        statement = Statement(text='     The quick brown fox jumps over the lazy dog.   ')
        cleaned = preprocessors.clean_whitespace(self.chatbot, statement)
        normal_text = 'The quick brown fox jumps over the lazy dog.'

        self.assertEqual(cleaned.text, normal_text)