mirror of
https://github.com/ralsina/tartrazine.git
synced 2024-11-10 21:42:22 +00:00
16 lines
417 B
Go
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)
|
|
}
|