rank

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dedupe added in v0.3.0

func Dedupe(items []*Item, limit int) []string

Dedupe ...

func Filter

func Filter(strs []string) []string

Filter ...

func Normalize

func Normalize(sanitized string) (string, bool)

Normalize sanitizes word and tells whether it is allowed token or not.

func RegisterStopWords added in v0.2.0

func RegisterStopWords(words []string)

RegisterStopWords ...

Types

type Item

type Item struct {
	Value string
	Score float64
}

Item holds some arbitrary string value (e.g. a word) along with some extra data about it.

func ParseHTML

func ParseHTML(lines []string, verbose bool) []*Item

ParseHTML receives lines of raw strings from the Web and produces result of prioritised tags based on the importance of HTML tags which wrap sentences.

Example:

<h1>A story about foo
<p> Foo was a good guy but, had a quite poor time management skills,
therefore he had issues with shipping all his tasks. Though foo had heaps
of other amazing skills, which were appreciated by his management.

Result:

foo: 5 + 1, story: 5, management: 1 + 1, skills: 1 + 1.

func ParseText

func ParseText(tokens []string) []*Item

ParseText ...

Jump to

Keyboard shortcuts

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