
eu.fbk.dkm.pikes.resources.VerbNet Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pikes-resources Show documentation
Show all versions of pikes-resources Show documentation
A collection of Java classes for accessing and querying a number of NLP resources.
The newest version!
package eu.fbk.dkm.pikes.resources;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
import java.util.Set;
public final class VerbNet {
public static Set getSuperClasses(final boolean recursive, final String classID) {
final int index = classID.lastIndexOf('-');
if (index <= 0 || !Character.isDigit(classID.charAt(index - 1))) {
return ImmutableSet.of();
} else {
final String parent = classID.substring(0, index);
final Set result = Sets.newHashSet(parent);
if (recursive) {
result.addAll(getSuperClasses(true, parent));
}
return result;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy