mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-05-24 08:18:52 -03:00
go doc: minor improvements and clarifications
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
This commit is contained in:
parent
fa097f4ed4
commit
aa40f75657
@ -413,8 +413,9 @@ func GetLanguagesByContent(filename string, content []byte, _ []string) []string
|
|||||||
return heuristic.Match(content)
|
return heuristic.Match(content)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetLanguagesByClassifier uses defaultClassifier as a Classifier and returns a sorted slice of possible languages ordered by
|
// GetLanguagesByClassifier 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.
|
// 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) {
|
func GetLanguagesByClassifier(filename string, content []byte, candidates []string) (languages []string) {
|
||||||
if len(candidates) == 0 {
|
if len(candidates) == 0 {
|
||||||
return nil
|
return nil
|
||||||
@ -433,7 +434,7 @@ func getLanguagesBySpecificClassifier(content []byte, candidates []string, class
|
|||||||
return classifier.classify(content, mapCandidates)
|
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 {
|
func GetLanguageExtensions(language string) []string {
|
||||||
return data.ExtensionsByLanguage[language]
|
return data.ExtensionsByLanguage[language]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user