2015-02-10 39 views
1

確實我想在java類中使用babelNet api 2.5但我得到這個錯誤,我不知道原因。在BabelNet 2.5配置中的錯誤

SLF4J: Class path contains multiple SLF4J bindings. 
SLF4J: Found binding in [jar:file:/C:/Users/khalifa/Downloads/apache-jena-2.12.1/apache-jena-2.12.1/lib/slf4j-log4j12-1.7.6.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: Found binding in [jar:file:/D:/Bureau%20080614/bureau31122014/BabelNet/lib/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. 
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 
[ INFO ] BabelNetConfiguration - Loading babelnet.properties FROM C:\Users\khalifa\Documents\NetBeansProjects\Test2\config\babelnet.properties 
[ INFO ] BabelNet - BabelNet API v2.5 written by Roberto Navigli, Simone Ponzetto and Daniele Vannella, with additional contributions by Francesco Cecconi 
[ INFO ] BabelNet - --------------- 
[ INFO ] BabelNet - Opening dict index: D:/Bureau 080614/bureau31122014/BabelNet/dict 
[ INFO ] BabelNet - Opening gloss index: D:/Bureau 080614/bureau31122014/BabelNet/gloss 
java.lang.RuntimeException: Could not init BabelNet: read past EOF 
    at it.uniroma1.lcl.babelnet.BabelNet.getInstance(BabelNet.java:217) 
[ INFO ] BabelNet - Opening lexicon index: D:/Bureau 080614/bureau31122014/BabelNet/dict 
    at Dijkestra.ContextDefinition.getDefinition(ContextDefinition.java:111) 
    at Dijkestra.ContextDefinition.main(ContextDefinition.java:145) 

當我用BabelNet的代碼是在這裏:

import it.uniroma1.lcl.babelnet.BabelNet; 
import java.util.LinkedList; 
import java.util.List; 
public class ContextDefinition { 
    public static void getDefinition(String v){ 

     try{ 
    BabelNet bn = BabelNet.getInstance(); 
     }catch (Exception e){ 
    e.printStackTrace(); 
} 
    } 
    public static void main(String[] args) 
    { 
     getDefinition("bbank"); 
    } 
} 

我會很感激,如果有人能幫我解決這個問題。

回答

0

我發現包含Babelnet的文件夾包含外部未使用文件夾的錯誤原因是BabelNet預編譯索引核心v2.5 CC_BY_NC_SA_30許可證。這是足夠的下載BabelNet預編譯索引捆綁,v2.5BabelNet Java API,v2.5。刪除這個文件夾已經解決了我的問題。我給這個解決方案可以幫助任何人。

0

該問題是來自日誌記錄的警告。檢查您的類路徑中,你會發現這裏列出的罐子的多個實例:

http://slf4j.org/faq.html#where_is_binding

你只需要那些在類路徑之一,具體取決於登錄您要使用的實際日誌庫。