File: README.md

package info (click to toggle)
golang-github-jdkato-syllables 0.1.0%2Bgit20170409.10.8961fa0-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 168 kB
  • sloc: makefile: 3
file content (29 lines) | stat: -rw-r--r-- 885 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# syllables [![Build Status](https://travis-ci.org/mtso/syllables.svg?branch=master)](https://travis-ci.org/mtso/syllables) [![codecov](https://codecov.io/gh/mtso/syllables/branch/master/graph/badge.svg)](https://codecov.io/gh/mtso/syllables) [![GoDoc](https://godoc.org/github.com/mtso/syllables?status.svg)](https://godoc.org/github.com/mtso/syllables)

Go port of the JavaScript syllable counter at https://github.com/wooorm/syllable

## Install

```
go get "github.com/mtso/syllables"
```

## Example

Example usage of `syllables.In(string) int`:

```go
package main

import (
	"fmt"
	"github.com/mtso/syllables"
)

func main() {
	text := "The quick brown fox jumps over the lazy dog."
	syllableCount := syllables.In(text)
	fmt.Printf("There are %v syllables in %q\n", syllableCount, text)
	// Output: There are 11 syllables in "The quick brown fox jumps over the lazy dog."
}
```