Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions src/app/components/tags-auto/tags.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ function getCleanTwoWordMap(

const twoWordFreqMap: Map<string, number> = new Map();

potentialTwoWordMap.forEach((val: number, key: string) => {

for (const [key, val] of potentialTwoWordMap.entries()) {
if (val > 3) { // set a variable here instead!
let newCounter: number = 0;

Expand All @@ -40,8 +39,7 @@ function getCleanTwoWordMap(
}
}
}
});

};
return twoWordFreqMap;
}

Expand All @@ -56,14 +54,14 @@ function getPotentialTwoWordTags(
): Map<string, number> {
const potentialTwoWordMap: Map<string, number> = new Map();

oneWordFreqMap.forEach((val: number, key: string) => {
for (const [key, val] of oneWordFreqMap) {
findTwoWords(
potentialTwoWordMap,
key,
onlyFileNames,
oneWordFreqMap
);
});
}

return potentialTwoWordMap;
}
Expand All @@ -83,14 +81,13 @@ function findTwoWords(
onlyFileNames: string[],
oneWordFreqMap: Map<string, number>
): void {

const filesContainingTheSingleWord: string[] = [];

onlyFileNames.forEach((fileName) => {
for (const fileName of onlyFileNames) {
if (fileName.includes(singleWord)) {
filesContainingTheSingleWord.push(fileName);
}
});
}

filesContainingTheSingleWord.forEach((fileName) => {

Expand Down