mirror of
https://github.com/KevinMidboe/linguist.git
synced 2026-01-22 01:05:34 +00:00
Taking Heuristics for a spin.
This commit is contained in:
@@ -136,7 +136,7 @@ module Linguist
|
||||
elsif (determined = Heuristics.find_by_heuristics(data, possible_language_names)) && !determined.empty?
|
||||
determined.first
|
||||
# Lastly, fall back to the probablistic classifier.
|
||||
elsif classified = Classifier.classify(Samples::DATA, data, possible_language_names ).first
|
||||
elsif classified = Classifier.classify(Samples::DATA, data, possible_language_names).first
|
||||
# Return the actual Language object based of the string language name (i.e., first element of `#classify`)
|
||||
Language[classified[0]]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user