v0.3.0 Latest Latest

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

Go to latest
Published: Apr 11, 2021 License: MIT Imports: 10 Imported by: 0




This section is empty.


This section is empty.


func AlphaStart added in v0.2.0

func AlphaStart(text string) bool

AlphaStart determines if the starting rune in the given string is a letter.

func Capitalize added in v0.1.3

func Capitalize(str string) string

Capitalize capitalizes the first letter in a string.

func DefaultSimilarity

func DefaultSimilarity(n1, n2 []*basically.Token, filter basically.TokenFilter) float64

DefaultSimilarity is the default similarity implementation used in Biased TextRank. Tokens are normalized (converted to lowercase and stemmed), before calculating similarity.

func IsAdj

func IsAdj(tag string) bool

func IsAdv

func IsAdv(tag string) bool

func IsNoun

func IsNoun(tag string) bool

func IsVerb

func IsVerb(tag string) bool

func RemoveConj added in v0.2.0

func RemoveConj(s *basically.Sentence)

RemoveConj removes the first coordinating conjunction (for, and, nor, etc.) from the sentence.

func SubStr added in v0.1.3

func SubStr(str string, start, end int) string

SubStr returns the substring of s between start and end.


type Matcher added in v0.2.0

type Matcher struct {
	Stopwords map[string]struct{}

func CreateMatcher added in v0.2.0

func CreateMatcher() (*Matcher, error)

CreateMatcher creates a Matcher and loads stopwords into a dictionary.

func (*Matcher) NVAAFilter added in v0.2.0

func (m *Matcher) NVAAFilter(tok *basically.Token) bool

NVAAFilter is a filter that whitelists tokens with n(oun), v(erb), a(djective) and a(dverb) tokens.

func (*Matcher) NVFilter added in v0.2.0

func (m *Matcher) NVFilter(tok *basically.Token) bool

NVFilter is a filter that whitelists tokens with (n)oun and (v)erb tags.

func (*Matcher) NVNSFilter added in v0.2.0

func (m *Matcher) NVNSFilter(tok *basically.Token) bool

NVNSFilter is a filter that whitelists tokens with (n)oun and (v)erb tags, and blacklists tokens that are (s)topwords.

Jump to

Keyboard shortcuts

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