Codebase list golang-github-rivo-uniseg / 6117f9b
New upstream snapshot. Debian Janitor 2 years ago
4 changed file(s) with 29 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
00 # Unicode Text Segmentation for Go
11
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)
33 [![Go Report](https://img.shields.io/badge/go%20report-A%2B-brightgreen.svg)](https://goreportcard.com/report/github.com/rivo/uniseg)
44
55 This Go package implements Unicode Text Segmentation according to [Unicode Standard Annex #29](http://unicode.org/reports/tr29/) (Unicode version 12.0.0).
4646
4747 ## Documentation
4848
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.
5050
5151 ## Dependencies
5252
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
06 golang-github-rivo-uniseg (0.2.0-1) unstable; urgency=medium
17
28 * 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 }
00 package uniseg
11
22 import (
3 "fmt"
43 "testing"
54 )
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 }
155
166 // The test cases for the simple test function.
177 var testCases = []struct {