ternarytreap library

This library defines 2 Multimaps and a Set implemented as self balancing compact ternary trees allowing fast, memory efficient prefix and near neighbour searching over a set of String keys

  • TTMultiMapSet - Keys map to Set of Values
  • TTMultiMapList - Keys map to Sequence of Values
  • TTSet - A Set of Strings

Balancing is achieved via Treap algorithm where each node is assigned a random priority and tree rotation used to maintain heap ordering.

Classes

TTIterable<V>
An iterable that returns TTIterator.
TTIterator<V>
An iterator that also reports prefixEditDistance and isMarked.
TTMultiMap<V>
A Multimap with prefix and near neighbour searching capability across keys. [...]
TTMultiMapList<V>
Return a TTMultiMap that stores values in a List [...]
TTMultiMapListEquality<V>
An equality between TTMultiMapListEquality instances.
TTMultiMapSet<V>
Return a TTMultiMap that stores values in a Set [...]
TTMultiMapSetEquality<V>
An equality between TTMultiMapSetEquality instances.
TTSet
A Set<String> with prefix and near neighbour searching capability across elements. [...]
TTSetEquality
An equality between TTSetEquality instances.

Functions

collapseWhitespace(String str) String
Transform str such that: [...]
identity(String str) String
Return str unchanged.
joinSingleLetters(String str) String
Transform str such that adjacent single alphanumeric symbols separated by whitespace are joined together. For example: [...]
lowercase(String str) String
Transform str such that all characters are lowercase.
lowerCollapse(String str) String
Transform str with both lowercase and collapseWhitespace.
nonLetterToSpace(String str) String
Transform str such that each non letter character is replaced by a space character.
uppercase(String str) String
Transform str such that all characters are uppercase.

Typedefs

KeyMapping(String str) String
Often it is desirable to define equivalences between Key strings, for example for case insensitivity. [...]