Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Plugin: Would anyone benefit from a spell checking plugin?

Author
Message
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 14th May 2017 00:14
While I've been going through some delphi code I have lying around, I came across a fast spell checker which may be of use as a plugin.
Would anyone need such a thing?
Bigsofty
9
Years of Service
User Offline
Joined: 7th Nov 2014
Location:
Posted: 14th May 2017 16:23
It would be cool, always a handy thing to have for word games.
Jack
19
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 14th May 2017 16:44
It would be great for an AI,
so it could only learn correct phrases.

Definitly cool.

[/url]
GameDevGuy
8
Years of Service
User Offline
Joined: 18th Jul 2015
Location:
Posted: 14th May 2017 22:48
It would be cool for word games. This is only at the thinking stage, but I have been wondering whether it would be feasible to create some sort of spell checker in Tier 1 so it would be cross platform?

As I say, haven't actually done anything, but thought it would be an interesting project, if I found the time for it.
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 15th May 2017 19:47
The trick is looking up the words fast enough using an index method.
Also, anything that involves recursion such as a permute function would likely be faster outside of T1, but I would need to try it first.
GameDevGuy
8
Years of Service
User Offline
Joined: 18th Jul 2015
Location:
Posted: 16th May 2017 23:06
I am expecting speed to be an issue with Tier 1 only, but I find when trying to solve such a problem, of getting sufficient performance, it is good exercise for the brain.

For something like this in Tier 1, I am only expecting it to work well on the desktop platforms. (I wouldn't expect mobile devices to have the raw power needed?)

I might try to a "proof of concept" for a 60,000 word dictionary in Tier 1 this weekend.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 17th May 2017 13:59
Quote: "The trick is looking up the words fast enough using an index method."

A binary search would be plenty quick. However, if the word isn't present then calculating the levenshtein distance against the correct word becomes the tricky part.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 17th May 2017 20:24
Hence my question. If it was native, then it would be a big ask on mobiles I feel.
I was thinking mostly for tool development and the fact I have a windows solution ready to "wrap up".

nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 17th May 2017 20:27
I meant to add, there are different approaches. Easy and fast to get "does word exist" but suggesting alternatives is the tricky part.
@GameDevGuy - I'll see what your native POC throws up this weekend and I'll test my delphi version (never benchmarked it yet)
GameDevGuy
8
Years of Service
User Offline
Joined: 18th Jul 2015
Location:
Posted: 20th May 2017 07:28 Edited at: 20th May 2017 07:34
I have made a very simple spell checking app with AGK. It only checks a single word, but was done to see if AGK2 is sufficient for the job.

I am quite satisfied with the performance. The dictionary is Australian English with over 68,000 words.

The executable here is for Windows, but there is nothing platform specific about the code, so it should work on Mac and Linux (if compiled for those targets).

I have not tested it on Android, iOS or HTML5, as the desktop is my current main interest.

@Phaelax, I am not familiar with Levenshtein distances, so the suggestion algorithm used here is my own simple minded method, but works reasonably for the type of spelling and typo mistakes that I usually make.

agk-gamedevguy-spell-check-2017-05-20.zip
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 24th May 2017 12:04
I know, at least on iphone, that the spell check goes further than just simple typos. It's also based partly on the keyboard layout, looking at possible combinations you intended to hit. (hence why it sometimes changes words you spelled correctly to something else that is close in terms of the nearby keys)


Back in MY day, the only spellcheck we had were our eyes!

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
GameDevGuy
8
Years of Service
User Offline
Joined: 18th Jul 2015
Location:
Posted: 24th May 2017 14:56
The methods I have used are based on comparisons of the list of letters in the unknown word, and looking for transpositions. For Tier 1 and only a few hundred lines of code it works good enough, without trying to be smart about keyboard layouts, with word pairs and the like.

If anyone is interested I could tidy up the spell checking functions and put them into an .agc file to be used as a library.

P.S. Don't anyone even think of asking about grammar checking, that is way beyond my knowledge of how the English language is structured. I wouldn't know where to start.

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 25th May 2017 20:37
Even MS hasn't perfected grammar checking in Word. There's so many exceptions to the language rules.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Login to post a reply

Server time is: 2024-04-20 00:58:47
Your offset time is: 2024-04-20 00:58:47