Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
clipperhouse committed May 18, 2022
1 parent e5203d4 commit fce0e38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions words/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ text := []byte("Hello, 世界. Nice dog! 👍🐶")
segments := words.NewSegmenter(text) // A segmenter is an iterator over the words

for segments.Next() { // Next() returns true until end of data or error
fmt.Printf("%q\n", segments.Bytes()) // Do something with the current word
fmt.Printf("%q\n", segments.Bytes()) // Do something with the current token
}

if err := segments.Err(); err != nil { // Check the error
Expand All @@ -24,7 +24,7 @@ if err := segments.Err(); err != nil { // Check the error

[![Documentation](https://pkg.go.dev/badge/github.com/clipperhouse/uax29/words.svg)](https://pkg.go.dev/github.com/clipperhouse/uax29/words)

_For our purposes, “segment”, “word”, and “token” are used synonymously._
_Note: this package will return all tokens, including whitespace and punctuation — it's not strictly “words” in the common sense. If you wish to omit things like whitespace and punctuation, you'll have to add logic in the above `for` loop. For our purposes, “segment”, “word”, and “token” are used synonymously._

## Conformance

Expand Down

0 comments on commit fce0e38

Please sign in to comment.