@Override public String transform(String s) { try { return inventory.getSenseDescription(s); } catch (SenseInventoryException e) { return e.toString(); } } }
@Override public String getMostFrequentSense(String sod) throws UnsupportedOperationException, SenseInventoryException { return inventory.getMostFrequentSense(sod); }
@Override public Map<String, Double> getDisambiguation(String sod) throws SenseInventoryException { // System.out.println(sod + "\t" + ((SenseWeightedInventory)inventory).getWeightedSenses(sod)); return ((SenseWeightedInventory)inventory).getWeightedSenses(sod); } }
@Override public List<String> getSenses(String sod) throws SenseInventoryException { return inventory.getSenses(sod); }
@Override public String getMostFrequentSense(String sod) throws SenseInventoryException, UnsupportedOperationException { int maxUseCount = Integer.MIN_VALUE; String mostFrequentSense = null; for (String sense : getSenses(sod)) { int useCount = getUseCount(sense); if (maxUseCount < useCount) { maxUseCount = useCount; mostFrequentSense = sense; } } return mostFrequentSense; }
@Override public UndirectedGraph<String, UnorderedPair<String>> getUndirectedGraph() throws SenseInventoryException { if (inventory instanceof SenseTaxonomy) { return ((SenseTaxonomy) inventory).getUndirectedGraph(); } else { throw new UnsupportedOperationException(); } }
@Override public List<String> getSenses(String sod, POS pos) throws SenseInventoryException { return getSenses(sod); }
@Override public String getSenseInventoryName() { if (senseInventoryName == null) { return inventory.getSenseInventoryName(); } else { return senseInventoryName; } }
@Override public int getUseCount(String senseId) throws SenseInventoryException { return inventory.getUseCount(senseId); }
@Override public String getMostFrequentSense(String sod, POS pos) throws SenseInventoryException, UnsupportedOperationException { return getMostFrequentSense(sod); }
@Override public String getSenseDescription(String senseId) throws SenseInventoryException { return inventory.getSenseDescription(senseId); }
@Override public Map<String, List<String>> getSenseInventory() throws SenseInventoryException { return inventory.getSenseInventory(); }
@Override public POS getPos(String senseId) throws SenseInventoryException { return inventory.getPos(senseId); }
@Override public void setUndirectedGraph( UndirectedGraph<String, UnorderedPair<String>> graph) throws SenseInventoryException, UnsupportedOperationException { if (inventory instanceof SenseTaxonomy) { ((SenseTaxonomy) inventory).setUndirectedGraph(graph); } else { throw new UnsupportedOperationException(); } }
@Override public Set<String> getSenseAlignments(String senseId) throws SenseInventoryException, UnsupportedOperationException { if (inventory instanceof SenseAlignment) { return ((SenseAlignment) inventory).getSenseAlignments(senseId); } else { throw new UnsupportedOperationException(); } }
@Override public List<String> getSenses(String sod, POS pos) throws SenseInventoryException { return inventory.getSenses(sod, pos); }
@Override public String getMostFrequentSense(String sod, POS pos) throws SenseInventoryException, UnsupportedOperationException { int maxUseCount = Integer.MIN_VALUE; String mostFrequentSense = null; for (String sense : getSenses(sod, pos)) { int useCount = getUseCount(sense); if (maxUseCount < useCount) { maxUseCount = useCount; mostFrequentSense = sense; } } return mostFrequentSense; } }
@Override public String getMostFrequentSense(String sod, POS pos) throws UnsupportedOperationException, SenseInventoryException { return inventory.getMostFrequentSense(sod, pos); }
@Override public String getMostFrequentSense(String sod) throws SenseInventoryException, UnsupportedOperationException { List<String> ids = getSenses(sod); if (!ids.isEmpty()) { return ids.get(0); } else { return null; } }