Skip to content

made my search feature incoorporate the edit distance work#26

Open
jackdavidweber wants to merge 2 commits into
masterfrom
attachEditDistanceToFrontEnd
Open

made my search feature incoorporate the edit distance work#26
jackdavidweber wants to merge 2 commits into
masterfrom
attachEditDistanceToFrontEnd

Conversation

@jackdavidweber

Copy link
Copy Markdown
Owner

Realized that my portfolio never actually used the edit distance stuff I worked on. While I know that I still need to work on my algorithm a bit, I thought that I should connect it in the meantime as we move away from portfolio and onto capstone.

if(ed < maxED){
retArray.push({"sentence": sentence, "editDistance": ed});
retArray.push({"sentence": sentence, "editDistance": ed, "arrIndex": tracker});
tracker += 1;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit:
tracker++

li[i].style.display = "none";
}

const matches = distanceOfArr(stringArray, filter, 2)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider giving the user feedback that only one term is supported. Fine to just add a todo comment for now.

const matches = distanceOfArr(stringArray, filter, 2)

// make matches re-appear
for (i=0; i < matches.length; i++){

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i --> let i

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or better for(let match of matches) { ... }

} else {
li[i].style.display = "none";
}
stringArray.push(txtValue.toUpperCase()); // FIXME: touppercase might not work

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update comment with might not work with toUpperCase() or remove.

}
stringArray.push(txtValue.toUpperCase()); // FIXME: touppercase might not work

//set all of the list items to disapear so that they can be made to reapear later

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: add spacing for consistancy // set

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants