New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests and out of bounds in scorer #34576

Merged
merged 3 commits into from Sep 19, 2017

Conversation

Projects
None yet
2 participants
@keegancsmith
Contributor

keegancsmith commented Sep 18, 2017

See the commit messages for details.

keegancsmith added some commits Sep 18, 2017

Don't sort scores in test
This test was a noop, because sort sorted `scores` as well. After this change,
the test fails. It passes after the following changes:

* hw should be a higher score than just H, since the w appears after a word
  separator.
* Same with ld and L.
* Change target so that L comes before l. The scorer algorithm is greedy, so
  will not match the upper case L otherwise, which is the point of that specific
  case.
Use correct index for same case bonus
`indexOf` is the index into `target`, while `index` is the correct index into
`query`.

@keegancsmith keegancsmith referenced this pull request Sep 18, 2017

Merged

Several changes #1

@keegancsmith

This comment has been minimized.

Show comment
Hide comment
@keegancsmith

keegancsmith Sep 18, 2017

Contributor

I noticed a simple performance improvement as well, which I also just pushed into this PR.

Contributor

keegancsmith commented Sep 18, 2017

I noticed a simple performance improvement as well, which I also just pushed into this PR.

@bpasero bpasero merged commit 88ed834 into Microsoft:master Sep 19, 2017

2 of 3 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla All CLA requirements met.
Details
@bpasero

This comment has been minimized.

Show comment
Hide comment
@bpasero

bpasero Sep 19, 2017

Member

@keegancsmith nice findings, thanks 👍

Member

bpasero commented Sep 19, 2017

@keegancsmith nice findings, thanks 👍

@bpasero bpasero added this to the September 2017 milestone Sep 19, 2017

@keegancsmith keegancsmith deleted the keegancsmith:scorer branch Sep 19, 2017

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