Skip to content

Commit 2b9d933

Browse files
committed
Fix subset bug
1 parent 7df9e81 commit 2b9d933

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/languageDetector.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ function detect (text) {
5454
let results = calculateScores(byteNgrams, numNgrams)
5555
let language = ''
5656

57+
if (subset) {
58+
results = filterLangSubset(results)
59+
}
5760
if (results.length > 0) {
58-
if (subset) {
59-
results = filterLangSubset(results)
60-
}
6161
results.sort((a, b) => b[1] - a[1])
6262
language = languageData.langCodes[results[0][0]]
6363
}

0 commit comments

Comments
 (0)