How do you tell a *spelling mistake* from a *grammar mistake*? For example:

1. Your the best.
2. This iz the end.
3. I likes music.
4. She preatend to be asleep.

One method is to read the sentence aloud (let’s call it the ‘speech method’): if the sentence sounds correct then it has a spelling mistake, otherwise it has a grammar mistake. Applied to the examples, 1 and 2 have spelling mistakes, and 3 and 4 have grammar mistakes.

Another method is to look up each word of the sentence in a dictionary (let’s call it the ‘dictionary method’): if the sentence uses a word that is not in the dictionary, then it has a spelling mistake, otherwise it has a grammar mistake. Applied to the examples, 1 and 3 have grammar mistakes, and 2 and 4 have spelling mistakes.

The problem is that these two methods give different results (for 1 and 4, but not for 2 and 3). Which method should I use?