当前位置: 首页>>代码示例>>Python>>正文


Python PyDictionary.googlemeaning方法代码示例

本文整理汇总了Python中PyDictionary.PyDictionary.googlemeaning方法的典型用法代码示例。如果您正苦于以下问题:Python PyDictionary.googlemeaning方法的具体用法?Python PyDictionary.googlemeaning怎么用?Python PyDictionary.googlemeaning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyDictionary.PyDictionary的用法示例。


在下文中一共展示了PyDictionary.googlemeaning方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: pieceOfLyric

# 需要导入模块: from PyDictionary import PyDictionary [as 别名]
# 或者: from PyDictionary.PyDictionary import googlemeaning [as 别名]
 def pieceOfLyric(self, video, numWord): 
     """ Para la que la Api de MusixMatch funcione solo neceisita un trozo de la letra con palabras
         relevantes, por ello se usa pieceLyric. Que se queda con las palabras mayores de tres letras"""
     
     lyric = self.scanOCR(video) 
     searchLyric = lyric[100:]
     searchLyriclist = searchLyric.split()
     listLyric = ""
     lenLyriclist = len(searchLyriclist)
     count = 0
     countlen = 0
     dictionary=PyDictionary()
     while (count <= numWord) and (countlen < lenLyriclist):
         # El numero de letras por palabra es mayor de dos
         if len(searchLyriclist[countlen]) > 2:
             if searchLyriclist[countlen] not in listLyric:
                 #Busca si la palabra existe en google
                 if dictionary.googlemeaning(searchLyriclist[countlen]):
                     listLyric = listLyric + " " + searchLyriclist[countlen]
                     count += 1
         countlen += 1
     return listLyric
开发者ID:vtinoco,项目名称:TFM,代码行数:24,代码来源:karaokeSearch.py

示例2: print

# 需要导入模块: from PyDictionary import PyDictionary [as 别名]
# 或者: from PyDictionary.PyDictionary import googlemeaning [as 别名]
dictionary=PyDictionary()

r = sr.Recognizer()
m = sr.Microphone()


print("A moment of silence, please...")
with m as source: r.adjust_for_ambient_noise(source)
print("Set minimum energy threshold to {}".format(r.energy_threshold))

print("Say The Word....")
with m as source: audio = r.listen(source)
print("Got it! Now to recognize it...")
try:
    # recognize speech using Google Speech Recognition
    value = r.recognize_google(audio)
    word=str(value)
    print word
    word=word.replace(' ','')
    print word

except sr.UnknownValueError:
    print("Oops! Didn't catch that")
except sr.RequestError as e:
    print("Plese Check your internet Connection")
if(type(None)!=type(dictionary.googlemeaning(word))):

	print('\n\n\n'+dictionary.googlemeaning(word))
else:
	print "Even Google Doesn't Know Its Meaning ...!!!!!!!"
开发者ID:bharathyp,项目名称:test,代码行数:32,代码来源:speech.py


注:本文中的PyDictionary.PyDictionary.googlemeaning方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。