Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/fernandoporazzi/n-gram
- Owner: fernandoporazzi
- License: mit
- Created: 2019-12-17T11:21:37.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-17T13:01:52.000Z (about 5 years ago)
- Last Synced: 2024-06-20T05:26:34.798Z (6 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]
}```