validate

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package validate contains wordlist validation rules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All(word string, currentWords []string) error

All runs all validation checks on a word list.

func DuplicateWords

func DuplicateWords(words []string) error

DuplicateWords returns an error if the given word list contains any duplicates.

func WordLength

func WordLength(word string) error

WordLength returns an error if the given word is shorter than 3 characters or longer than 8 characters.

func WordMinDistance

func WordMinDistance(word string, words []string) error

WordMinDistance returns an error if the given word has a Damerau-Levenshtein distance of less than 2 from any other word in the word list.

func WordPrefix

func WordPrefix(word string, allWords []string) error

WordPrefix returns an error if the given word shares the same 4-character prefix as another word in the word list.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL