• 1.摘要
  • 2.基本信息
  • 3.JWI简介
  • 4.JWI相关
  • 5.JWI使用例子

JWI

基本信息

  • 外文名

    the MIT Java Wordnet Interface

  • 简介

    一个面向WordNet的Java API类库

  • 简称

    JWI

  • 实质

    一个免费的开源的工具

JWI简介

JWI(the MIT Java Wordnet Interface),是一个面向WordNet的Java API类库。JWI支持访问1.6——3.0之间的任意版本的WordNet,也包括其他扩展版本的WordNet。

JWI相关

JWI是由美国麻省理工学院计算机与人工智能实验室的Mark Alan.Finlayson主持的项目,使用Java编写。其目的是为了访问Princeton University 普林斯顿大学主持的WordNet提供方便的Java接口。

JWI开发包中所有的类包都起名为 是一个免费的开源的工具。当前版本为JWI 2.2.2 。可以到Mark Alan.Finlayson个人主页下载。

JWI提供了在线API文档和随代码下载的API文档。用户可以使用其进行访问WordNet。

JWI也提供了用户使用手册。

JWI使用例子

public static void testDitctionary() throws IOException{

// construct the URL to the Wordnet dictionary directory

String wnhome = System. ("WNHOME"); //获取环境变量WNHOME

String path = wnhome + File. + "dict";

URL url= new URL("file", null, path); //创建一个URL对象,指向WordNet的ditc目录

// construct the dictionary object and open it

IDictionary dict= new Dictionary(url);

dict.open(); //打开词典

// look up first sense of the word "dog "

IIndexWord idxWord=dict.getIndexWord("dog", POS. );//获取一个索引词,(dog,名词)

IWordID wordID=idxWord.getWordIDs().get(0);//获取dog第一个词义ID