WordNet-Similarity Installation

This logs my installation of WordNet Similarity.

The current version of WordNet::Similarity is 2.0.7, released on October 4, 2015. The install file in source code explains the installation well, however, some little problems occur with new Mac OSX, e.g. Sierra.

The WordNet-Similarity 2.0.7 works with the other packages:

  • WordNet-3.0
  • WordNet-QueryData-1.49
  • Text-Similarity-0.13

WordNet-3.0 needs to be installed firstly, and then the other two packages. Although WordNet 3.1 can be installed via Brew, my case is not successful to make WordNet 3.1 working with WordNet-Similarity 2.0.7.

As the installation of WordNet, a issue was occurred from the step of ‘make’ in stubs.c. The following is the error message.

stubs.c:43:17: error: no member named ‘result’ in ‘struct Tcl_Interp’
interp -> result =
~~~~~~ ^
stubs.c:55:14: error: no member named ‘result’ in ‘struct Tcl_Interp’
interp -> result = bitfieldstr;
~~~~~~ ^
stubs.c:72:17: error: no member named ‘result’ in ‘struct Tcl_Interp’
interp -> result = “usage: bit bitnum”;
~~~~~~ ^
stubs.c:78:14: error: no member named ‘result’ in ‘struct Tcl_Interp’
interp -> result = bitfieldstr;
~~~~~~ ^
stubs.c:92:17: error: no member named ‘result’ in ‘struct Tcl_Interp’
interp -> result =
~~~~~~ ^
stubs.c:105:14: error: no member named ‘result’ in ‘struct Tcl_Interp’
interp -> result = resultbuf;
~~~~~~ ^
stubs.c:117:17: error: no member named ‘result’ in ‘struct Tcl_Interp’
interp -> result = “usage: glosses [1 | 0]”;
~~~~~~ ^
stubs.c:132:17: error: no member named ‘result’ in ‘struct Tcl_Interp’
interp -> result = “usage: fileinfo [1 | 0]”;
~~~~~~ ^
stubs.c:147:17: error: no member named ‘result’ in ‘struct Tcl_Interp’
interp -> result = “usage: byteoffset [1 | 0]”;
~~~~~~ ^
stubs.c:162:17: error: no member named ‘result’ in ‘struct Tcl_Interp’
interp -> result = “usage: senseflag [1 | 0]”;
~~~~~~ ^
stubs.c:178:17: error: no member named ‘result’ in ‘struct Tcl_Interp’
interp -> result = “usage: contextualhelp partofspeechnum searchtypenum”;
~~~~~~ ^
stubs.c:183:14: error: no member named ‘result’ in ‘struct Tcl_Interp’
interp -> result = helptext[pos][searchtype];
~~~~~~ ^
stubs.c:193:17: error: no member named ‘result’ in ‘struct Tcl_Interp’
interp -> result = “usage: reopendb”;
~~~~~~ ^
stubs.c:207:17: error: no member named ‘result’ in ‘struct Tcl_Interp’
interp -> result = “usage: abortsearch”;
~~~~~~ ^

Google the issue. I found a solution from StackOverflow. One suggestion is modify the line using ‘interp->result’ to ‘Tcl_SetResult’, e.g.

from

interp->result = "usage: glosses [1 | 0]";

to

Tcl_SetResult(interp, "usage: glosses [1 | 0]", TCL_DYNAMIC);

After the modification, do configure and make again. WordNet 3.0 can be successfully installed. (You type wn in terminal for testing if the WordNet installation is successful).

With having WordNet 3.0, the WordNet-QueryData-1.49, Text-Similarity-0.13, and WordNet-Similarity 2.0.7 are installed well via following procedure:

  1. perl Makefile.PL
  2. make
  3. make test
  4. su
  5. make install
  6. exit

To test if WordNet-Similarity 2.0.7 is installed successful, you can go to the folder ‘samples’, and find sample.pl. Then, try ‘perl sample.pl cat#n#1 dog#n#1′. You will see the result like the following screenshot.

screenshot-2016-10-15-12-09-22

All functions of WordNet-Similarity 2.0.7 are in the folder ‘utils’. If you’d like to launch a web service of WordNet Similarity, you can use similarity_server.pl. Just execute it. Then, you can see as following screenshot.

screenshot-2016-10-15-12-21-40