Make classify a function on the Classifier

This commit is contained in:
Joshua Peek
2012-07-23 13:47:15 -05:00
parent b9779e805e
commit bf944f6d1a
5 changed files with 85 additions and 79 deletions

View File

@@ -442,7 +442,7 @@ module Linguist
if Language.ambiguous?(extname)
possible_languages = Language.all.select { |l| l.extensions.include?(extname) }.map(&:name)
if possible_languages.any?
if result = Classifier.new(Samples::DATA).classify(data, possible_languages).first
if result = Classifier.classify(Samples::DATA, data, possible_languages).first
Language[result[0]]
end
end