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

Exact match failure case #52

Open
rene-aguirre opened this issue Jun 11, 2019 · 1 comment
Open

Exact match failure case #52

rene-aguirre opened this issue Jun 11, 2019 · 1 comment

Comments

@rene-aguirre
Copy link

rene-aguirre commented Jun 11, 2019

It seems exact match with a prefix might score lower that a set of characters scattered over the full path.

Test input (test.txt), adding extra before and after placeholder lines:

noise/to/start.txt
Home/level/other/With/ore/al.d
kind/of/very/long/path/This/is/PrefixedHelloWorld.txt
some/path/to/fillup.txt

Matching:
cat test.txt | ./cpsm_cli --limit 2 --query HelloWorld

Output:

Home/level/other/With/ore/al.d
- score: 139646541430753; prefix_level = 0, whole_basename_match = 0, basename_longest_submatch = 0, basename_match_count = 0, basename_word_gaps = 0, crfile_basename_shared_words = 0, crfile_path_distance = 6, unmatched_suffix_len = 4, item_len = 30
- match positions: 0, 3, 5, 9, 11, 17, 22, 23, 27, 29
kind/of/very/long/path/This/is/PrefixedHelloWorld.txt
- score: 139646532747210; prefix_level = 0, whole_basename_match = 0, basename_longest_submatch = 0, basename_match_count = 0, basename_word_gaps = 0, crfile_basename_shared_words = 0, crfile_path_distance = 8, unmatched_suffix_len = 22, item_len = 53
- match positions: 39, 40, 41, 42, 43, 44, 45, 46, 47, 48

The exact "HelloWorld" match is weighted lower (mostly due crfile_path_distance score)

BTW... Thanks for the great work!

@noscript
Copy link
Contributor

I have the same problem. I wish there would be an option to honor exact match, similar to FZF's --exact.

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

No branches or pull requests

2 participants