Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ public void setWSDItem(JCas aJCas, WSDItem wsdItem,
wsdResult.setSenseInventory(inventory.getSenseInventoryName());
wsdResult.setDisambiguationMethod(getDisambiguationMethod());
wsdResult.setWsdItem(wsdItem);

wsdResult.setBegin(wsdItem.getBegin());
wsdResult.setEnd(wsdItem.getEnd());

if (bestOnly == true) {
discardAllButHighestConfidence(disambiguationResult);
if (tieStrategy == TieStrategy.FAIL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,19 @@ protected Map<String, Double> getDisambiguation(JCas aJCas,
{
// TODO: Currently this just passes the covered text as the context.
// It might be better to pass a collection of annotations (for example,
// lemmas)
return wsdMethod.getDisambiguation(
wsdItem.getSubjectOfDisambiguation(),
POS.valueOf(wsdItem.getPos()), context.getCoveredText());
// lemmas)
try {
return wsdMethod.getDisambiguation(
wsdItem.getSubjectOfDisambiguation(),
POS.valueOf(wsdItem.getPos()), context.getCoveredText());

} catch (Exception e){
// System.out.println("Exception " + wsdItem.getCoveredText()+ "--"+ wsdItem.getPos());
// as pos is unknown use NOUN, or try it with null...
return wsdMethod.getDisambiguation(wsdItem.getSubjectOfDisambiguation(),POS.NOUN,context.getCoveredText());
// or throw exception
// throw e;
}
}

@Override
Expand Down