Beispiel #1
0
 def __init__(self):
     super(WikipediaSkill, self).__init__(name="WikipediaSkill")
     self.max_results = int(self.config['max_results'])
     self.max_phrases = int(self.config['max_phrases'])
     self.question = 'Would you like to know more about '  # TODO - i10n
     self.feedback_prefix = read_stripped_lines(join(dirname(__file__), 'dialog', self.lang, 'FeedbackPrefix.dialog'))
     self.feedback_search = read_stripped_lines(join(dirname(__file__), 'dialog', self.lang, 'FeedbackSearch.dialog'))
Beispiel #2
0
 def __init__(self, channels=int(speech_config.get('channels')),
              sample_rate=int(speech_config.get('sample_rate')),
              device_index=None,
              lang=core_config.get('lang')):
     pyee.EventEmitter.__init__(self)
     self.microphone = MutableMicrophone(sample_rate=sample_rate, device_index=device_index)
     self.microphone.CHANNELS = channels
     self.ww_recognizer = wakeword_recognizer.create_recognizer(samprate=sample_rate, lang=lang)
     self.wakeup_recognizer = wakeword_recognizer.create_recognizer(samprate=sample_rate, lang=lang,
                                                                    keyphrase="wake up mycroft")  # TODO - localization
     self.remote_recognizer = Recognizer()
     basedir = os.path.dirname(__file__)
     self.wakeup_words = read_stripped_lines(os.path.join(basedir, 'model', lang, 'WakeUpWord.voc'))
     self.wakeup_prefixes = read_stripped_lines(os.path.join(basedir, 'model', lang, 'PrefixWakeUp.voc'))
     self.state = RecognizerLoopState()
Beispiel #3
0
 def test_read_stripped_lines(self):
     expected = [
         'Once upon a time', 'there was a great Dragon',
         'It was red and cute', 'The end'
     ]
     unstripped_path = join(TestReadFiles.base, 'unstripped_lines.txt')
     self.assertEqual(list(read_stripped_lines(unstripped_path)), expected)
Beispiel #4
0
 def __init__(self):
     super(WikipediaSkill, self).__init__(name="WikipediaSkill")
     self.max_results = self.config['max_results']
     self.max_phrases = self.config['max_phrases']
     self.language = self.config_core.get('lang')[0:2]
     if self.language=="de":
         wiki.set_lang("de")
         self.question = 'Wuerdest du gerne mehr wissen ueber '  # TODO - i10n
     else:
         wiki.set_lang("en")
         self.question = 'Would you like to know more about '
     self.feedback_prefix = read_stripped_lines(
         join(dirname(__file__), 'dialog', self.lang,
              'FeedbackPrefix.dialog'))
     self.feedback_search = read_stripped_lines(
         join(dirname(__file__), 'dialog', self.lang,
              'FeedbackSearch.dialog'))
Beispiel #5
0
 def __init__(self,
              channels=int(speech_config.get('channels')),
              sample_rate=int(speech_config.get('sample_rate')),
              device_index=None,
              lang=core_config.get('lang')):
     pyee.EventEmitter.__init__(self)
     self.microphone = MutableMicrophone(sample_rate=sample_rate,
                                         device_index=device_index)
     self.microphone.CHANNELS = channels
     self.ww_recognizer = wakeword_recognizer.create_recognizer(
         samprate=sample_rate, lang=lang)
     self.wakeup_recognizer = wakeword_recognizer.create_recognizer(
         samprate=sample_rate, lang=lang,
         keyphrase="wake up mycroft")  # TODO - localization
     self.remote_recognizer = Recognizer()
     basedir = os.path.dirname(__file__)
     self.wakeup_words = read_stripped_lines(
         os.path.join(basedir, 'model', lang, 'WakeUpWord.voc'))
     self.wakeup_prefixes = read_stripped_lines(
         os.path.join(basedir, 'model', lang, 'PrefixWakeUp.voc'))
     self.state = RecognizerLoopState()
Beispiel #6
0
 def __init__(self):
     super(RollSkill, self).__init__(name="RollSkill")
     self.feedback = read_stripped_lines(dirname(__file__) +
                                         '/dialog/' + self.lang + '/roll.dialog')
     self.guess = read_stripped_lines(dirname(__file__) +
                                         '/dialog/' + self.lang + '/guess.dialog')