def testSpellingLong(self):
     """--spelling should check spelling"""
     google.main(["--spelling", self.phrase])
     commandLineAnswer = self.lastOutput()
     google._output(google.doSpellingSuggestion(self.phrase),
                    self.spellingparams)
     self.assertEqual(commandLineAnswer, self.lastOutput())
Example #2
0
 def handleCommand(self, bot, nick, channel, argument=None):
     if argument is None:
         return
     try:
         data = google.doSpellingSuggestion(argument)
     except:
         bot.msg(channel, 'Exception in google.doSpellingSuggestion()')
         return
     if data is not None: bot.msg(channel, data)
     else: bot.msg(channel, 'Leider nix am Start.')
Example #3
0
def google_spelling(query, destination):
    try:
        data = google.doSpellingSuggestion(query)
        if data != '':
            if option["resultsintab"] == True:
                destination.prnt(data)
            else:
                destination.command("say " + data)
        
    except Exception, args:
        print color["red"], Exception, args
        return        
Example #4
0
def google_spell(word):
	import google
	
	if ord(word[0]) > 128: return ## 한글이면 
	if word.find(' ') != -1: return
	if word.find('-') != -1: return

	key = 'Nx3n4NtQFHJLZCH32gaWjrZsEPiXvRr7'
	suggested = google.doSpellingSuggestion(word, key)

	if suggested !=None:
		print """<br/><font color="red"> <b>대신,  이 단어로  검색해보세요 </b> </font> <font color="green"> <a href="/ad.py?F=3&W=%s"><b>%s</b></a> </font> <br/><br/>""" % (suggested, suggested)
		save_spell(word, suggested)
Example #5
0
def chanmsg_handler(channel, nick, cmd, args):
	g = sys.modules['gg']
	action = ""
	q = " "
	for i in args: q += i+" "
	spell = google.doSpellingSuggestion(q)
	if spell != None:
		action = 'PRIVMSG %s :Perhaps you mean %s?\r\n' % (channel, spell)
		data = google.doGoogleSearch(spell)
		action += 'PRIVMSG %s :Then it would be %s .. else:\r\n' % (channel, data.results[0].URL)	
	data = google.doGoogleSearch(q)
	action += 'PRIVMSG %s :%s\r\n' % (channel, data.results[0].URL)
	return action
Example #6
0
def handler_google_spell(type, source, parameters):
    correction = google.doSpellingSuggestion(parameters)
    if not correction:
        correction = "No Suggestion"
    smsg(type, source, correction)
Example #7
0
def getSpellingsuggestion(qterm):
    r = google.doSpellingSuggestion(qterm)
    return r
Example #8
0
 def doSpellingSuggestion(self, phrase, http_proxy=None):
     #doSpellingSuggestion
     google.setLicense(self.license_key)
     return google.doSpellingSuggestion(phrase, self.license_key,
                                        http_proxy)
Example #9
0
import google

key = 'Nx3n4NtQFHJLZCH32gaWjrZsEPiXvRr7'
word = 'dellight'
suggested = google.doSpellingSuggestion(word, key)
print suggested
Example #10
0
 def doSpellingSuggestion(self, phrase, http_proxy = None):
     google.setLicense( self.license )
     return google.doSpellingSuggestion(phrase, self.license, http_proxy)
Example #11
0
import google

key = "Nx3n4NtQFHJLZCH32gaWjrZsEPiXvRr7"
word = "dellight"
suggested = google.doSpellingSuggestion(word, key)
print suggested
Example #12
0
def getSpellingsuggestion(qterm):
    r = google.doSpellingSuggestion(qterm)
    return r
Example #13
0
def handler_google_spell(type, source, parameters):
    correction = google.doSpellingSuggestion(parameters)
    if not correction:
        correction = 'No Suggestion'
    smsg(type, source, correction)
# GOOGLE Spelling Suggestion (Did you mean?) Example

import google

#  You can retrieve you license key here: https://code.google.com/
google.LICENSE_KEY = '...'

phrase = 'I said something wring'

did_you_mean = google.doSpellingSuggestion(phrase, license_key=None, http_proxy=None)

# Did you mean..
# I said something *wrong*
print(did_you_mean)
Example #15
0
 def testSpellingLong(self):
     """--spelling should check spelling"""
     google.main(["--spelling", self.phrase])
     commandLineAnswer = self.lastOutput()
     google._output(google.doSpellingSuggestion(self.phrase), self.spellingparams)
     self.assertEqual(commandLineAnswer, self.lastOutput())