Remove the attempts to make the language filter more lenient (#569)

zio/stable
Paul Frazee 2023-05-03 11:49:46 -05:00 committed by GitHub
parent 204c6729e7
commit 906b906eb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 11 deletions

View File

@ -214,20 +214,10 @@ export class FeedTuner {
) { ) {
const res = lande(item.post.record.text) const res = lande(item.post.record.text)
// require at least 70% confidence; otherwise, roll with it if (langsCode3.includes(res[0][0])) {
if (res[0][1] <= 0.7) {
hasPreferredLang = true hasPreferredLang = true
break break
} }
// if the user's languages are in the top 5 guesses, roll with it
for (let j = 0; j < 5 && j < res.length; j++) {
hasPreferredLang =
hasPreferredLang || langsCode3.includes(res[i][0])
}
if (hasPreferredLang) {
break
}
} else { } else {
// no text? roll with it // no text? roll with it
hasPreferredLang = true hasPreferredLang = true