models

package
v0.0.0-...-17d2028 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2019 License: MIT Imports: 1 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arrangement

type Arrangement struct {
	Words  []string
	Rating float64
}

type Arrangements

type Arrangements []Arrangement

type Bigram

type Bigram struct {
	First  string
	Second string
	Rating float64
}

func (*Bigram) GetKey

func (b *Bigram) GetKey() string

Get a unique identifier for a Bigram.

type Bigrams

type Bigrams struct {
	// contains filtered or unexported fields
}

func NewBigrams

func NewBigrams() Bigrams

Create a new collection of bigrams.

func (*Bigrams) Add

func (b *Bigrams) Add(other Bigram)

Add another Bigram to the collection.

func (*Bigrams) ScoreForBigram

func (b *Bigrams) ScoreForBigram(other Bigram) float64

Get the score of a Bigram. If the Bigram was not found, the score will be 0.

type Candidate

type Candidate struct {
	P Possibility
	A Arrangement
}

type Candidates

type Candidates struct {
	// contains filtered or unexported fields
}

func (*Candidates) Add

func (c *Candidates) Add(other Candidate)

Add another Candidate to the collection.

func (*Candidates) ForPossibility

func (c *Candidates) ForPossibility(p Possibility) Arrangement

Find an Arrangement for a Possibility. If the Possibility was not found, an empty Arrangement will be given.

type Possibilities

type Possibilities []Possibility

type Possibility

type Possibility struct {
	Prefix string
	Suffix string
}

type Unigram

type Unigram struct {
	Word   string
	Rating float64
}

type Unigrams

type Unigrams struct {
	// contains filtered or unexported fields
}

func NewUnigrams

func NewUnigrams() Unigrams

Create a new Unigrams collection.

func (*Unigrams) Add

func (u *Unigrams) Add(other Unigram)

Add a Unigram to the collection.

func (*Unigrams) ScoreForWord

func (u *Unigrams) ScoreForWord(word string) float64

Find the score for a given string. If the string was not found, the score will be 0.

Jump to

Keyboard shortcuts

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