public static void readVerbClasses(String path) throws IOException {
levin_verb_classes = LinkedListMultimap.create();
BufferedReader input = new BufferedReader( new FileReader(new File(path)) );
String aux = null;
String levin_class = null;
String[] verbs = null;
int n_classes = 0;
while ( ( aux = input.readLine() ) != null ) {
if ( aux.startsWith("VERB") ) {
String[] data = aux.split("\\s+",2);
levin_class = data[0];
n_classes++;
} else if ( aux.trim().length() != 0) {
verbs = aux.split("\\s+");
for (int z = 0; z < verbs.length; z++) levin_verb_classes.put(verbs[z],levin_class);
}
}
System.out.println("Total Levin classes: " + n_classes);
System.out.println("Number of unique verbs: " + levin_verb_classes.keySet().size());
input.close();
}
EnglishNLP.java 文件源码
java
阅读 18
收藏 0
点赞 0
评论 0
项目:MuSICo
作者:
评论列表
文章目录