On 25/10/12 14:43, Jörn Kottmann wrote:
the dictionary class was not designed to be sub-classed.
If you want to implement a custom dictionary you can use our event style
interface to parse a dictionary like file.
I subclassed it just fine...The only real problem I faced was the fact
that unless the entries are inserted into the Dictionary one-by-one (per
EntryInserter), the maxTkenCount & minTokenCount are not initialised
properly...so, for example I've got a giant HashMap with official terms
as keys and lists with synonyms as the data corresponding to the
respective key...The data is already in there - I shouldn't need to
insert anything into the Dictionary just override .contains()... However
with max/minTokenCount being part of the Dictionary's global state there
is no other option but calculate those separately and 'set' them before
.conatains() is called for the first time...anyway what I'm trying to
say is that it is not impossible it's just not that pretty as I
expected! It would have be nice to have setters for these 2 fields -
they are not declared final or anything like that! I've got it working
just fine - the problem is that my statistics are worse when including
synonyms because most synonyms are acronyms and acronyms have not been
annotated in my gold-corpus! :-(
thanks for your time Jorn
Jim