Esempio n. 1
0
 def test_to_target_utterance_multiple_occurrences_of_each(self):
     """Test with 2 shortenings, 2 fragments and 2 replacements."""
     utterance = ('yarasam [: yorosom] '
                  '&ab (a)mu:(ğ)ça  &ac yarasam [: yorosom]')
     actual_output = Extractor.to_target_utterance(utterance)
     desired_output = 'yorosom xxx amu:ğça  xxx yorosom'
     self.assertEqual(actual_output, desired_output)
Esempio n. 2
0
    def get_target_utterance(self):
        """Get the target form of the utterance.

        Returns: str
        """
        utterance = self.get_utterance()
        return ActualTargetUtteranceExtractor.to_target_utterance(utterance)
Esempio n. 3
0
 def test_to_target_utterance_one_occurrence_of_each(self):
     """Test with 1 shortening, 1 fragment and 1 replacement."""
     utterance = 'Mu:(ğ)ça &ab yarasam [: yorosom]'
     actual_output = Extractor.to_target_utterance(utterance)
     desired_output = 'Mu:ğça xxx yorosom'
     self.assertEqual(actual_output, desired_output)
Esempio n. 4
0
 def test_to_target_utterance_no_occurrences(self):
     """Test to_target_utterance using an utterance without occurrences."""
     utterance = 'mu:ça yarasam ab yarasam ac'
     actual_output = Extractor.to_target_utterance(utterance)
     desired_output = 'mu:ça yarasam ab yarasam ac'
     self.assertEqual(actual_output, desired_output)
Esempio n. 5
0
 def test_to_target_utterance_empty_string(self):
     utterance = ''
     actual_output = Extractor.to_target_utterance(utterance)
     desired_output = ''
     self.assertEqual(actual_output, desired_output)