Documentation
¶
Index ¶
- Variables
- func Bytes(s string) []byte
- func CleanWords(text string) []string
- func Frequency(fileName string, min int)
- func Frequency2(filename string)
- func Frequency3(filename string)
- func Keys(m map[string]int) []string
- func LineMap(s string) map[int]string
- func Lines(s string) []string
- func OpenTextFile(filename string) ([]byte, error)
- func ReWrap(text string, size int) string
- func RemoveNewlines(text string) string
- func SortLines(lines []string) []string
- func SortWords(words []string) []string
- func String(b []byte) string
- func ToLower(s string) string
- func ToValidUTF8(s string) string
- func Values(m map[string]int) []int
- func WordFrequency(words []string) map[string]int
- func Words(s string) []string
- type MapSlice
- type Ordered
- type TextFile
- func (t *TextFile) Bytes() []byte
- func (t *TextFile) CleanAlphaNumeric()
- func (t *TextFile) Frequency() map[string]int
- func (t *TextFile) Less(i, j int) bool
- func (t *TextFile) LineMap() map[int]string
- func (t *TextFile) LineSet(prefix, suffix, contains string) []string
- func (t *TextFile) Lines() []string
- func (t *TextFile) String() string
- func (t *TextFile) Swap(i, j int)
- func (t *TextFile) ToValidUTF8() error
- func (t *TextFile) Top(n int)
- func (t *TextFile) WordCount() (int, int)
- func (t *TextFile) Words() []string
- type WordFreq
Constants ¶
This section is empty.
Variables ¶
View Source
var ( S2B = convert.UnsafeStringToBytes B2S = convert.UnsafeBytesToString )
Functions ¶
func CleanWords ¶
CleanWords matches whole words and removes any punctuation/whitespace.
func Frequency2 ¶
func Frequency2(filename string)
func Frequency3 ¶
func Frequency3(filename string)
func OpenTextFile ¶
func RemoveNewlines ¶
func ToValidUTF8 ¶
func WordFrequency ¶
Types ¶
type MapSlice ¶
type Ordered ¶
type Ordered constraints.Ordered
type TextFile ¶
type TextFile struct {
// contains filtered or unexported fields
}
func GetTextFile ¶
func (*TextFile) CleanAlphaNumeric ¶
func (t *TextFile) CleanAlphaNumeric()
CleanAlphaNumeric cleans the word list and returns only items that are alpha-numeric.
func (*TextFile) LineSet ¶
LineSet returns a set of lines from the given file that match the given patterns.
If any of the parameters are the empty string, they are ignored.
func (*TextFile) ToValidUTF8 ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.