tartrazine/internal/tokenizer/tokenize_c.go
Roberto Alsina f955c625ad Squashed 'go-enry/' content from commit 7e3a9a7
git-subtree-dir: go-enry
git-subtree-split: 7e3a9a7241b14559854ad041e73d5203a6d3272c
2024-09-04 16:33:41 -03:00

16 lines
417 B
Go

// +build flex
package tokenizer
import "github.com/go-enry/go-enry/v2/internal/tokenizer/flex"
// Tokenize returns lexical tokens from content. The tokens returned match what
// the Linguist library returns. At most the first ByteLimit bytes of content are tokenized.
func Tokenize(content []byte) []string {
if len(content) > ByteLimit {
content = content[:ByteLimit]
}
return flex.TokenizeFlex(content)
}