https://github.com/sean2077/editdis
A single header C++ library for compute edit distance (Levenshtein distance), supporting wstring ( and Chinese string).
https://github.com/sean2077/editdis
chinese cpp edit-distance levenshtein-distance wstring
Last synced: 12 months ago
JSON representation
A single header C++ library for compute edit distance (Levenshtein distance), supporting wstring ( and Chinese string).
- Host: GitHub
- URL: https://github.com/sean2077/editdis
- Owner: sean2077
- License: mit
- Created: 2023-01-10T05:14:07.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-12T03:15:27.000Z (over 3 years ago)
- Last Synced: 2025-06-30T20:05:58.759Z (12 months ago)
- Topics: chinese, cpp, edit-distance, levenshtein-distance, wstring
- Language: C++
- Homepage:
- Size: 4.88 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# editdis
A single header C++ library for compute edit distance (Levenshtein distance), supporting wstring ( and Chinese string).
## Usage
```cpp
#include "editdis.hpp"
int main(int argc, const char** argv) {
// support Chinese string
int dis = editdis::edit_distance("浙B82D60", "闽B82060");
std::cout << dis << std::endl; // 2
// support wstring
dis = editdis::edit_distance(L"浙B82D60", L"闽B82060");
std::cout << dis << std::endl; // 2
return 0;
}
```