check for other cases.

This commit is contained in:
Alexandra
2024-10-18 03:17:30 -06:00
committed by GitHub
parent 327350b2bc
commit 31bdca8376

View File

@@ -125,7 +125,15 @@ function findCategory(str, catList){
}
}
else{
return 'Other'
for(let cat in catList.Categories["Others"]){
let catString = catList.Categories["Others"][cat]
if(lowerStr.includes(catString.toLowerCase())){
if(catString.length > catLength){
foundCat = catString
catLength = catString.length
}
}
}
}
return `${foundCat} ${foundSubCat}`.trim()
}