Taking Heuristics for a spin.

This commit is contained in:
Arfon Smith
2014-09-04 13:49:30 -05:00
parent dafca264b2
commit fae6dbfebd
5 changed files with 1514 additions and 88 deletions

View File

@@ -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