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: 2 months ago
JSON representation
Get n-grams from text
- Host: GitHub
- URL: https://github.com/fernandoporazzi/n-gram
- Owner: fernandoporazzi
- License: mit
- Created: 2019-12-17T11:21:37.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-17T13:01:52.000Z (over 5 years ago)
- Last Synced: 2025-01-26T14:07:54.977Z (4 months ago)
- Topics: bigram, golang, n-gram, ngram, pentagram, tetragram, trigram
- Language: Go
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 mainimport (
"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]
}```