- summary: Pertainym(ADJ) / Derived(ADV) distinction --> No Pertainym(ADJ) / Derived(ADV) distinction
JWNL 1.3 assumes that all the pointer keys are the
same. The PointerType class has a
KEY_TO_POINTER_TYPE_MAP which is used to lookup pointer
types and create the appropriate relationships based on
the pointer key from the WN datafiles. This is fine
for all but the derived(ADV) and Pertainym(adj only)
pointer types which use the same key symbol in the
datafiles.
The key for the derived pointer and the pertainyms
pointer are the same '\'. In the
"AbstractPrincetonFileDictionaryElementFactory" class
which creates the synset from the data file, the
createSynset() method creates a pointer type from the
'/' token, but since they are the same, it always
returns DERIVED as the pointer type regarless of the
POS of the synset being created. This results in the
inabilty to ever fetch a PERTAINYM relation, if you
want this, you have to specify DERIVED to get the
adjective pertainym.
PointerType pointerType =
PointerType.getPointerTypeForKey(tokenizer.nextToken());
To test this, try fetching the ADJ synset for
"presidential", then lookup the pertainym for this. It
should be the noun "president", but no results are
returned. If you retrieve the "derived" pointer, you
get the right result even though this is not an adverb.
/* for WN 2.0 */
Synset s =
Dictionary.getInstance().getSynsetAt(POS.ADJECTIVE,
2834835);
/* this is an empty list */
new
PointerTargetNodeList(s.getTargets(PointerType.PERTAINYM));
/* this returns, erroneously, the desired result */
new
PointerTargetNodeList(s.getTargets(PointerType.DERIVED));
Possible fix, the getPointerTypeForKey() method should
take an additional POS parameter to be able to
distinguish the correct pointer type based on the POS
since the same symbol is used for more than one pointer
type in WN.