def test_separate_morph_word_multiple_complexes(self): """Test separate_morph_word with multiple complexes.""" utterance = 'bla tu+ta tu_ta' mor_tier = 'N|bla V|N|tu_V|ta V|N|tu+V|ta' actual_output = TurkishCleaner.separate_morph_word(utterance, mor_tier) desired_output = 'bla tu ta tu ta', 'N|bla N|tu V|ta N|tu V|ta' self.assertEqual(actual_output, desired_output)
def test_separate_morph_word_no_join_sep(self): """Test separate_morph_word with no join separator.""" utterance = 'bla tuta bla' mor_tier = 'N|bla V|N|tu_V|ta N|bla' actual_output = TurkishCleaner.separate_morph_word(utterance, mor_tier) desired_output = utterance, 'N|bla N|tu V|ta N|bla' self.assertEqual(actual_output, desired_output)
def test_separate_morph_word_empty_utterance(self): """Test separate_morph_word with empty utterance.""" utterance = '' mor_tier = 'N|bla V|N|tu_V|ta N|bla' actual_output = TurkishCleaner.separate_morph_word(utterance, mor_tier) desired_output = utterance, mor_tier self.assertEqual(actual_output, desired_output)
def test_separate_morph_word_empty_mor(self): """Test separate_morph_word with empty morphology tier.""" utterance = 'I have_to test' mor_tier = '' actual_output = TurkishCleaner.separate_morph_word(utterance, mor_tier) desired_output = utterance, mor_tier self.assertEqual(actual_output, desired_output)
def test_separate_morph_word_no_complex_misalignment2(self): """Test separate_morph_word with no complex but with misalignment.""" utterance = 'I test' mor_tier = 'PRON|I V|test PRON|it' actual_output = TurkishCleaner.separate_morph_word(utterance, mor_tier) desired_output = utterance, mor_tier self.assertEqual(actual_output, desired_output)
def test_separate_morph_word_with_suffixes(self): """Test separate_morph_word with suffixes.""" utterance = 'bla tuu_taa bla' mor_tier = 'N|bla V|N|tu-U_V|ta-A N|bla' actual_output = TurkishCleaner.separate_morph_word(utterance, mor_tier) desired_output = 'bla tuu taa bla', 'N|bla N|tu-U V|ta-A N|bla' self.assertEqual(actual_output, desired_output)
def test_separate_morph_word_plus(self): """Test separate_morph_word with plus.""" utterance = 'bla tu+ta bla' mor_tier = 'N|bla V|N|tu+V|ta N|bla' actual_output = TurkishCleaner.separate_morph_word(utterance, mor_tier) desired_output = 'bla tu ta bla', 'N|bla N|tu V|ta N|bla' self.assertEqual(actual_output, desired_output)