• Simple Word Defining Program [Request]
    41 replies, posted
Hey guys, I'm not sure if requests are allowed in this section, but I was wondering if someone would like to make an application for me. All it needs to do is allow me to enter a string of words, and then spit out a .txt file with the word, first definition, etymology, first synonym, and first antonym. I have tried to do something like this, but have utterly failed. It doesn't need to have a GUI or anything, but instructions for command line software would be nice. If anyone is able to do this, I will be infinitely grateful. If not, do you guys have any ideas of programs that can do this / how I could make one? Thanks!
Show us your code.
As in what I have done on the project so far? I don't really have anything tbh. I'm sorry, I should have made that more clear. (I cannot program unfortunately.)
If you can't program, then now's a good a time as any. How much free time do you have for this?
[QUOTE=Jookia;33573048]Show us your code.[/QUOTE] It's a request, he doesn't have any code. I've done something like this for a small project with Garry's Mod, it found synonyms based on the word you gave it: [img]http://puu.sh/2YtE[/img] I'm sure it wouldn't be too hard to add the other parts in.
Jookia: I don't have to much time as of this post, but I am going to attempt to learn when I get more time over next weekend or winter break. PortalGod: That's an awesome start, do you use a dictionary database for it or does it gather info from online? Also, how hard would it be to code it in another language besides Lua?
It looks it up online, but my code can't even work in native lua, let alone an entirely different language. I'll still post the source if it'll help, though
[QUOTE=PortalGod;33573298]It looks it up online, but my code can't even work in native lua, let alone an entirely different language. I'll still post the source if it'll help, though[/QUOTE] Ooh, ok. The source will probably help out if anyone else decides to help out at least. Thanks!
[lua] local function Callback(contents, size) local Synonyms = {} for match in string.gmatch(contents, [[<span class=%"equals%">(.-)</span>]]) do local Commas = string.gmatch(match, "([%a%(%)]+)(,*)") local Vs = string.find(match, "%b()") local Synonym if(string.find(match, ",")) then for Comma in Commas do local CommaParenthesis = string.find(Comma, "%b()") local SynonymWithComma if(CommaParenthesis) then SynonymWithComma = string.sub(Comma, 0, CommaParenthesis - 1) else SynonymWithComma = Comma end end elseif(Vs) then Synonym = string.sub(match, 0, Vs - 1) else Synonym = match end if(Synonym) then table.insert(Synonyms, Synonym) print(Synonym) end end return Synonyms end function FeedMeSynonyms(Word) if not(type(Word) == type("")) then error("bad argument (string expected, got "..type(Word)..")") end http.Get("http://www.synonym.com/synonyms/"..Word.."/", "", Callback) end [/lua]
I'm working something up in Python. [editline]5th December 2011[/editline] Nope.
Oh well, at least you tried, thank you. Would anyone else like to give it a go? I'd really appreciate it.
The problem is that there isn't a good library or webservice that provides a nice, stable AJAX/JSON API. You could try to scrape the info from the webpage of an online service, but that's just gross in every regard and would break whenever the site was modified. I think most people won't want to have to maintain something like that.
[QUOTE=ROBO_DONUT;33575065]The problem is that there isn't a good library or webservice that provides a nice, stable AJAX/JSON API. You could try to scrape the info from the webpage of an online service, but that's just gross in every regard and would break whenever the site was modified. I think most people won't want to have to maintain something like that.[/QUOTE] If someone were to just scrape info from an online webpage, I think Wikitionary would be the best. It also doesn't strike me as a site with an ever-changing layout, as Wikipedia hasn't changed much at all either. It all just comes down to whatever the developer decides he want's to do though. I've tried using automation programs and stuff to no avail, I really need to learn how to program soon :P
Wiktionary is probably the worst option. The pages are all written by hand by users, which means that the layout/format is going to be utterly unpredictable. You need a site that's entirely automated and just takes some entries from an SQL database and spits them onto a page.
Google has a great JSON parser. As for word websites, dictionary.com and or thesaurus.com?
[QUOTE=ROBO_DONUT;33575922]Wiktionary is probably the worst option. The pages are all written by hand by users, which means that the layout/format is going to be utterly unpredictable. You need a site that's entirely automated and just takes some entries from an SQL database and spits them onto a page.[/QUOTE] That makes sense. I did find some free APIs though. This one is a simple API that gives XML results (or so I've read): [url]http://www.abbreviations.com/definitions_api.asp[/url] And this is the dictionary.com one: [url]http://developer.dictionary.com/[/url] EDIT: [QUOTE=Soviet_Banter;33575993]Google has a great JSON parser. As for word websites, dictionary.com and or thesaurus.com?[/QUOTE] That too is a viable option.
what about princetons dictionary? [url]http://wordnetweb.princeton.edu/[/url]
I can't seem to load the page. Does it have etymology and everything? I think that's one of the hardest things to find.
The site is down apparently for a bit. [url]http://wordnet.princeton.edu/wordnet/related-projects/[/url] There are some APIs there. The site will probably come back on later, but there is [url]http://wordnet.princeton.edu/wordnet/download/[/url]
[QUOTE=Map in a box;33580709]The site is down apparently for a bit. [url]http://wordnet.princeton.edu/wordnet/related-projects/[/url] There are some APIs there. The site will probably come back on later, but there is [url]http://wordnet.princeton.edu/wordnet/download/[/url][/QUOTE] Oh, cool. I'll be sure to check it out later today, thanks!
I'll try make something in C#. EDIT: Dictionary.com appears to be the best bet, since it has all the necessary fields (etymology, definition, etc.). I applied for an API key, and apparently I'll receive one in 48 hours once my application is approved.
[QUOTE=Naarkie;33581478]I'll try make something in C#. EDIT: Dictionary.com appears to be the best bet, since it has all the necessary fields (etymology, definition, etc.). I applied for an API key, and apparently I'll receive one in 48 hours once my application is approved.[/QUOTE] Thanks man! I applied for a key last night as well, so if mine is approved first I'll just give it to you.
[QUOTE=Chase827;33588842]Thanks man! I applied for a key last night as well, so if mine is approved first I'll just give it to you.[/QUOTE] Have you received your key? I still haven't, and it's been over 48 hours.
[QUOTE=Naarkie;33625102]Have you received your key? I still haven't, and it's been over 48 hours.[/QUOTE] Mine is active now, I'll PM you it.
Hey guys, is there any progress on this?
[QUOTE=Chase827;33664096]Hey guys, is there any progress on this?[/QUOTE] Still working on a C# version.
[QUOTE=Naarkie;33666877]Still working on a C# version.[/QUOTE] Great! Sorry to have doubted you lol
[QUOTE=Jookia;33573048]Show us your code.[/QUOTE] you think everything is going to steal your password
[QUOTE=marcin1337;33672783]you think everything is going to steal your password[/QUOTE] While I appreciate you're still a bit mad that I asked for code before running a program that required my GMail username and password, I was actually referring to: [QUOTE=Chase827;33572209]I have tried to do something like this, but have utterly failed.[/QUOTE] I was kind of going to help them rather than spoonfeed them.
[QUOTE=marcin1337;33672783]you think everything is going to steal your password[/QUOTE] I think it was perfectly reasonable to ask for the source for something that uses your password, don't get so upset about it and don't bring it to another thread.
Sorry, you need to Log In to post a reply to this thread.