File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
main/kotlin/app/extractors Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -203,6 +203,15 @@ interface ExtractorInterface {
203
203
probabilities[libraries.indexOf(it)] >= 0.2 * maxProbability
204
204
}
205
205
206
+ // For languages with small number of libraries(e.g. less than 20).
207
+ // When found high probability then there won't be two or more
208
+ // values with high probability. And vise versa,
209
+ // if several values with high probability are found
210
+ // then the prediction is unsure. So we don't take them into account.
211
+ if (libraries.size < 20 && selectedCategories.size > 1 ) {
212
+ return emptyList()
213
+ }
214
+
206
215
if (maxProbabilityCategory == languageLabel) {
207
216
return emptyList()
208
217
}
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ class ExtractorTest : Spek({
112
112
}
113
113
114
114
it("ruby extractor extracts rails") {
115
- val line = " class Article < ApplicationRecord "
115
+ val line = " class Article < ActiveRecord::Base "
116
116
assertExtractsLineLibraries("rails",
117
117
line, RubyExtractor ())
118
118
}
You can’t perform that action at this time.
0 commit comments