barrel_ngram_selector_dense (barrel_ngram v0.7.1)
View SourceDense gram selector: every overlapping byte trigram.
This is the reference selector. It emits every trigram of the input, so a literal's grams are always a subset of its containing document's grams, and every gram is reliable to intersect over. It is also the oracle against which the content-defined selector is validated.
Summary
Functions
Dense indexes every trigram, so any mandatory trigram is present.
For the dense selector every gram is reliable. Literals shorter than a trigram carry no grams to intersect, so the planner must fall back to a brute-force scan of the live set.
Every overlapping trigram of Bytes, deduplicated and ascending. Inputs shorter than three bytes contribute no grams. Options are unused.
Functions
Dense indexes every trigram, so any mandatory trigram is present.
-spec reliable_grams(binary(), map()) -> barrel_ngram_selector:reliable().
For the dense selector every gram is reliable. Literals shorter than a trigram carry no grams to intersect, so the planner must fall back to a brute-force scan of the live set.
-spec select_grams(binary(), map()) -> [barrel_ngram_selector:gram()].
Every overlapping trigram of Bytes, deduplicated and ascending. Inputs shorter than three bytes contribute no grams. Options are unused.