Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Unistroke recognizer are super easy to write and a nice little afternoon project:

Take the time derivative of the trajectory, and ignore it until it's "large"

Once it becomes "large" normalize it to one of 8 directions (N NE E SE S SW W NW) and push the direction into a list then repeat until the derivative becomes "large" in a new direction or you stop getting input.

At the end you have a string you can look up in a table to get the character.

EDIT: after reading the comments apparently the algorithm PalmOS uses is slightly different.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: