mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Allow tokens to be passed directly to classify
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
require 'linguist/classifier'
|
||||
require 'linguist/language'
|
||||
require 'linguist/sample'
|
||||
require 'linguist/tokenizer'
|
||||
|
||||
require 'test/unit'
|
||||
|
||||
@@ -23,6 +24,10 @@ class TestClassifier < Test::Unit::TestCase
|
||||
|
||||
results = classifier.classify(fixture("objective-c/hello.m"))
|
||||
assert_equal Language["Objective-C"], results.first[0]
|
||||
|
||||
tokens = Tokenizer.new(fixture("objective-c/hello.m")).tokens
|
||||
results = classifier.classify(tokens)
|
||||
assert_equal Language["Objective-C"], results.first[0]
|
||||
end
|
||||
|
||||
def test_instance_classify_empty
|
||||
|
||||
Reference in New Issue
Block a user