2

If a user enters a form of the word "look" such as "looked" or "looking", how can I identify it as a modified version of the verb look? I imagine others have run into and have solved this problem before ...

JohnZaj
  • 3,080
  • 5
  • 37
  • 51
itwasthewind
  • 355
  • 1
  • 4
  • 9

3 Answers3

6

This is part of a fairly complicated problem called Stemming

However it's easier if you only want to take care of verb. To begin with, you can try the naive lookup table approach, since English vocabulary is not that big.

If you want something fancier, check the wiki page above.

xvatar
  • 3,229
  • 17
  • 20
1

If a regex is what your looking for something like this works look.*?\b to match look , looked and looking

tsukimi
  • 1,605
  • 2
  • 21
  • 36
0

Depending on your task, WordNet can be your friend for stuff like this. It's not a stemmer, but most stem words will return hits for what you're looking for It also provides synonyms and a lot of other information if you care about the concept 'look' rather than the word itself.

dfb
  • 13,133
  • 2
  • 31
  • 52