From 28bfde5afd95ce1e94fffc7f314c06c26e883e53 Mon Sep 17 00:00:00 2001 From: Nim G Date: Tue, 1 Sep 2026 23:09:13 -0300 Subject: [PATCH] chore: remove unused Tokens convenience wrappers File.Tokens and TokenCache.Tokens wrap TokensWith with an empty model name but have no callers anywhere in the codebase; TokensWith itself is what every check type actually uses. --- internal/core/file.go | 10 ++-------- internal/nlp/prose.go | 9 ++------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/internal/core/file.go b/internal/core/file.go index c7a16288..f2ea5651 100755 --- a/internal/core/file.go +++ b/internal/core/file.go @@ -200,14 +200,8 @@ func NewFile(src string, config *Config) (*File, error) { return &file, nil } -// Tokens returns the tagged tokens of text, tagging it only once per document -// however many rules ask for it. -func (f *File) Tokens(text string) []tag.Token { - toks, _ := f.TokensWith("", text) - return toks -} - -// TokensWith is Tokens, read with the named tagger. +// TokensWith returns the tagged tokens of text, read with the named tagger, +// tagging it only once per document however many rules ask for it. // // Two models disagree about the same sentence -- that is why a rule names // one -- so each is cached separately. diff --git a/internal/nlp/prose.go b/internal/nlp/prose.go index 9868e7e2..8493023f 100644 --- a/internal/nlp/prose.go +++ b/internal/nlp/prose.go @@ -213,13 +213,8 @@ type TokenCache struct { tagged map[string][]tag.Token } -// Tokens returns the tagged tokens of text, tagging it only the first time. -func (c *TokenCache) Tokens(text string, info *Info) []tag.Token { - toks, _ := c.TokensWith("", text, info) - return toks -} - -// TokensWith is Tokens, read with the named tagger. +// TokensWith returns the tagged tokens of text, read with the named tagger, +// tagging it only the first time. func (c *TokenCache) TokensWith(model, text string, info *Info) ([]tag.Token, error) { if c == nil { return textToTokensWith(model, text, info)