Every time I read a norvig article I can feel myself get a little bit cleverer
Edit: And dumber, until I work through the examples twice
NB Chrome's spell checker has an edit distance of one. I learnt something useful and immediately applicable from norvig - I tell you this guy is great :-)
You have not even glanced at the referred article, have you? It is not conceptually harder, pretty much the same thing.
I played with some similar tasks for my native Russian. You can just add up a layer of hash tables/dictionaries to link to the original word. There are inflections in English too (and it is even harder for spelling purposes as the difference is often by one character) so it is conceptually similar.
If you meet a word that looks no way like anything you have seen before you must try and check whether you can construct it (or something similar to it) from constituent parts that each are in your dictionary. That can be difficult, because you must also know how compound words can be constructed. For example, a preposition can be a part, but (typically?) not at the end of a word, you (typically?) have at most one verb, adjectives (typically?) show up at the start only, etc. (the 'typically?' disclaimers show my ignorance)
A decent spelling checker needs to handle this, as it should signal missing spaces between words. For example, "blackeyed", "eyewhite", "blackkeyed", "grayblack" and "blackgray" are acceptable, but "eyedblack" is not.
I found the spell-checking in VIM to be quite awesome as well. I'm not sure the algo behind it, but it seems to give good results even when I totally butcher a word.
IIRC vim has been using/able to use the openoffice spell stuff, in turn based on hunspell which has extremely wide usage (OOo, OSX, Chrome, Opera, Eclipse, Mozilla etc)
Would this even apply to something like TinyMCE? I thought (read:assumed) the in-browser spell checking only worked against textarea's and text inputs.
In TinyMCE you get both the browser-based spell checkers (via the right click context menu), and the spelling suggestions in TinyMCE (depending which spelling backend you're using: aspell, enchant, google spell, etc. http://www.tinymce.com/wiki.php/plugin:spellchecker)
I decided to use Yandex Speller since at the time I was researching this issue it was clear that Google Spell was an undocumented and unsupported feature. http://api.yandex.ru/speller/
Most (if not all) WYSIWYG HTML editors like TinyMCE use a contenteditable container (e.g. div) and all current browsers offer spell check in the contenteditable element.
It actually is a TinyMCE problem. (Article says that Tiny used the non public URL and if it got back 500 error, just defaulted to "oh, no spelling errors then")
We offered a content-creation service to users and thought that the in-browser spell check would be good enough- turns out there's a LOT of people who prefer the old, Word 6 style of spellcheck where you enact a thing and then step through the errors one-by-one. We never actually built that but we STILL get emails asking for it, and we can tell from context that they're on modern browsers.
...unless you want to implement some sort of server-side automated correcting that improves bad quality comments for instance. Rare, and possibly not very practical, but I've seen attempts at it here and there.
As soon as Google realizes they still have it online, probably. I'd be willing to bet the reason it's still alive is that they plain and simply forgot about it.
Nothing.... He just wanted another backlash against Google policies. But nobody cares about Google fartsy products anymore after we all gave up Google for good sine closing down Reader... right? or am I the only one that stuck to that method of protest :)))))
Read the article carefully. This was a non-Google plug-in using a private Google API that was then shutdown when Google stopped using it. This impacted users of the plug-in. This has nothing to do with Google, really.
This was just a private API that presumably Google no longer uses.
I wonder if this is related to the new Chrome spelling suggest feature (http://mashable.com/2013/03/29/chrome-spell-check/), and if that means there's a new private undocumented API for people to play with.
so many people use ajax.googleapis.com it's ridiculous. Most the time when you block this, the page fails to load at all. That's fine though because they often don't have content that interests me anyway if they're that type of dev on the web.
no, the lesson people should learn is "stop building your business around UNPUBLISHED/PRIVATE APIs." If you do, you have no excuse for complaining when they go away.
We use Google spellchecker with TinyMCE in our app (salestrakr.com) and it is currently working just fine. If it was down, it was for a short period of time. Though apparently long enough for someone to write a blog post, come up with a funny title, and get it on HN.
48 comments
[ 3.3 ms ] story [ 49.6 ms ] threadhttp://norvig.com/spell-correct.html
An instance with a similar code could be run, say, at Heroku (it would even be for free for the low traffic) with, say, a Flask wrapper:
http://flask-restful.readthedocs.org/en/latest/api.html
If the output format is reproduced, all it would take is changing the reference url.
That reminds me of this article: http://prog21.dadgum.com/29.html "A Spellchecker Used to Be a Major Feat of Software Engineering"
Edit: And dumber, until I work through the examples twice
NB Chrome's spell checker has an edit distance of one. I learnt something useful and immediately applicable from norvig - I tell you this guy is great :-)
[1] http://en.wikipedia.org/wiki/Inflection
I played with some similar tasks for my native Russian. You can just add up a layer of hash tables/dictionaries to link to the original word. There are inflections in English too (and it is even harder for spelling purposes as the difference is often by one character) so it is conceptually similar.
If you meet a word that looks no way like anything you have seen before you must try and check whether you can construct it (or something similar to it) from constituent parts that each are in your dictionary. That can be difficult, because you must also know how compound words can be constructed. For example, a preposition can be a part, but (typically?) not at the end of a word, you (typically?) have at most one verb, adjectives (typically?) show up at the start only, etc. (the 'typically?' disclaimers show my ignorance)
A decent spelling checker needs to handle this, as it should signal missing spaces between words. For example, "blackeyed", "eyewhite", "blackkeyed", "grayblack" and "blackgray" are acceptable, but "eyedblack" is not.
You can get a windows build of aspell at http://aspell.net/win32/
Instructions are on the wiki on how to wire it up.
If they were relying on this feature they've fixed it on their side.
I wonder if this is related to the new Chrome spelling suggest feature (http://mashable.com/2013/03/29/chrome-spell-check/), and if that means there's a new private undocumented API for people to play with.
Sure, we know it's entirely our fault for using a non-public API.
People should really disclose what APIs they use and offer alternatives should the first go down, especially when it's unofficial.
Hm, I don't seem to have online spellcheck enabled though. Perhaps not.
So there are a few takaways. All WP and other TinyMCE spellcheckers are silently erroring now. Not cool.
In general, people should properly handle errors, and not rely on non-public APIs.
ajax.googleapis.com isn't comparable to this now-defunct undocumented private API at all.