Class: TokenSet

new TokenSet()

A token set is used to store the unique list of all tokens
within an index. Token sets are also used to represent an
incoming query to the index, this query token set and index
token set are then intersected to find which tokens to look
up in the inverted index.

A token set can hold multiple tokens, as in the case of the
index token set, or it can hold a single token as in the
case of a simple query token set.

Additionally token sets are used to perform wildcard matching.
Leading, contained and trailing wildcards are supported, and
from this edit distance matching can also be provided.

Token sets are implemented as a minimal finite state automata,
where both common prefixes and suffixes are shared between tokens.
This helps to reduce the space used for storing the token set.

Returns:

Type

Array.<string>

toString() → {string}

Generates a string representation of a TokenSet.

This is intended to allow TokenSets to be used as keys
in objects, largely to aid the construction and minimisation
of a TokenSet. As such it is not designed to be a human
friendly representation of the TokenSet.