stringutil

package
v0.0.0-...-7b47597 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BreakSentenceByDict

func BreakSentenceByDict(s string, wordDict WordDictionary) []string

BreakSentenceByDict looks for all possible combinations of word breaks based on dictionary sent and returns all possible sentences with a space after the words (present in the dictionary)

func Hash

func Hash(s string) uint32

Hash returns a numeric representation of a string. Useful while comparing strings.

Types

type Sentence

type Sentence struct {
	Value string
}

Sentence keeps track of all words separated and also tells whether it's complete (i.e. all words in dict separated and no letters left)

type SentenceMap

type SentenceMap map[int]Sentence

SentenceMap holds the maximum sum belonging to a particular node of a tree and below (across all possible paths). The node value along with the depth is kept as the hash key of the map

type WordDictionary

type WordDictionary []string

WordDictionary is a slice of dictionary keywords

Jump to

Keyboard shortcuts

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