diff --git a/lib/dircrawl.js b/lib/dircrawl.js index e63c7ba..fbfa999 100644 --- a/lib/dircrawl.js +++ b/lib/dircrawl.js @@ -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() }