Skip to content

didasy/tek

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Mar 27, 2024
728ce6c · Mar 27, 2024

History

15 Commits
Sep 2, 2015
Oct 23, 2015
Sep 2, 2015
Mar 27, 2024
May 14, 2019
Mar 27, 2024
May 14, 2019
Sep 2, 2015
May 14, 2019
May 14, 2019
Sep 2, 2015
Sep 2, 2015
May 14, 2019
Sep 2, 2015
Mar 27, 2024

Repository files navigation

tek

A golang package to get tags of an article


GoDoc

Installation

go get github.com/didasy/tek

Dependencies

None

Usage

package main

import (
	"fmt"
	"io/ioutil"
	"github.com/didasy/tek"
)

func main() {
	Tb, _ := ioutil.ReadFile("../sample.txt")
	text := string(Tb)
	tek.SetLang("en")
	tags := tek.GetTags(text, 10)
	for _, tag := range tags {
		fmt.Println(tag.Term, tag.Tfidf)
	}
}

Testing

To test, just run go test, but you need to have gomega and ginkgo installed.

Benchmark

Using i3-3217U @1.8GHz with 370 total words from the sample.txt provided and command go test -bench . -benchtime=5s -cpu 4:

BenchmarkGetTagEn-4         1000          11097404 ns/op
BenchmarkGetTagId-4         1000           6295201 ns/op

License

See LICENSE file, it is MIT

About

A golang package to get an article's tag

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages