binarySearch

fun <T> binarySearch(fst: FST<T>, arc: FST.Arc<T>, targetLabel: Int): Int

Perform a binary search of Arcs encoded as a packed array

Return

the index of the Arc having the target label, or if no Arc has the matching label, -1 - idx), where idx is the index of the Arc with the next highest label, or the total number of arcs if the target label exceeds the maximum.

Parameters

fst

the FST from which to read

arc

the starting arc; sibling arcs greater than this will be searched. Usually the first arc in the array.

targetLabel

the label to search for

the output type of the FST

Throws

IOException

when the FST reader does