From aa40f75657afc20bd54a2d1aa95759c947853841 Mon Sep 17 00:00:00 2001 From: Alexander Bezzubov Date: Tue, 29 Oct 2019 18:26:19 +0100 Subject: [PATCH] go doc: minor improvements and clarifications Signed-off-by: Alexander Bezzubov --- common.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common.go b/common.go index 677ee9c..91b23cc 100644 --- a/common.go +++ b/common.go @@ -413,8 +413,9 @@ func GetLanguagesByContent(filename string, content []byte, _ []string) []string return heuristic.Match(content) } -// GetLanguagesByClassifier uses defaultClassifier as a Classifier and returns a sorted slice of possible languages ordered by -// decreasing language's probability. If there are not candidates it returns nil. It complies with the signature to be a Strategy type. +// GetLanguagesByClassifier returns a sorted slice of possible languages ordered by +// decreasing language's probability. If there are not candidates it returns nil. +// It is a Strategy that uses a pre-trained defaultClassifier. func GetLanguagesByClassifier(filename string, content []byte, candidates []string) (languages []string) { if len(candidates) == 0 { return nil @@ -433,7 +434,7 @@ func getLanguagesBySpecificClassifier(content []byte, candidates []string, class return classifier.classify(content, mapCandidates) } -// GetLanguageExtensions returns the different extensions being used by the language. +// GetLanguageExtensions returns all extensions associated with the given language. func GetLanguageExtensions(language string) []string { return data.ExtensionsByLanguage[language] }