1 package eu.fbk.dkm.pikes.resources; 2 3 import com.google.common.collect.ImmutableSet; 4 import com.google.common.collect.Sets; 5 6 import java.util.Set; 7 8 public final class VerbNet { 9 10 public static Set<String> getSuperClasses(final boolean recursive, final String classID) { 11 final int index = classID.lastIndexOf('-'); 12 if (index <= 0 || !Character.isDigit(classID.charAt(index - 1))) { 13 return ImmutableSet.of(); 14 } else { 15 final String parent = classID.substring(0, index); 16 final Set<String> result = Sets.newHashSet(parent); 17 if (recursive) { 18 result.addAll(getSuperClasses(true, parent)); 19 } 20 return result; 21 } 22 } 23 24 }