Results 1 to 3 of 3
-
8th Jan 2010, 12:46 PM #1OPThe Wise OneWebsite's:
twilight.ws ddlrank.com[Python] Simple Spellcheck Program
This is a simple application that I had to make during the exam today. Basically what it does is do a spell check for 2 or more words. This is done by using Google (the more results your word has, the correcter it is)
Before you can work with the app below you have to download the xgoogle module, which can be found here.
Simply extract it, and put your python file (that we are going to make in a bit), in the same place as the location of your xgoogle folder. So do not place it inside the xgoogle folder.
Here is the code of the spellchecker.py file:
Code:#!/usr/bin/python from xgoogle.search import GoogleSearch, SearchError import sys highest = -1 winner = "" filename = sys.argv[0] if sys.argv != "" and len(sys.argv) > 1: for word in sys.argv: if word != filename: try: gs = GoogleSearch(word) gs.results_per_page = 50 results = gs.get_results() amount = gs.num_results print "Results for " + word + ": " + str(amount) if(highest <= amount): highest = amount winner = word except SearchError, e: print "Search failed: %s" % e else: input = raw_input('Enter your spellcheck words seperated by a comma:\n') words = input.split(",") for word in words: try: gs = GoogleSearch(word) gs.results_per_page = 50 results = gs.get_results() amount = gs.num_results print "Results for " + word + ": " + str(amount) if(highest <= amount): highest = amount winner = word except SearchError, e: print "Search failed: %s" % e print "And the most likely correct word is: " + winner
1) run ./spellchecker.py word1 word2
2)run ./spellchecker.py
1st option will check word1 and word2 and the 2nd option will ask you to enter a lis tof words, comma seperated
Hope this could come in use
EDIT: have a look at this too if you would like to use xgoogle for more features like search engine ranking or w/eWhoo Reviewed by Whoo on . [Python] Simple Spellcheck Program This is a simple application that I had to make during the exam today. Basically what it does is do a spell check for 2 or more words. This is done by using Google (the more results your word has, the correcter it is) Before you can work with the app below you have to download the xgoogle module, which can be found here. Simply extract it, and put your python file (that we are going to make in a bit), in the same place as the location of your xgoogle folder. So do not place it inside the Rating: 5I can always be contacted by sending a tweet @twilightws
-
8th Jan 2010, 12:47 PM #2MemberWebsite's:
eih.bz pornDDL.me sexytattoochicks.tumblr.com
-
8th Jan 2010, 12:51 PM #3Member
Nice ..
Good Job !Coding Horror Fan
I don't read PM's frequently .
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
FileDownloads.org - Simple Pay-Per-Download Program
By FileHosting in forum File Hosts Official SupportReplies: 505Last Post: 17th Nov 2012, 01:00 PM -
[Hiring] Need Coder, Need Simple Program (Windows App)
By digimon in forum ServicesReplies: 4Last Post: 13th May 2012, 01:18 PM -
[Official] Tinyr.org Affiliate Program | Earn money by completing simple tasks!
By Tinyr.org in forum Affiliate Programs PromotionReplies: 11Last Post: 26th Feb 2012, 10:32 PM -
Not Selected for The Program (MEPI- Student Leaders Program)!!
By DoctorX in forum General DiscussionReplies: 0Last Post: 9th Feb 2011, 04:29 PM -
Need some invoice program source code/or program only
By Nikolasr in forum Webmaster DiscussionReplies: 2Last Post: 1st Feb 2010, 10:55 AM
themaRegister - register to forums...
Version 3.54 released. Open older version (or...