Prolog
The quickest and best way to become familiar with wnconnect's Prolog implementation is through a
few examples.
[An example of use is also given in the main page of the user guide
for the graphical user interface (GUI) version (here) in the discussion on common file
number.]
Let's look at the following screen snapshot:
- The main file (shown in the background) is connection.pl.
It defines the predicate connect/2 and the breadth-first
search strategy used for looking through the database of semantic
relations.
- In the foreground, we have Sicstus Prolog running in a terminal window.
- ?- restore(connection). loads the entire Prolog database
and search code in a single command.
- ?- connect(happy/a,unhappy/a) looks for all possible
paths between happy and unhappy restricted to
category adjective (a) only.
- ?- ctr_set(15,1), ctr(16,1). sets counters 15 and 16 to 1.
Counter 15: (0) default: find all paths. (1) find shortest path.
Counter 16: (0) default. (1) shows WordNet synset ids and offsets.
- Next, ?- connect(mend,tear). finds the shortest path
between mend and tear unrestricted by category.