rzo1 commented on code in PR #194:
URL: https://github.com/apache/opennlp-sandbox/pull/194#discussion_r1877807446
##########
opennlp-wsd/src/main/java/opennlp/tools/disambiguator/AbstractWSDisambiguator.java:
##########
@@ -22,37 +22,41 @@
import java.security.InvalidParameterException;
import java.util.ArrayList;
import java.util.List;
+import java.util.regex.Pattern;
+
+import net.sf.extjwnl.JWNLException;
Review Comment:
Just checked the license, which is BSD-3 -> ok for us.
##########
opennlp-wsd/src/main/java/opennlp/tools/disambiguator/AbstractWSDisambiguator.java:
##########
@@ -140,14 +126,65 @@ public List<String> disambiguate(String[]
tokenizedContext,
}
}
}
-
return senses;
}
/**
- * @param sample
- * @return result as an array of WordNet IDs
+ * Conducts disambiguation via available {@link Synset synsets} for the
specified
+ * {@code wordTag}.
+ *
+ * @param wordTag A combination of word and POS tag, separated by a {@code
.} character.
+ * @return The disambiguated sense and key if disambiguation was successful,
+ * {@code null} otherwise.
*/
- public abstract String disambiguate(WSDSample sample);
+ protected String disambiguate(String wordTag) {
+
+ String[] splitWordTag = SPLIT.split(wordTag);
+
+ String word = splitWordTag[0];
Review Comment:
Is it guaranteed that `wordTag != null` and `array.length == 2` ? (most
likely CnP via pull method up)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]