No one ever starts a sentence with "The Jews control" and ends it with "the home owners association on our block and have done a phenomenal job managing it."
No one ever says "The Japs" followed by "have really contributed to our culture in the form of anime".
No one ever says "that n***" followed by "is an inspiration to us all and we are proud to have him in our community."
No one ever uses the word "tranny" followed by something well thought out and respectful of transexual people.
None of these words/phrases have an offensive dictionary meaning, but they are all rightfully associated with offensive speech.
It's usually the first if referring to familiar people and the second if referring to strangers. Even exactly the same word can cut both ways. "Dear" is affectionate towards family members, calling a coworker "dear" is condescending.
Also, as other posters have said, rule-based logic can only get you so far. It's all in the context.