From d6d1a6dfdce8fefb5fd8b44c512ecbc846aeecdb Mon Sep 17 00:00:00 2001 From: Julie Tibshirani Date: Fri, 9 Feb 2024 11:29:29 -0800 Subject: [PATCH] Don't truncate file before detecting language --- indexbuilder.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/indexbuilder.go b/indexbuilder.go index 67773c6d7..6a7b5ea1a 100644 --- a/indexbuilder.go +++ b/indexbuilder.go @@ -397,12 +397,7 @@ func (b *IndexBuilder) addSymbols(symbols []*Symbol) { func DetermineLanguageIfUnknown(doc *Document) { if doc.Language == "" { - c := doc.Content - // classifier is faster on small files without losing much accuracy - if len(c) > 2048 { - c = c[:2048] - } - doc.Language = enry.GetLanguage(doc.Name, c) + doc.Language = enry.GetLanguage(doc.Name, doc.Content) } }