RepeatedRecognizer

class RepeatedRecognizer(val baseRecognizer: TokenRecognizer, val min: Int = 1, val max: Int? = null) : TokenRecognizer

A recognizer that, using another "base" recognizer, will recognize a repetition of the other recognizer.

Constructors

Link copied to clipboard
constructor(baseRecognizer: TokenRecognizer, min: Int = 1, max: Int? = null)

Properties

Link copied to clipboard

The recognizer which will be repeatedly used.

Link copied to clipboard
val max: Int? = null

The maximum amount of repetitions that can be present for a successful recognition.

Link copied to clipboard
val min: Int = 1

The minimum amount of repetitions that has to be present for a successful recognition.

Functions

Link copied to clipboard
open override fun recognize(s: String, startAt: Int): Pair<String, Int>?

Check whether the string s starting from index startAt matches the pattern this recognizer uses.