bow

package module
v0.0.0-...-311403e Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2019 License: MIT Imports: 6 Imported by: 0

README

# bow

[![GoDoc](https://godoc.org/github.com/axamon/bow?status.svg)](https://godoc.org/github.com/axamon/bow)

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bow

func Bow(dati [][]string, lung, count int) (tokens map[string]int, NumDocs int)

Bow receives a slice of a slice of strings and outputs its tokens map

func Lemmizza

func Lemmizza(parola string) (lemma string, err error)

Lemmizza restituisce il lemma di una parola italiana

func String2LemmiSet

func String2LemmiSet(str string) (lemmiSet *stringset.StringSet)

String2LemmiSet outputs a set of strings containing tokens of the input string.

Example
package main

import (
	"fmt"

	"github.com/axamon/bow"
)

func main() {
	lemmi := bow.String2LemmiSet("Salve, il cliente lamenta problemi. Il Cliente è infuriato")
	for _, lemma := range lemmi.Strings() {
		fmt.Println(lemma)
	}
}
Output:

infuriare
cliente
il
lamentare
problema
salva

func String2Tokens

func String2Tokens(str string) (tokens map[string]int)

String2Tokens receives a string and outputs a slice of lemmatized tokens.

Example
package main

import (
	"fmt"

	"github.com/axamon/bow"
)

func main() {
	tokens := bow.String2Tokens("Salve, il cliente lamenta problemi. Il Cliente è infuriato")
	for token := range tokens {
		fmt.Println(token)
	}
}
Output:

infuriare
cliente
il
lamentare
problema
salva

Types

This section is empty.

Jump to

Keyboard shortcuts

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