package kariminf.langpi.wordnet;

import java.io.File;
import java.net.URL;

import edu.mit.jwi.Dictionary;
import edu.mit.jwi.IDictionary;

public class WNTools {
	
	public static final String wnLoc = "/wordnetDB/dict/";
	
	private static JWIRequestor jwir = getRequestor();
	private static JWIRequestor getRequestor(){
		String resUrl = WNTools.class.getProtectionDomain().getCodeSource().getLocation().getPath();
		File file = new File(resUrl + wnLoc);
		System.out.println(resUrl);
		IDictionary dict = new Dictionary(file) ;
		return new JWIRequestor(dict);
	}
	
	public static int getLexFileNumber(int synset, String pos){
		return jwir.getLexFileNumber(synset, pos);
	}
	
	
	//public static int get
	
	
	public static void main(String[] args){
		System.out.println(WNTools.getLexFileNumber(15168185, "NOUN"));
		
	}

}

@@ -316,16 +316,18 @@
 or()%7B%0A%09%09
+//
 String r
@@ -411,16 +411,118 @@
 Path();%0A
+%09%09//String resUrl = new File(%22%22).getAbsolutePath();%0A%09%09String resUrl = System.getProperty(%22user.dir%22);%0A
 %09%09File f

fix path location in WNTools