Esempio n. 1
0
 def test_pruneUnnecessaryPhrases(self):
     phraseTextToPhraseObjectMap = {
         'dsf':
         Phrase(
             'dsf', test_time -
             3 * stream_settings['max_phrase_inactivity_time_in_seconds'],
             1),
         'abc':
         Phrase('abc', test_time, 1)
     }
     UtilityMethods.pruneUnnecessaryPhrases(
         phraseTextToPhraseObjectMap, test_time,
         UtilityMethods.pruningConditionRandom, **stream_settings)
     self.assertTrue('dsf' not in phraseTextToPhraseObjectMap)
     self.assertTrue('abc' in phraseTextToPhraseObjectMap)
 def test_pruneUnnecessaryPhrases(self):
     phraseTextToPhraseObjectMap = {'dsf': Phrase('dsf', test_time-3*stream_settings['max_phrase_inactivity_time_in_seconds'], 1), 'abc': Phrase('abc', test_time, 1)}
     UtilityMethods.pruneUnnecessaryPhrases(phraseTextToPhraseObjectMap, test_time, UtilityMethods.pruningConditionRandom, **stream_settings)
     self.assertTrue('dsf' not in phraseTextToPhraseObjectMap)
     self.assertTrue('abc' in phraseTextToPhraseObjectMap)