• Status: Open
  • Priority: Low
  • Security: Public
  • Views: 126
  • Last Modified:

Find synonyms in Prolog.

I want to create a program in Prolog that reads in a user input and finds a synonym for the words that the enter.

For example, if they entered
?- : [i,like,walking] 

Open in new window

, the program would change it to
[i,love,walking].

Open in new window


I want to do this with an input predicate like...

input:-
    read(X),
    synonym(X),
    output(X).

synonym(likes,[loves,adores]).

output(X):-
    write(X).

Open in new window


I know what I want to do, but I don't know how I would go about doing it.
Any help would be much appreciated.
0
Josef Kattan
Asked:
Josef Kattan
0 Comments

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now