def test_get_actual_utterance_multiple_occurences_of_each(self): """Test with 2 shortenings, 2 fragments and 2 replacements.""" utterance = ('(A)mu:(ğ)ça yarasam [: yorosom] ' '&ab yarasam [: yorosom] &ac') actual_output = Extractor.to_actual_utterance(utterance) desired_output = 'mu:ça yarasam ab yarasam ac' self.assertEqual(actual_output, desired_output)
def get_actual_utterance(self): """Get the actual form of the utterance. Returns: str """ utterance = self.get_utterance() return ActualTargetUtteranceExtractor.to_actual_utterance(utterance)
def test_get_actual_utterance_nesting(self): """Test with nesting.""" utterance = '<it shoulda[: should have]> [<2] ?' actual_output = Extractor.to_actual_utterance(utterance) desired_output = '<it shoulda> [<2] ?' self.assertEqual(actual_output, desired_output)
def test_get_actual_utterance_one_occurence_of_each(self): """Test with 1 shortening, 1 fragment and 1 replacement.""" utterance = 'Mu:(ğ)ça &ab yarasam [: yorosom]' actual_output = Extractor.to_actual_utterance(utterance) desired_output = 'Mu:ça ab yarasam' self.assertEqual(actual_output, desired_output)
def test_get_actual_utterance_no_occurrences(self): """Test get_actual_utterance using an utt without occurrences.""" utterance = 'mu:ça yarasam ab yarasam ac' actual_output = Extractor.to_actual_utterance(utterance) desired_output = 'mu:ça yarasam ab yarasam ac' self.assertEqual(actual_output, desired_output)
def test_to_actual_utterance_empty_string(self): utterance = '' actual_output = Extractor.to_actual_utterance(utterance) desired_output = '' self.assertEqual(actual_output, desired_output)