domain

package
v0.0.0-...-e3c5015 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tweet

type Tweet struct {
	ID       string
	Text     string
	Language string
	Time     time.Time
}

Tweet is the domain object representing a tweet

func FilterStopWords

func FilterStopWords(stopWords WordSet, tweet Tweet) Tweet

FilterStopWords removes stop words from a given tweet and returns the remaining words in their original order.

type Tweets

type Tweets struct {
	Data <-chan Tweet
	Stop chan<- bool
}

Tweets are a stoppable stream of tweets

type WordSet

type WordSet map[string]struct{}

WordSet is a set of words

func (WordSet) Add

func (w WordSet) Add(word string)

Add adds a word to the word set

func (WordSet) Contains

func (w WordSet) Contains(word string) bool

Contains returns true if the given word is contained in the word set, and false otherwise.

Jump to

Keyboard shortcuts

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