Automata

object Automata

Construction of basic automata.

Properties

Link copied to clipboard

.makeStringUnion limits terms of this max length to ensure the stack doesn't overflow while building, since our algorithm currently relies on recursion.

Functions

Link copied to clipboard
fun appendAnyChar(a: Automaton, state: Int): Int

Accept any single character starting from the specified state, returning the new state

Link copied to clipboard
fun appendChar(a: Automaton, state: Int, c: Int): Int

Appends the specified character to the specified state, returning a new state.

Link copied to clipboard

Returns a new (deterministic) automaton that accepts all binary terms.

Link copied to clipboard

Returns a new (deterministic) automaton that accepts any single codepoint.

Link copied to clipboard

Returns a new (deterministic) automaton that accepts all strings.

Link copied to clipboard

Returns a new (deterministic) automaton that accepts the single given binary term.

Link copied to clipboard
fun makeBinaryInterval(min: BytesRef?, minInclusive: Boolean, max: BytesRef?, maxInclusive: Boolean): Automaton

Creates a new deterministic, minimal automaton accepting all binary terms in the specified interval. Note that unlike .makeDecimalInterval, the returned automaton is infinite, because terms behave like floating point numbers leading with a decimal point. However, in the special case where min == max, and both are inclusive, the automata will be finite and accept exactly one term.

Link copied to clipboard

Returns a new (deterministic and minimal) automaton that accepts the union of the given collection of BytesRefs representing UTF-8 encoded strings. The resulting automaton will be built in a binary representation.

Returns a new (deterministic and minimal) automaton that accepts the union of the given iterator of BytesRefs representing UTF-8 encoded strings. The resulting automaton will be built in a binary representation.

Link copied to clipboard

Returns a new (deterministic) automaton that accepts a single codepoint of the given value.

Link copied to clipboard

Returns a new minimal automaton that accepts any of the codepoint ranges

Link copied to clipboard
fun makeCharRange(min: Int, max: Int): Automaton

Returns a new (deterministic) automaton that accepts a single codepoint whose value is in the given interval (including both end points).

Link copied to clipboard
fun makeCharSet(codepoints: IntArray): Automaton

Returns a new minimal automaton that accepts any of the provided codepoints

Link copied to clipboard
fun makeDecimalInterval(min: Int, max: Int, digits: Int): Automaton

Returns a new automaton that accepts strings representing decimal (base 10) non-negative integers in the given interval.

Link copied to clipboard

Returns a new (deterministic) automaton with the empty language.

Link copied to clipboard

Returns a new (deterministic) automaton that accepts only the empty string.

Link copied to clipboard

Returns a new (deterministic) automaton that accepts all binary terms except the empty string.

Link copied to clipboard

Returns a new (deterministic) automaton that accepts the single given string.

fun makeString(word: IntArray, offset: Int, length: Int): Automaton

Returns a new (deterministic) automaton that accepts the single given string from the specified unicode code points.

Link copied to clipboard

Returns a new (deterministic and minimal) automaton that accepts the union of the given collection of BytesRefs representing UTF-8 encoded strings.

Returns a new (deterministic and minimal) automaton that accepts the union of the given iterator of BytesRefs representing UTF-8 encoded strings.