Documentation
¶
Overview ¶
regrams parses regular expressions into trigram queries in conjunctive normal form. To build a search engine that accepts regular expression queries, index all text documents by trigrams, then use the MakeQuery method provided in this package to transform any regular expression query into a query over the indexed trigrams.
For example, MakeQuery("abc+(d|e)") returns [["abc"], ["bcc","bcd","bce"]], which represents the trigram query "(abc) AND (bcc OR bcd OR bce)"
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Only use this if you want to tune config values in query processing like how large a trigram set to consider, how large an NFA to consider, etc. If you use MakeQuery instead of creating an engine e and running e.MakeQuery, it'll populate all these config values with some reasonable starting points.