Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fernandoporazzi/n-gram

Get n-grams from text
https://github.com/fernandoporazzi/n-gram

bigram golang n-gram ngram pentagram tetragram trigram

Last synced: 24 days ago
JSON representation

Get n-grams from text

Awesome Lists containing this project

README

        

# n-gram

Get [n-grams](https://en.wikipedia.org/wiki/N-gram) in Golang.

## Installation

```bash
$ go get -u github.com/fernandoporazzi/n-gram
```

## Usage

```go
package main

import (
"fmt"

ngram "github.com/fernandoporazzi/n-gram"
)

func main() {
fmt.Println(ngram.NGram(2, "fernando")) // [fe er rn na an nd do]
fmt.Println(ngram.NGram(3, "amsterdam")) // [ams mst ste ter erd rda dam]
}

```