universal-automata / liblevenshtein-java

Various utilities regarding Levenshtein transducers. (Java)
MIT License
56 stars 20 forks source link

Weighted Levenshtein distance support #78

Open albertoandreottiATgmail opened 6 years ago

albertoandreottiATgmail commented 6 years ago

Hello,

I wanted to know if the library has support to provide custom edit penalties. For example, specify edit distance for replacement "1" -> "l" to be different from "1" -> "A", etc.

Alberto.

matanox commented 6 years ago

I don't believe so. If interested in small edit distances though, you may, depending on your scenario and data, accomplish the same effect by doing some math projecting to a max intended ordinary edit distance to use with this library, then proceeding to performing your nuanced weights/penalty scheme on the cohort that remains after using this library with your chosen first distance value.

I doubt you'd currently find any implementation that does, but this is an interesting project idea.

roedoejet commented 1 year ago

I don't believe so. If interested in small edit distances though, you may, depending on your scenario and data, accomplish the same effect by doing some math projecting to a max intended ordinary edit distance to use with this library, then proceeding to performing your nuanced weights/penalty scheme on the cohort that remains after using this library with your chosen first distance value.

I doubt you'd currently find any implementation that does, but this is an interesting project idea.

Interesting idea but assuming some substitutions could be made at low or zero cost, it would be difficult to estimate a correct 'max intended ordinary edit distance' in advance.