Skip to content

use fuzzy_dir - #69

Open
pheenty wants to merge 10 commits into
timothebot:mainfrom
pheenty:feat/startswith
Open

use fuzzy_dir#69
pheenty wants to merge 10 commits into
timothebot:mainfrom
pheenty:feat/startswith

Conversation

@pheenty

@pheenty pheenty commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

also refactor it, see diff
fixes #72 (idk how but it does)

@pheenty
pheenty requested a review from timothebot as a code owner July 15, 2026 14:07
@timothebot

Copy link
Copy Markdown
Owner

i love your commit messages

@pheenty

pheenty commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

i love your commit messages

:trollface:

anyway this pr is probably ready

@pheenty

pheenty commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

PR #69 and diff +100 -69
nice

@pheenty pheenty mentioned this pull request Jul 25, 2026
It's been a long story about me being held hostage by some haskell
terrorist but I got out, reevaluated my life choices and killed this
stupid fucking 50 chars wide reduce that haunted me for the last week
`.reduce(|(hits_acc, misses_acc), (hits, misses)| (hits_acc + hits, misses_acc + misses))`
who the fuck wrote this even, it totally wasn't me one week ago trust
Also i unironically haven't slept for like 30hrs now lmfao
@pheenty pheenty mentioned this pull request Aug 5, 2026
Comment thread src/fuzzy.rs Outdated

#[test]
fn test_starting_with() {
assert!(score("test", "t") > score("test", "tt"));

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

test has two tt, why shouldn't it score higher?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

hm, actually ok, fair
I'll replace it with the length of common starting chars instead

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it already worked like that lol
this is because t is contained in test and tt is not

Comment thread src/fuzzy.rs Outdated
assert!(score("test abc", "te") > score("test abc", "ta"));
assert!(score("test_abc", "te") > score("test_abc", "ta"));

assert!(score("test_abc_a", "te") > score("test_abc_a", "taa"));

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

taa should have more value

my thought process behind this was that if you have multiple words you just type the first letter

"test abc abc" taa
"test uo uo" tuu

but now for both te is better.

ig you could argue that

te and ta for "test abc" can give the same value, but not better imo

fn test_nonexisting() {
let env = TempEnv::new();
assert!(env.resolve_query("test zzzzzzzzz zzzzzzzzz").is_empty());
assert_eq!(

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Just curious, is there any difference here? Or just readability?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

expected empty vec, found this instead assert_eq error message is more informative than expected vec to be empty, it was not

@pheenty

pheenty commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

see timothebot/fuzzy_dir#3, i think lacy should just use the library yes

@pheenty pheenty changed the title grant extra score for each matching starting char in fuzzy_match_score use fuzzy_dir Aug 5, 2026
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.

cursed fuzzy

2 participants