mark-watson / fasttag_v2

My Part of Speech Tagger
42 stars 16 forks source link

Thread Safe FastTag #1

Closed mvryan closed 11 years ago

mvryan commented 11 years ago

I've modified FastTag so that all operations can be performed statically which is safer for threading as they won't share access to an object or have to make private instances of one. Additional changes were made to guarantee safety of internal data structures being accessed.

Replaced static block with more descriptive static method. (Allows lexicon to be made final) Replaced Hashtable of lexicon with a unmodifiable HashMap to improve speed and still ensure safe access. Also making it final. Changing tag and wordInLexicon methods to static.

Apologies for the extent it looks like things were changed my editor had a field day with auto formating.