mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Remove gc for now
This commit is contained in:
@@ -57,13 +57,6 @@ module Linguist
|
|||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
# Public: Prune infrequent tokens.
|
|
||||||
#
|
|
||||||
# Returns receiver Classifier instance.
|
|
||||||
def gc
|
|
||||||
self
|
|
||||||
end
|
|
||||||
|
|
||||||
# Public: Guess language of data.
|
# Public: Guess language of data.
|
||||||
#
|
#
|
||||||
# data - Array of tokens or String data to analyze.
|
# data - Array of tokens or String data to analyze.
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ module Linguist
|
|||||||
data = File.read(sample[:path])
|
data = File.read(sample[:path])
|
||||||
classifier.train(language.name, data)
|
classifier.train(language.name, data)
|
||||||
}
|
}
|
||||||
classifier.gc
|
classifier
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -71,10 +71,6 @@ class TestClassifier < Test::Unit::TestCase
|
|||||||
assert_equal data['tokens_total'], data['tokens'].inject(0) { |n, (_, ts)| n += ts.inject(0) { |m, (_, c)| m += c } }
|
assert_equal data['tokens_total'], data['tokens'].inject(0) { |n, (_, ts)| n += ts.inject(0) { |m, (_, c)| m += c } }
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_gc
|
|
||||||
Classifier.instance.gc
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_classify_ambiguous_languages
|
def test_classify_ambiguous_languages
|
||||||
Sample.each do |sample|
|
Sample.each do |sample|
|
||||||
language = Linguist::Language.find_by_alias(sample[:language])
|
language = Linguist::Language.find_by_alias(sample[:language])
|
||||||
|
|||||||
Reference in New Issue
Block a user