Documentation
¶
Index ¶
- func Contains(array []string, a string) bool
- func ContentAsString(filePath string) string
- func CreateLowercaseAlphabet() []string
- func Filter(input []string, toFilter []string) []string
- func FindMatching(input string, regexString string) []string
- func IsAlphanumeric(c rune) bool
- func ReadLineFromFile(file *os.File) (string, int)
- func Scan(input string, separator string) []string
- type SortablePair
- type SortablePairList
- func (pairList *SortablePairList) Add(pair *SortablePair)
- func (pairList *SortablePairList) ContainsKey(key string) bool
- func (pairList *SortablePairList) Foreach(f func(*SortablePair))
- func (pairList *SortablePairList) Get(key string) (*SortablePair, error)
- func (pairList *SortablePairList) Len() int
- func (pairList *SortablePairList) Less(i, j int) bool
- func (pairList *SortablePairList) Sort()
- func (pairList *SortablePairList) Swap(i, j int)
- type Stack
- type StackElement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContentAsString ¶
Takes a path to a text file as an argument and returns the file's contents as a single string. If no file could be found under the given path, an error is thrown.
func CreateLowercaseAlphabet ¶
func CreateLowercaseAlphabet() []string
func FindMatching ¶
func IsAlphanumeric ¶
Types ¶
type SortablePair ¶
func (*SortablePair) IncrementCount ¶
func (pair *SortablePair) IncrementCount()
type SortablePairList ¶
type SortablePairList []*SortablePair
func CountWords ¶
func CountWords(input []string) SortablePairList
func (*SortablePairList) Add ¶
func (pairList *SortablePairList) Add(pair *SortablePair)
Appends an element to the list.
func (*SortablePairList) ContainsKey ¶
func (pairList *SortablePairList) ContainsKey(key string) bool
Check if the pair list contains any pair with the given key. Returns true if key exists, false otherwise.
func (*SortablePairList) Foreach ¶
func (pairList *SortablePairList) Foreach(f func(*SortablePair))
Takes a function which is subsequently applied on each element of the list of sortable pairs.
func (*SortablePairList) Get ¶
func (pairList *SortablePairList) Get(key string) (*SortablePair, error)
Retrieve an element by the corresponding key. If no such key exists, an error is returned.
func (*SortablePairList) Len ¶
func (pairList *SortablePairList) Len() int
func (*SortablePairList) Less ¶
func (pairList *SortablePairList) Less(i, j int) bool
func (*SortablePairList) Sort ¶
func (pairList *SortablePairList) Sort()
Executes a sorting of the list of pairs according to the implementation of the Sorter interface.
func (*SortablePairList) Swap ¶
func (pairList *SortablePairList) Swap(i, j int)
type Stack ¶
type Stack struct {
Elements []StackElement
}
func (*Stack) ElementAt ¶
func (s *Stack) ElementAt(index int) StackElement
func (*Stack) HasMoreElements ¶
func (*Stack) Pop ¶
func (s *Stack) Pop() (StackElement, error)
func (*Stack) Push ¶
func (s *Stack) Push(elem StackElement)
type StackElement ¶
type StackElement struct {
Val interface{}
}
Click to show internal directories.
Click to hide internal directories.