nlp_utils

package
v0.3.71 Latest Latest
Warning

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

Go to latest
Published: May 17, 2025 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKeywords

func GetKeywords(text string, minLen int, includeSpecialChars bool) []string

func GetKeywordsProgression

func GetKeywordsProgression(text string, minLen int) []string

GetKeywordsProgression generate an array of keywords with also partial words like ["word", "wor", "wo"]. This is useful searching for partial words

func GetKeywordsSorted

func GetKeywordsSorted(text string, minLen int, includeSpecialChars bool) []string

func MapKeywords

func MapKeywords(text string, minLen int, includeSpecialChars bool) map[string]int

Types

type Graph

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

Graph holds node and edge data.

func NewGraph

func NewGraph() *Graph

NewGraph initializes and returns a new graph.

func (instance *Graph) Link(source, target uint32, weight float64)

Link creates a weighted edge between a source-target node pair. If the edge already exists, the weight is incremented.

func (*Graph) Rank

func (instance *Graph) Rank(α, ε float64, callback func(id uint32, rank float64))

Rank computes the PageRank of every node in the directed graph. α (alpha) is the damping factor, usually set to 0.85. ε (epsilon) is the convergence criteria, usually set to a tiny value.

This method will run as many iterations as needed, until the graph converges.

func (*Graph) Reset

func (instance *Graph) Reset()

Reset clears all the current graph data.

Jump to

Keyboard shortcuts

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