Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compare words, also need to look for plurals and ing?

I have two list of words, suppose LIST1 and LIST2. I want to compare LIST1 against LIST2 to find the duplicates, but it should find the plural of the word as well as ing form also. For example.

Suppose LIST1 has word "account", and LIST2 has words "accounts,accounting" When i do compare the result should show two match for word "account".

I am doing it in PHP and have the LIST in mysql tables.

like image 454
daron Avatar asked Dec 06 '10 17:12

daron


1 Answers

You can use a technique called porter stemming to map each list entry to its stem, then compare the stems. An implementation of the Porter Stemming algorithm in PHP can be found here or here.

like image 55
Mark Baker Avatar answered Nov 20 '22 11:11

Mark Baker