Skip to content

Commit

Permalink
updated maxNames cap after testing
Browse files Browse the repository at this point in the history
  • Loading branch information
siddaay committed Dec 12, 2024
1 parent d1ba111 commit 1b9410a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/conflicts/UnknownName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ export class UnknownName extends Conflict {
context,
);

const userInput: string = this.name.name.text.text // user input
const maxNames: number = 1000; // the maximum number of names we want to check
names = names.slice(0, maxNames) // truncate the names array after the desired amount

const userInput: string = this.name.name.text.text // unknown name input by user
const maxNames: number = 50; // the maximum number of names we want to check edit distance for (cap for performance)
names.splice(maxNames) // truncate the names array after the desired amount
for (let i = names.length-1; i >= 0; i--) {
const currName: string = names[i].definition.names.names[0].name.text.text // loop through every name
const currName: string = names[i].definition.names.names[0].name.text.text // get name in string form from Refer object

if (this.levenshtein(userInput, currName) > 1) { // check if levenshtein distance is greater than 1
names.splice(i, 1) // filter out names that are dissimilar
Expand Down

0 comments on commit 1b9410a

Please sign in to comment.