mirror of
https://github.com/KevinMidboe/linguist.git
synced 2026-01-28 04:06:02 +00:00
Move call method into existing Classifier class
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user