sud03r / hackaton

A private repo for our hackathon
0 stars 0 forks source link

How can we autocorrect people's names? #14

Open szepi1991 opened 9 years ago

szepi1991 commented 9 years ago

For example in a query like: "Movies with Matthew McConaghey" we will still want to know who they are attempting to talk about.

sud03r commented 9 years ago

We would need a table for actors/movies (generated from our data), and then its easy (could do with database re-structuring)

Random tutorial: http://phpseason.wordpress.com/2013/02/13/php-autocomplete-tutorial-using-jquery/

szepi1991 commented 9 years ago

Autocomplete I know (at least in theory) how to do, thanks though :P

This one says auto correct

sud03r commented 9 years ago

ok, so the problem is like when you write "Matt" and one of the suggestions is "Matthew McConaghey" but you chose to ignore it, and write sth like "Mathew Mcanoghey" and expect us to later try to auto-correct it? Well, thats certainly a valid use-case, but less severe, and I am assuming there should be frontend plugins for that as well, if only our database supports queries to suggest relevant words.

szepi1991 commented 9 years ago

Yes, this is especially relavant atm as we don't have autocomplete just yet :D

Also if we do want to have autocomplete, that means the parsing algorithm will have to run after each character entry.... I may want to make it incremental in that case and also cache results...

sud03r commented 9 years ago

what i mean to say is autocomplete is easier than autocorrect, and to have autocorrect you gotta have autcomplete first.

By autocomplete here I don't mean guessing everything (the entire query) but just suggesting matching-prefetched actor/movie names. The parsing algorithm runs at the server and doesn't have to know until the query is submitted.

szepi1991 commented 9 years ago

Well, I know it's easier and we don't need to have this done right now (hence the "question" label and no "bug" or even "enhancement"). But I do think it's something that should be done at some point, so I wanted to see what ideas you guys have.

Basically what I'm thinking of is in google you type something, and it will ask you "did you mean ____" which is usually the correct thing. They do this based on statistics I'm sure.. anyway.

The reason I said we should have the parsing algo running, because it'd be better if the front end knew when it is that you are typing in a persons name as opposed to something else -- it would be pretty weird if it was giving suggestions for movies when you are typing.

For example typing "movies rat[ed higher]". At the "rat" point I would be pretty weirded out if the search box was autocompleting me with movie names or people. Or even better: "comedy movies with Matthew McConaghey", the autocomplete needs to know to ignore the first 3 words and only start autocompleting on the last two.

I thought that'd be easiest with the parsing algoirhtm running, for 1) saving code 2) consistent behaviour