ngram

package module
v0.0.0-...-84d2901 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2017 License: MIT Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

n-gram

Build Status
Go implementation of n-gram

Installation

$ go get -u github.com/aryahadii/ngram

Usage

res, err := ngram.Get("ABCD", 2)
// res == [ "AB", "BC", "CD" ]

res, err = ngram.GetFrequency("ABBBB", 3)
// res == { "ABB": 1, "BBB": 2 }

License

This project is MIT licensed.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(text string, n int) ([]string, error)

Get creates a string array contains ngram

func GetFrequency

func GetFrequency(text string, n int) (map[string]int, error)

GetFrequency create a map which contains frequency of each rune groups

Types

This section is empty.

Jump to

Keyboard shortcuts

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