this post was submitted on 11 Sep 2024
58 points (100.0% liked)

Rust

5953 readers
14 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

[email protected]

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 1 year ago
MODERATORS
top 3 comments
sorted by: hot top controversial new old
[–] [email protected] 6 points 1 month ago

I like being std free

[–] [email protected] 4 points 1 month ago* (last edited 1 month ago) (1 children)

Token-based string distances looks like exactly what I need for my current side project - I'm using Levenshtein but I should be comparing based on words, not characters.

I just need to figure out which (if any) of these does what I need.

Edit: looks like the Python version has that information: https://github.com/life4/textdistance?tab=readme-ov-file#algorithms

[–] [email protected] 2 points 1 month ago

In Python version, pass the list of words directly into the algorithm, and it will compare words. In Rust version, use Algorithm.for_words:

https://docs.rs/textdistance/1.1.0/textdistance/trait.Algorithm.html#method.for_words