Documentation
¶
Overview ¶
A library to help calculate the similarity between two strings
Functions ¶
CheckSimilarity(): Check the similarity of a word to a corpus of validWords LoadWords(): Returns a slice of a huge number of words (>350,000)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadPremadeWords ¶
func LoadPremadeWords() []string
Helper function to load a default corpus of over 350,000 words
Returns ¶
[]string: A slice with the words in the corpus
func SuggestWord ¶
func SuggestWord(word string, validWords []string) algorithms.Suggestion
Used to get a suggestion using Jaro Similarity, fastest solution available
Parameters ¶
inputWord (string): The word to find a similar word for validWords ([]string): A slice with the words that are considered valid
Returns ¶
Suggestion: A suggestion struct with the word and it's likelihood
func SuggestWordWithSpecificAlgorithm ¶
func SuggestWordWithSpecificAlgorithm(word string, validWords []string, algorithm algorithms.SimilarityAlgorithm) algorithms.Suggestion
Used to get a suggested word with a specific algorithm
Parameters ¶
inputWord (string): The word to find a similar word for validWords ([]string): A slice with the words in the corpus algorithm (algorithms.SimilarityAlgorithm): The algorithm to use to calculate the similarity of the words
Returns ¶
algorithms.Suggestion: A pointer to the suggestion struct with the word and it's likelihood
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.