Skip to content
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 issue when there are multiple candidates for edit_distance_with_substrings #109395

Merged
merged 3 commits into from
Apr 6, 2023

Conversation

chenyukang
Copy link
Member

Fixes #109291

@rustbot
Copy link
Collaborator

rustbot commented Mar 20, 2023

r? @cjgillot

(rustbot has picked a reviewer for you, use r? to override)

@chenyukang chenyukang changed the title Fix issues when there are multiple candidates for edit_distance_with_substrings Fix issue when there are multiple candidates for edit_distance_with_substrings Mar 20, 2023
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 20, 2023
@chenyukang
Copy link
Member Author

Ping @OliverMD
I think Levenshtein is generally a good idea, but here is an edge case in edit_distance_with_substrings:

forced_capture and capture return 1
forced_capture and force_capture also return 1

so we only return capture as a suggestion.

In my PR, I try to combine edit_distance_with_substrings and edit_distance, if there are multiple candidates for edit_distance_with_substrings, try another round of edit_distance.

@OliverMD
Copy link
Contributor

@chenyukang Nice! fwiw this seems like a good idea to me

@chenyukang
Copy link
Member Author

@bors r=cjgillot

@bors
Copy link
Contributor

bors commented Apr 5, 2023

📌 Commit 4fc3c6b has been approved by cjgillot

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 5, 2023
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Apr 6, 2023
…gillot

Fix issue when there are multiple candidates for edit_distance_with_substrings

Fixes rust-lang#109291
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 6, 2023
…gillot

Fix issue when there are multiple candidates for edit_distance_with_substrings

Fixes rust-lang#109291
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 6, 2023
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#109395 (Fix issue when there are multiple candidates for edit_distance_with_substrings)
 - rust-lang#109755 (Implement support for `GeneratorWitnessMIR` in new solver)
 - rust-lang#109782 (Don't leave a comma at the start of argument list when removing arguments)
 - rust-lang#109977 (rustdoc: avoid including line numbers in Google SERP snippets)
 - rust-lang#109980 (Derive String's PartialEq implementation)
 - rust-lang#109984 (Remove f32 & f64 from MemDecoder/MemEncoder)
 - rust-lang#110004 (add `dont_check_failure_status` option in the compiler test)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 3e21d68 into rust-lang:master Apr 6, 2023
@rustbot rustbot added this to the 1.70.0 milestone Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Poor suggestion of alternative function when a name is incorrect
5 participants