def test_single_morph_unsimilar(self): """Test single_morph_word with unsimilar wword and mword.""" utterance = 'I got to test' morph_tier = 'PRON|I V|have+to V|test' actual_output = TurkishCleaner.single_morph_word(utterance, morph_tier) desired_output = utterance, morph_tier self.assertEqual(actual_output, desired_output)
def test_single_morph_word_empty_utterance(self): """Test single_morph_word with empty utterance.""" utterance = '' morph_tier = 'PRON|I V|have+to V|test' actual_output = TurkishCleaner.single_morph_word(utterance, morph_tier) desired_output = utterance, morph_tier self.assertEqual(actual_output, desired_output)
def test_single_morph_word_underscore(self): """Test single_morph_word with an underscore.""" utterance = 'I have to test' morph_tier = 'PRON|I V|have_to V|test' actual_output = TurkishCleaner.single_morph_word(utterance, morph_tier) desired_output = 'I have_to test', morph_tier self.assertEqual(actual_output, desired_output)
def test_single_morph_word_empty_mor(self): """Test single_morph_word with empty morphology tier.""" utterance = 'I have_to test' morph_tier = '' actual_output = TurkishCleaner.single_morph_word(utterance, morph_tier) desired_output = utterance, morph_tier self.assertEqual(actual_output, desired_output)
def test_single_morph_word_already_joined(self): """Test single_morph_word with already joined complex.""" utterance = 'I have_to test' morph_tier = 'PRON|I V|have+to V|test' actual_output = TurkishCleaner.single_morph_word(utterance, morph_tier) desired_output = utterance, morph_tier self.assertEqual(actual_output, desired_output)
def test_single_morph_word_no_complex_misalignment2(self): """Test single_morph_word with no complex but with misalignment.""" utterance = 'I test' morph_tier = 'PRON|I V|test PRON|it' actual_output = TurkishCleaner.single_morph_word(utterance, morph_tier) desired_output = utterance, morph_tier self.assertEqual(actual_output, desired_output)
def test_single_morph_word_no_join_sep_at_end(self): """Test single_morph_word with no join separator at the end.""" utterance = 'I haveto' morph_tier = 'PRON|I V|have+to' actual_output = TurkishCleaner.single_morph_word(utterance, morph_tier) desired_output = utterance, morph_tier self.assertEqual(actual_output, desired_output)
def test_single_morph_word_multiple_complexes(self): """Test single_morph_word with multiple complexes.""" utterance = 'I have to test and I have to test' morph_tier = 'PRON|I V|have+to V|test CORD|and PRON|I V|have+to V|test' actual_output = TurkishCleaner.single_morph_word(utterance, morph_tier) desired_output = 'I have_to test and I have_to test', morph_tier self.assertEqual(actual_output, desired_output)