-
大小: 801KB文件类型: .zip金币: 1下载: 0 次发布日期: 2021-05-18
- 语言: Java
- 标签: JWordNetSim
资源简介
JWordNetSim-java实现的基于wordnet的单词匹配算法,输出为待比较的词的相似度
代码片段和文件信息
/************************************************************************
* Copyright (C) 2006-2007 The University of Sheffield *
* Developed by Mark A. Greenwood *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not write to the Free Software *
* Foundation Inc. 675 Mass Ave Cambridge MA 02139 USA. *
************************************************************************/
package shef.nlp.wordnet.similarity;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import net.didion.jwnl.JWNL;
import net.didion.jwnl.JWNLException;
import net.didion.jwnl.data.POS;
import net.didion.jwnl.data.Pointer;
import net.didion.jwnl.data.PointerUtils;
import net.didion.jwnl.data.Synset;
import net.didion.jwnl.data.Word;
import net.didion.jwnl.data.list.PointerTargetNode;
/**
* An abstract class that addes information content based methods to the
* top level similarity measure class but doesn‘t itself define a
* similarity measure.
* @author Mark A. Greenwood
*/
public abstract class ICMeasure extends PathMeasure
{
/**
* This map stores the synset IDs and there associated frequencies
* as read from the supplied information content file.
*/
private Map freq = new HashMap();
protected void config(Map params) throws Exception
{
super.config(params);
//a handle to the infocontent file
BufferedReader in = null;
try
{
URL url = new URL(params.remove(“infocontent“));
//open the info content file for reading
in = new BufferedReader(new InputStreamReader(url.openStream()));
//get the first line from the file (should be the WordNet version info)
String line = in.readLine();
//Check that what we have is actually a file of IC values
if (line == null || !line.startsWith(“w
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2007-04-13 20:12 JWordNetSim\
文件 4116 2007-04-13 16:52 JWordNetSim\build.xm
文件 18319 2006-05-23 10:44 JWordNetSim\COPYING
文件 475 2007-04-13 15:24 JWordNetSim\HISTORY
目录 0 2007-04-13 20:11 JWordNetSim\javadoc\
文件 1513 2007-04-13 20:11 JWordNetSim\javadoc\allclasses-fr
文件 1393 2007-04-13 20:11 JWordNetSim\javadoc\allclasses-nofr
文件 5140 2007-04-13 20:11 JWordNetSim\javadoc\constant-values.html
文件 5076 2007-04-13 20:11 JWordNetSim\javadoc\deprecated-list.html
文件 8963 2007-04-13 20:11 JWordNetSim\javadoc\help-doc.html
文件 18704 2007-04-13 20:11 JWordNetSim\javadoc\index-all.html
文件 1288 2007-04-13 20:11 JWordNetSim\javadoc\index.html
文件 6230 2007-04-13 20:11 JWordNetSim\javadoc\overview-tree.html
文件 29 2007-04-13 20:11 JWordNetSim\javadoc\package-list
目录 0 2007-04-13 20:11 JWordNetSim\javadoc\resources\
文件 57 2007-04-13 20:11 JWordNetSim\javadoc\resources\inherit.gif
目录 0 2007-04-13 20:11 JWordNetSim\javadoc\shef\
目录 0 2007-04-13 20:11 JWordNetSim\javadoc\shef\nlp\
目录 0 2007-04-13 20:11 JWordNetSim\javadoc\shef\nlp\wordnet\
目录 0 2007-04-13 20:11 JWordNetSim\javadoc\shef\nlp\wordnet\similarity\
文件 18968 2007-04-13 20:11 JWordNetSim\javadoc\shef\nlp\wordnet\similarity\ICMeasure.html
文件 16233 2007-04-13 20:11 JWordNetSim\javadoc\shef\nlp\wordnet\similarity\JCn.html
文件 16181 2007-04-13 20:11 JWordNetSim\javadoc\shef\nlp\wordnet\similarity\Lin.html
文件 1534 2007-04-13 20:11 JWordNetSim\javadoc\shef\nlp\wordnet\similarity\package-fr
文件 8095 2007-04-13 20:11 JWordNetSim\javadoc\shef\nlp\wordnet\similarity\package-summary.html
文件 6474 2007-04-13 20:11 JWordNetSim\javadoc\shef\nlp\wordnet\similarity\package-tree.html
文件 14941 2007-04-13 20:11 JWordNetSim\javadoc\shef\nlp\wordnet\similarity\PathMeasure.html
文件 13219 2007-04-13 20:11 JWordNetSim\javadoc\shef\nlp\wordnet\similarity\SimilarityInfo.html
文件 19569 2007-04-13 20:11 JWordNetSim\javadoc\shef\nlp\wordnet\similarity\SimilarityMeasure.html
文件 1420 2007-04-13 20:11 JWordNetSim\javadoc\st
文件 12622 2007-04-13 20:10 JWordNetSim\JWordNetSim.jar
............此处省略22个文件信息
- 上一篇:C#调用JavaWebService(客户端)
- 下一篇:Java网上商城论文
评论
共有 条评论