Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
tools-1.5.2-incubating
-
None
Description
JWNLDictionary.getLemmas method has a code that maps string-valued POS tags to net.didion.jwnl.data.POS instances, and this code clearly has a bug (for example, it maps tags starting with "N" both to POS.NOUN and POS.VERB). Please see the patch below (the patch assumes Penn TreeBank tags).
Index: src/main/java/opennlp/tools/coref/mention/JWNLDictionary.java
===================================================================
— src/main/java/opennlp/tools/coref/mention/JWNLDictionary.java (revision 1410284)
+++ src/main/java/opennlp/tools/coref/mention/JWNLDictionary.java (working copy)
@@ -84,10 +84,10 @@
if (tag.startsWith("N") || tag.startsWith("n"))
- else if (tag.startsWith("N") || tag.startsWith("v")) {
+ else if (tag.startsWith("V") || tag.startsWith("v")) { pos = POS.VERB; } - else if (tag.startsWith("J") || tag.startsWith("a")) {
+ else if (tag.startsWith("J") || tag.startsWith("j")) { pos = POS.ADJECTIVE; }else if (tag.startsWith("R") || tag.startsWith("r")) {