If you're willing to enumerate your cases manually I would consider having a predicate that "normalizes" or "simplifies" vocabulary. For instance, something like this:
%% synonym(Synonym, CanonicalTerm) :- Synonym is a synonym for CanonicalTerm
synonym(loves, enjoys).
synonym(likes, enjoys).
synonym(enjoys, enjoys).
Prologs usually index on the first argument, so this lookup will be fast (certainly faster than enumerating the whole database and doing a member/2
lookup). And then you can simply perform this step after parsing or on-demand, and code your rules around the canonical term.
WordNet probably does not consider love
and like
to be synonyms, really, so it is probably overkill for your needs.
Let's apply this to the earlier question:
?- phrase(sentence(np(Noun,_), vp(Verb, np(Object, _))),
[a,teenage,boy,loves,a,big,problem]),
synonym(Verb, CanonicalVerb),
present(Suggestion, Noun, CanonicalVerb, Object).
Noun = boy,
Verb = loves,
CanonicalVerb = enjoys,
Object = problem,
Suggestion = 'construction kit'
This of course assumes you update the present/4
fact as well.