Skip to content

Commit 3b376ca

Browse files
committed
OPENNLP-1880: Validate WN-LMF structure and sense membership
1 parent 9a25f3b commit 3b376ca

3 files changed

Lines changed: 509 additions & 59 deletions

File tree

opennlp-docs/src/docbkx/wordnet.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,24 @@
2727
<code>WndbReader</code> for the classic Princeton WordNet database file
2828
layout. Both return an immutable, thread-safe knowledge base.
2929
</para>
30+
<para>
31+
<code>WnLmfReader</code> requires a <code>LexicalResource</code> root
32+
with lexicons as direct children. Parsed entries, senses, synsets,
33+
relations and dependency declarations must have their WN-LMF parent;
34+
each lexical entry must contain a lemma. Incorrect placement or a
35+
missing lemma raises <code>InvalidFormatException</code> with the
36+
resource name and source line. Elements outside the reader's supported
37+
subset are skipped with all descendants, which cannot add lexical
38+
content or dependencies. Skipped XML must still be well formed. The
39+
reader does not perform full DTD validation.
40+
</para>
41+
<para>
42+
A sense must point to a synset with the same part of speech and a
43+
member lemma matching after case and underscore normalization. Missing
44+
targets or members and mismatched parts of speech raise <code>InvalidFormatException</code>
45+
with the source name and line. An explicit <code>members</code> list
46+
orders the lemmas; it cannot exclude a sense's lemma from the synset.
47+
</para>
3048
</section>
3149

3250
<section xml:id="tools.wordnet.load">

0 commit comments

Comments
 (0)