Пример #1
0
 def test_get_id_tier_key_does_not_exist(self):
     rec_dict = {}
     actual_output = ChintangReader.get_id_tier(rec_dict)
     desired_output = ''
     self.assertEqual(actual_output, desired_output)
Пример #2
0
 def get_record_reader(self):
     return ChintangReader()
Пример #3
0
 def test_get_childdirected_key_does_not_exist(self):
     rec_dict = {}
     output = ChintangReader.get_childdirected(rec_dict)
     self.assertIsNone(output)
Пример #4
0
 def test_get_id_tier_key_exists(self):
     rec_dict = {'id': 3}
     actual_output = ChintangReader.get_id_tier(rec_dict)
     desired_output = 3
     self.assertEqual(actual_output, desired_output)
Пример #5
0
 def test_get_childdirected_TOS_childdirected(self):
     rec_dict = {'TOS': 'this is directed to a child'}
     output = ChintangReader.get_childdirected(rec_dict)
     self.assertTrue(output)
Пример #6
0
 def test_get_childdirected_TOS_not_childdirected(self):
     rec_dict = {'TOS': 'this is directed to an adult'}
     output = ChintangReader.get_childdirected(rec_dict)
     self.assertFalse(output)
Пример #7
0
 def test_get_utterance_raw_key_exists(self):
     rec_dict = {'gw': 'the raw utterance .'}
     actual_output = ChintangReader.get_actual_utterance(rec_dict)
     desired_output = 'the raw utterance .'
     self.assertEqual(actual_output, desired_output)
Пример #8
0
 def test_get_lang_tier_key_exists(self):
     rec_dict = {'lg': 'the lang tier .'}
     actual_output = ChintangReader.get_lang_tier(rec_dict)
     desired_output = 'the lang tier .'
     self.assertEqual(actual_output, desired_output)
Пример #9
0
 def test_get_ids(self):
     id_word = 'w1pfx-   w1stem   -w1sfx w2stem -w2sfx'
     actual_output = ChintangReader.get_id_words(id_word)
     desired_output = ['w1pfx-   w1stem   -w1sfx', 'w2stem -w2sfx']
     self.assertEqual(actual_output, desired_output)
Пример #10
0
 def test_get_id_words_empty_string(self):
     id_tier = ''
     actual_output = ChintangReader.get_id_words(id_tier)
     desired_output = []
     self.assertEqual(actual_output, desired_output)
Пример #11
0
 def test_get_id_words_two_morpheme_words(self):
     id_tier = 'w1pfxseg-   w1stemseg   -w1sfxseg    w2stemseg'
     actual_output = ChintangReader.get_id_words(id_tier)
     desired_output = ['w1pfxseg-   w1stemseg   -w1sfxseg', 'w2stemseg']
     self.assertEqual(actual_output, desired_output)