Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Trigram search
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Examples == Consider the [[String (computer science)|string]] "alice". The trigrams of the string would be "ali", "lic", and "ice", not including spaces.<ref name=":1" /> Searching for this string in a database with a trigram-based index would involve finding which objects contain as many of the three trigrams as possible. As a concrete example of using trigram search to search for a regular expression query, consider searching for the string <code>ab[cd]e</code>, where the brackets denote that the third character in the string being searched for could be <code>c</code> or <code>d</code>. In this situation, one could query the index for objects that have the two trigrams <code>abc</code> and <code>bce</code> or the two trigrams <code>abd</code> and <code>bde</code>. Thus, finding this query would involve no [[string matching]], and could just query the index directly, which can be faster in practice.<ref name=":2" />
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)