Algorithm for textual context matching in Javascript

I have to implement an algorithm as a Node.js app where I'll be getting to strings and based on their context I'll have to decide if its a match or not. Take a taxi service for example. A person asking for a taxi can be considered string one. A taxi driver willing to offer his service could be considered string2. The algorithm should process these two strings and for this case return a match. I have lot of test data to train my algorithm on, if need be.

So far I have come across Bayes Document Classification algorithm and I think it could get the job done.

I was wondering if there was an easier way to do this, or any existing npm module that I could use?

Example strings:

S1 : I am looking for apartments in new york S2 : Our website lists apartments for sale in new york. Outcome : Match.

S1 : I am looking for restaurants in new york S2 : John sells computers. Outcome : No Match.

You can use Levenshtein distance, which will give you a number of corrections to make so that to strings match, you can convert it to percentages, to approximate the match.

Here is the JavaScript implementation and can be used as nodejs module.