Go Autocomplete Trie Save

go-autocomplete-trie is a data structure for text auto completion that allows for fuzzy matching and configurable levenshtein distance limits

Project README

Go-Autocomplete-Trie

An autocompl... library for Go by Vivino.

GoDoc Build Status

What Is it

Go-Autocomplete-Trie is a simple, configurable autocompletion library for Go. Simply build a dictionary with a slice of strings, optionally configure, and then search.

How to Use

Make a default Trie like so:

t := trie.New()

The default Trie has fuzzy search enabled, string normalisation enabled, a default levenshtein scheme and is case insensitive by default.

Next, just add some strings to the dictionary.

t.Insert("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday")

Next, search.

t.SearchAll("wdn")

-> []string{"Wednesday"}

Levenshtein is enabled by default.

t.SearchAll("urs")

-> []string{"Thursday", "Tuesday"}

To turn off the features...

t.WithoutLevenshtein().WithoutNormalisation().WithoutFuzzy().CaseSensitive()

Now...

t.SearchAll("urs")

-> []string{}

t.SearchAll("Thu")

-> []string{"Thursday"}
Open Source Agenda is not affiliated with "Go Autocomplete Trie" Project. README Source: Vivino/go-autocomplete-trie

Open Source Agenda Badge

Open Source Agenda Rating