Move call method into existing Classifier class

This commit is contained in:
Brandon Keepers
2014-11-27 11:29:38 -05:00
parent c1a9737313
commit bf4baff363
3 changed files with 20 additions and 15 deletions

View File

@@ -1,13 +0,0 @@
module Linguist
module Strategy
# Detect language using the bayesian classifier
class Classifier
def self.call(blob, languages)
Linguist::Classifier.classify(Samples.cache, blob.data, languages.map(&:name)).map do |name, _|
# Return the actual Language object based of the string language name (i.e., first element of `#classify`)
Language[name]
end
end
end
end
end