it.unimi.dsi.mg4j.util
Interface ImmutableExternalPrefixDictionary.IntervalApproximator

All Known Implementing Classes:
ImmutableTriePrefixTree, TernaryIntervalSearchTree
Enclosing class:
ImmutableExternalPrefixDictionary

public static interface ImmutableExternalPrefixDictionary.IntervalApproximator

A data structure providing queries for approximated prefix intervals.

An interval approximator contains a list of words, and answers to queries about approximated prefix intervals.

Given a word w, the corresponding approximated prefix interval is defined as follows: if the words in the approximator are thought of as left interval extremes in a larger lexicographically ordered set of words, and we number these word intervals using the indices of their left extremes, then the first word extending w would be in the word interval given by the left extreme of the interval returned by this method, whereas the last word extending w would be in the word interval given by the right extreme of the interval returned by this method. If no word in the larger set could possibly extend w (because w is smaller than the lexicographically smallest word in the approximator) the result is just an empty interval.

LexicalInterval approximators are used by external prefix dictionaries to locate the disk blocks in which the strings delimiting an interval might be found.

See Also:
ImmutableExternalPrefixDictionary

Method Summary
 Interval getApproximatedInterval(CharSequence word)
          Returns an approximated prefix interval around the specified word.
 

Method Detail

getApproximatedInterval

Interval getApproximatedInterval(CharSequence word)
Returns an approximated prefix interval around the specified word.

Parameters:
word - a word.
Returns:
an approximated prefix interval for word