Currently, RuleBasedTransliterator objects contain a Data object. The Data
object may be shared by multiple instances. This is because, as originally
conceived, the Data object is immutable. As of 2.0 this is no longer true
because during a match operation an object such as a StringMatcher (contained in
the Data object) may record state.
One solution is to abstract out the mutable data and hold it locally (it is only
used within the dynamic scope of one match call). This is structurally awkward
since the Data object contains an arbitrary tree of matchers and replacers, and
any or all of the may hold state. Parallel trees would be required, or an
elaborate state registration system.
Another solution is to acquire a lock for exclusive use of the Data object
during the match operation. This is unappealing for performance reasons.
Another solution is to clone the Data object into each RBT rather than share
them. This is clean but costs runtime memory. This is probably the best
solution.