Algorithm that implements direct matching, n-gram tagging, POS tagging and semantic lookup for answering questions