Live data from Hacker News

How to Write a Spelling Corrector

norvig.com

21–30 of 133 posts

Re: How to Write a Spelling Corrector

#21
post #7

Reverse of the logic presented could be used to inject typos into a document per distributed copy of it to help identify anyone sharing documents online; basically each copy is unique to allow for attribution. Hash of each document could even be given to a third party and archived to provide if needed independent verification of the claim that the document and the document itself could be encrypted, loaded to another…

What is the application where typos in a document are acceptable?

Re: How to Write a Spelling Corrector

#22

Although not a spell checker specifically, I wrote an offensive language filter for a chat system used by the National Hockey League for a period when they hosted communal chat rooms during televised games. The architecture I used is completely different from what is described here, but the goals are very similar. I had to handle any curse word in any language, including curses from one language translated into anoth…

Interesting. I had to write a badwords filter for a random name generator (for a procedural galaxy generator...) and it's quite a task just for English.

If you've not used a Trie https://en.wikipedia.org/wiki/Trie I suggest checking them out. Very useful for fuzzy searching.

Re: How to Write a Spelling Corrector

#23
post #3

Spell chequer Martha Snow Eye halve a spelling chequer It came with my pea sea It plainly marques four my revue Miss steaks eye kin knot sea. Eye strike a quay and type a word And weight four it two say Weather eye am wrong oar write It shows me strait a weigh. As soon as a mist ache is maid It nose bee fore two long And eye can put the error rite It's rare lea ever wrong. Eye have run this poem threw it I am shore y…

I thought you came up with it on the spot but it's a real thing. http://www.davidpbrown.co.uk/poetry/martha-snow.html

Re: How to Write a Spelling Corrector

#24
post #3

Spell chequer Martha Snow Eye halve a spelling chequer It came with my pea sea It plainly marques four my revue Miss steaks eye kin knot sea. Eye strike a quay and type a word And weight four it two say Weather eye am wrong oar write It shows me strait a weigh. As soon as a mist ache is maid It nose bee fore two long And eye can put the error rite It's rare lea ever wrong. Eye have run this poem threw it I am shore y…

Love it. It also reminds me of the poem The Chaos, by Gerard Nolst Trenité:

http://ncf.idallen.com/english.html

Re: How to Write a Spelling Corrector

#25
post #18
post #3

Spell chequer Martha Snow Eye halve a spelling chequer It came with my pea sea It plainly marques four my revue Miss steaks eye kin knot sea. Eye strike a quay and type a word And weight four it two say Weather eye am wrong oar write It shows me strait a weigh. As soon as a mist ache is maid It nose bee fore two long And eye can put the error rite It's rare lea ever wrong. Eye have run this poem threw it I am shore y…

In a way, I'm surprised I can read this so easily. Do our brains read by converting text to sounds, and then parsing the sounds?

Kind of a controversial issue whether this is always the case, but it's at least commonly or typically the case for many readers: https://en.wikipedia.org/wiki/Subvocalization

Re: How to Write a Spelling Corrector

#26
post #21
post #7

Reverse of the logic presented could be used to inject typos into a document per distributed copy of it to help identify anyone sharing documents online; basically each copy is unique to allow for attribution. Hash of each document could even be given to a third party and archived to provide if needed independent verification of the claim that the document and the document itself could be encrypted, loaded to another…

What is the application where typos in a document are acceptable?

Pre-publish review copies of a novel

Re: How to Write a Spelling Corrector

#27

His python code styling is really awesome. So concise. Probably inspired by all the LISP he wrote in the past. Although he does seem to be using doc strings incorrectly

Came here to say this. I've combed through his pieces many times over just to glean the way he structures his code. Here, he got my head spinning for a minute with

  return set(w for w in words if w in WORDS)
and made a mental note to use that idiom in the future.

As for doc strings, well, this is just a toy piece of code after all. The main purpose for the code is to be read, instead of actually used. something something hobgoblin of little minds

Edit: formatting.

Re: How to Write a Spelling Corrector

#30
post #3

Spell chequer Martha Snow Eye halve a spelling chequer It came with my pea sea It plainly marques four my revue Miss steaks eye kin knot sea. Eye strike a quay and type a word And weight four it two say Weather eye am wrong oar write It shows me strait a weigh. As soon as a mist ache is maid It nose bee fore two long And eye can put the error rite It's rare lea ever wrong. Eye have run this poem threw it I am shore y…

Related: https://trialbysteam.com/2010/03/09/d-j-enright-the-typewrit...

(it's pretty subtle to catch all of the often-scatological jokes in there)

Post reply on HN