Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

tokenize_c.go 412B

123456789101112131415
  1. // +build flex
  2. package tokenizer
  3. import "github.com/src-d/enry/v2/internal/tokenizer/flex"
  4. // Tokenize returns lexical tokens from content. The tokens returned match what
  5. // the Linguist library returns. At most the first ByteLimit bytes of content are tokenized.
  6. func Tokenize(content []byte) []string {
  7. if len(content) > ByteLimit {
  8. content = content[:ByteLimit]
  9. }
  10. return flex.TokenizeFlex(content)
  11. }