fuzzywords

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

README

fuzzywords is a go module that lets you "play around" with words. It includes a variety (I hope!) of functions that let you do exactly that.

Functions

Fuzz(str string) string

Returns a random sentence made with the words from str

Results may/will be different due to the randomness of the function

fuzzywords.Fuzz("Hello World!")

//Returns:
//Hello Hello

This function is better with big text

Reverse(str string) string

Returns the string you gave it but reversed

fuzzywords.Reverse("Hello World!")

//Returns:
//!dlroW olleH

RandomCharacters(n int) string

Returns a string of "n" random characters

Results may/will be different due to the randomness of the function

fuzzywords.RandomCharacters(10)
//Returns:
//pxzczqlyzy

If you want it to only use specific characters, you can change randomCharactersSlice

randomCharactersSlice = []string {"a","b","c"}
fuzzywords.RandomCharacters(10)
//Returns:
//cbccbacbca

AddPrefix(str string, prefix string) string

Adds a prefix to every word in "str"

fuzzywords.AddPrefix("Hello World", "a")
//This returns:
//"aHello aWorld"

AddSuffix(str string, suffix string) string

Adds a suffix to every word in "str"

fuzzywords.AddSuffix("Hello World", "a")
//This returns:
//"Helloa Worlda"

GetStringData(str string) map[string]int

Gets the amount of words, spaces and characters(without spaces) and returns all of it in a map.

    fuzzywords.GetStringData("Hello World")
    //Returns:
    //map["words":2 "spaces":1 "characters:10"]

CreateFuzzySentence(name string) string

Creates a 'fuzzy'(weird) sentence using random words from FuzzySentenceVerbs, FuzzySentenceObjects and FuzzySentencePlaces It firsts adds the name, then the verb, next the object, and finally the place.

fuzzywords.CreateFuzzySentence("Viss")
//Returns:
//Viss played with a parrot at home

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FuzzySentenceObjects = []string{"a parrot", "a spaceship", "a board game", "Mark"}
View Source
var FuzzySentencePlaces = []string{"at home", "in the jungle"}
View Source
var FuzzySentenceVerbs = []string{"played with", "killed", "had a bath with"}
View Source
var RandomCharactersSlice = []string{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}

Functions

func AddPrefix

func AddPrefix(str string, prefix string) string

Adds a prefix to every word in the string

func AddSuffix

func AddSuffix(str string, suffix string) string

Adds a suffix to every word in the string

func CreateFuzzySentence added in v1.1.1

func CreateFuzzySentence(name string) string

func Fuzz

func Fuzz(str string) string

Returns a random sentence made with the words from str Deprecated: This function is not useful

func GetStringData

func GetStringData(str string) map[string]int

Returns a map structured like this: "words": 4 "spaces": 3 "characters": 21 Note that the spaces are subtracted from the characters

func RandomCharacters

func RandomCharacters(n int) string

Returns a string of "n" random characters. If you want the string to be made with specific characters, change the "randomCharactersSlice"

func Reverse

func Reverse(str string) string

Returns str, but desrever(reversed)

Types

This section is empty.

Jump to

Keyboard shortcuts

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