Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/calebwin/quill
A high-level API for computing edit distance
https://github.com/calebwin/quill
java string-distance
Last synced: 18 days ago
JSON representation
A high-level API for computing edit distance
- Host: GitHub
- URL: https://github.com/calebwin/quill
- Owner: calebwin
- Created: 2018-09-04T19:07:48.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-19T23:00:57.000Z (about 6 years ago)
- Last Synced: 2024-08-01T00:45:57.498Z (3 months ago)
- Topics: java, string-distance
- Language: Java
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## What this is
There are many sophisticated algorithms for calculating edit distance or the number of edits needed to change one string into another string. These algorithms compute a variety of metrics that count different types of edits (additions, deletions, substitutions, and/or transpositions).Quill packages three of these algorithms into a simple API.
## How to use it
Once a Quill instance has been created, you can modify the costs (or weights) assigned to different types of edits (as well as building up a map of pairs of characters to a cost for substitution). You can then call the `computeCosts()` method as follows.
```
Quill quill = new Quill();
quill.setAdditionCost(1.5);
quill.setDeletionCost(1.0);
quill.addSubstitutionRule('f', 'g', 1.5);System.out.println(quill.computeCost("iffru", "figure", OperationType.DEFAULT));
```