New upstream snapshot.
Debian Janitor
2 years ago
0 | 0 |
# Unicode Text Segmentation for Go
|
1 | 1 |
|
2 | |
[![Godoc Reference](https://img.shields.io/badge/godoc-reference-blue.svg)](https://godoc.org/github.com/rivo/uniseg)
|
|
2 |
[![Go Reference](https://pkg.go.dev/badge/github.com/rivo/uniseg.svg)](https://pkg.go.dev/github.com/rivo/uniseg)
|
3 | 3 |
[![Go Report](https://img.shields.io/badge/go%20report-A%2B-brightgreen.svg)](https://goreportcard.com/report/github.com/rivo/uniseg)
|
4 | 4 |
|
5 | 5 |
This Go package implements Unicode Text Segmentation according to [Unicode Standard Annex #29](http://unicode.org/reports/tr29/) (Unicode version 12.0.0).
|
|
46 | 46 |
|
47 | 47 |
## Documentation
|
48 | 48 |
|
49 | |
Refer to https://godoc.org/github.com/rivo/uniseg for the package's documentation.
|
|
49 |
Refer to https://pkg.go.dev/github.com/rivo/uniseg for the package's documentation.
|
50 | 50 |
|
51 | 51 |
## Dependencies
|
52 | 52 |
|
|
0 |
golang-github-rivo-uniseg (0.2.0+git20210531.1.5ca5bd4-1) UNRELEASED; urgency=low
|
|
1 |
|
|
2 |
* New upstream snapshot.
|
|
3 |
|
|
4 |
-- Debian Janitor <janitor@jelmer.uk> Sun, 06 Jun 2021 13:04:09 -0000
|
|
5 |
|
0 | 6 |
golang-github-rivo-uniseg (0.2.0-1) unstable; urgency=medium
|
1 | 7 |
|
2 | 8 |
* New upstream release
|
|
0 |
package uniseg_test
|
|
1 |
|
|
2 |
import (
|
|
3 |
"fmt"
|
|
4 |
|
|
5 |
"github.com/rivo/uniseg"
|
|
6 |
)
|
|
7 |
|
|
8 |
func ExampleGraphemes() {
|
|
9 |
gr := uniseg.NewGraphemes("👍🏼!")
|
|
10 |
for gr.Next() {
|
|
11 |
fmt.Printf("%x ", gr.Runes())
|
|
12 |
}
|
|
13 |
// Output: [1f44d 1f3fc] [21]
|
|
14 |
}
|
|
15 |
|
|
16 |
func ExampleGraphemeClusterCount() {
|
|
17 |
n := uniseg.GraphemeClusterCount("🇩🇪🏳️🌈")
|
|
18 |
fmt.Println(n)
|
|
19 |
// Output: 2
|
|
20 |
}
|
0 | 0 |
package uniseg
|
1 | 1 |
|
2 | 2 |
import (
|
3 | |
"fmt"
|
4 | 3 |
"testing"
|
5 | 4 |
)
|
6 | |
|
7 | |
// Type example.
|
8 | |
func ExampleGraphemes() {
|
9 | |
gr := NewGraphemes("👍🏼!")
|
10 | |
for gr.Next() {
|
11 | |
fmt.Printf("%x ", gr.Runes())
|
12 | |
}
|
13 | |
// Output: [1f44d 1f3fc] [21]
|
14 | |
}
|
15 | 5 |
|
16 | 6 |
// The test cases for the simple test function.
|
17 | 7 |
var testCases = []struct {
|