morfologik / morfologik-stemming

Tools for finite state automata construction and dictionary-based morphological dictionaries. Includes Polish stemming dictionary.
BSD 3-Clause "New" or "Revised" License
186 stars 44 forks source link

Dictionary thread-safe #69

Closed danielnaber closed 8 years ago

danielnaber commented 8 years ago

This is more of a question: is Dictionary thread-safe or are there any plans to guarantee its thread-safety? Here's my use case: I create a Dictionary at runtime, which takes some time, so I'd like to do it only once and use it for all threads.

dweiss commented 8 years ago

Dictionary is thread safe (it's essentially the automaton and associated metadata). DictionaryLookup isn't thread safe, but is cheap to create and dispose (so it makes no sense to cache).

danielnaber commented 8 years ago

Great - assuming that's not going to change, I suggest adding that information to the Javadoc (both to Dictionary and DictionaryLookup).