Skip to content

Commit fe18dc0

Browse files
authored
Merge pull request #198 from creachadair/indocumentado
Add documentation comments to package tokenizer.
2 parents 260dcfe + 5245079 commit fe18dc0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/tokenizer/tokenize.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Package tokenizer implements file tokenization used by the enry content
2+
// classifier. This package is an implementation detail of enry and should not
3+
// be imported by other packages.
14
package tokenizer
25

36
import (
@@ -8,6 +11,9 @@ import (
811

912
const byteLimit = 100000
1013

14+
// Tokenize returns language-agnostic lexical tokens from content. The tokens
15+
// returned should match what the Linguist library returns. At most the first
16+
// 100KB of content are tokenized.
1117
func Tokenize(content []byte) []string {
1218
if len(content) > byteLimit {
1319
content = content[:byteLimit]

0 commit comments

Comments
 (0)