JVerbnet 1.2.0

JVerbnet is a Java library for interfacing with the University of Colorado's Verbnet data.

See:
          Description

Packages
edu.mit.jverbnet.data Provides the major data types of the library
edu.mit.jverbnet.data.selection Provides a selectional restriction framework
edu.mit.jverbnet.data.semantics Provides semantic descriptors, such as for predicates and their arguments
edu.mit.jverbnet.data.syntax Provides syntactic descriptors for verb arguments
edu.mit.jverbnet.index Provides the basic verb index class for accessing Verbnet data
edu.mit.jverbnet.parse Provides XML handlers specifically implemented for Verbnet data
edu.mit.jverbnet.util Provides utility classes
edu.mit.jverbnet.util.parse Provides a general handler framework that eases writing SAX-based XML parsers

 

JVerbnet is a Java library for interfacing with the University of Colorado's Verbnet data. It features API calls to retrieve verb classes by their id numbers, associated wordnet keys or propbank groupings. The library includes no GUI elements.

JVerbnet is compatible with both Verbnet 3.1 and 3.2. The Verbnet data itself may be downloaded separately from the Verbnet site at http://verbs.colorado.edu/~mpalmer/projects/verbnet.html.

JVerbnet is made freely available, and licensed for use for all purposes, as long as proper acknowledgment is made. Details can be found in the license, which is included in the distribution.

The entry point for accessing dictionary data is the IVerbIndex interface. In the simplest case, where you are using Verbnet with the data files on the same filesystem as your Java program, you can instantiate a VerbIndex object with a single argument, a URL or File object that points to the directory where the Verbnet data files are located.

An example of this can be found below, in the form of a Java method testIndex(). In the method, the first block (lines 4-5) deals with constructing a URL object that points to the Verbnet data files. This path will probably be different on your system depending on where your Verbnet files are located. The second block of code (8-9), constructs an instance of the default VerbIndex object, and opens it by calling the open() method. The final block (12-21) demonstrates searching the index for a particular verb and printing out some information. The final numbered block of code shows the console output of the method.

Sample code:

1 public void testIndex() throws Exception {
2       
3   // make a url pointing to the Verbnet data
4   String pathToVerbnet = "/path/to/your/verbnet/directory/";
5   URL url = new URL("file", null, pathToVerbnet);
6       
7   // construct the index and open it
8   IVerbIndex index = new VerbIndex(url);
9   index.open();
10
11   // look up a verb class and print out some info
12   IVerbClass verb = index.getRootVerb("hit-18.1");
13   IMember member = verb.getMembers().get(0);
14   Set keys = member.getWordnetTypes().keySet();
15   IFrame frame = verb.getFrames().get(0);
16   FrameType type = frame.getPrimaryType();
17   String example = frame.getExamples().get(0);
18   System.out.println("id: " + verb.getID());
19   System.out.println("first wordnet keys: " + keys);
20   System.out.println("first frame type: " + type.getID());
21   System.out.println("first example: " + example);
22      
23 }
Output (for Verbnet 3.2)
1 id: hit-18.1
2 first wordnet keys: [bang%2:35:00, bang%2:35:01]
3 first frame type: NP V NP
4 first example: Paula hit the ball.
For more information, see the User's Guide included with the distribution.



Copyright © 2012 ${project.organization.name}. All Rights Reserved.