<h1 align="center">
<img src="https://raw.githubusercontent.com/maxbachmann/rapidfuzz/master/.github/RapidFuzz.svg?sanitize=true" alt="RapidFuzz" width="400">
</h1>
<h4 align="center">Rapid fuzzy string matching in Python and C++ using the Levenshtein Distance</h4>
<p align="center">
<a href="https://github.com/maxbachmann/rapidfuzz/actions">
<img src="https://github.com/maxbachmann/rapidfuzz/workflows/Build/badge.svg"
alt="Continous Integration">
</a>
<a href="https://pypi.org/project/rapidfuzz/">
<img src="https://img.shields.io/pypi/v/rapidfuzz"
alt="PyPI package version">
</a>
<a href="https://anaconda.org/conda-forge/rapidfuzz">
<img src="https://img.shields.io/conda/vn/conda-forge/rapidfuzz.svg"
alt="Conda Version">
</a>
<a href="https://www.python.org">
<img src="https://img.shields.io/pypi/pyversions/rapidfuzz"
alt="Python versions">
</a>
<a href="https://github.com/maxbachmann/rapidfuzz/blob/dev/LICENSE">
<img src="https://img.shields.io/github/license/maxbachmann/rapidfuzz"
alt="GitHub license">
</a>
</p>
<p align="center">
<a href="#description">Description</a> •
<a href="#installation">Installation</a> •
<a href="#usage">Usage</a> •
<a href="#license">License</a>
</p>
---
## Description
RapidFuzz is a fast string matching library for Python and C++, which is using the string similarity calculations from [FuzzyWuzzy](https://github.com/seatgeek/fuzzywuzzy). However there are two aspects that set RapidFuzz apart from FuzzyWuzzy:
1) It is MIT licensed so it can be used whichever License you might want to choose for your project, while you're forced to adopt the GPL license when using FuzzyWuzzy
2) It is mostly written in C++ and on top of this comes with a lot of Algorithmic improvements to make string matching even faster, while still providing the same results. More details on these performance improvements in form of benchmarks can be found [here](https://github.com/maxbachmann/rapidfuzz/blob/master/Benchmarks.md)
## Installation
RapidFuzz can be installed using [pip](https://pypi.org/project/rapidfuzz/)
```bash
$ pip install rapidfuzz
```
There are pre-built binaries (wheels) for `RapidFuzz` and its dependencies for MacOS (10.9 and later), Linux x86_64 and Windows.
For any other architecture/os `RapidFuzz` can be installed from the source distribution. To do so, a C++14 capable compiler must be installed before running the `pip install rapidfuzz` command. While Linux and MacOs usually come with a compiler it is required to install [C++-Buildtools](https://visualstudio.microsoft.com/visual-cpp-build-tools) on Windows.
## Usage
```console
> from rapidfuzz import fuzz
> from rapidfuzz import process
```
### Simple Ratio
```console
> fuzz.ratio("this is a test", "this is a test!")
96.55171966552734
```
### Partial Ratio
```console
> fuzz.partial_ratio("this is a test", "this is a test!")
100.0
```
### Token Sort Ratio
```console
> fuzz.ratio("fuzzy wuzzy was a bear", "wuzzy fuzzy was a bear")
90.90908813476562
> fuzz.token_sort_ratio("fuzzy wuzzy was a bear", "wuzzy fuzzy was a bear")
100.0
```
### Token Set Ratio
```console
> fuzz.token_sort_ratio("fuzzy was a bear", "fuzzy fuzzy was a bear")
83.8709716796875
> fuzz.token_set_ratio("fuzzy was a bear", "fuzzy fuzzy was a bear")
100.0
```
### Process
```console
> choices = ["Atlanta Falcons", "New York Jets", "New York Giants", "Dallas Cowboys"]
> process.extract("new york jets", choices, limit=2)
[('new york jets', 100), ('new york giants', 78.57142639160156)]
> process.extractOne("cowboys", choices)
("dallas cowboys", 90)
```
## License
RapidFuzz is licensed under the MIT license since I believe that everyone should be able to use it without being forced to adopt the GPL license. Thats why the library is based on an older version of fuzzywuzzy that was MIT licensed as well.
This old version of fuzzywuzzy can be found [here](https://github.com/seatgeek/fuzzywuzzy/tree/4bf28161f7005f3aa9d4d931455ac55126918df7).
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
共630个文件
hpp:468个
h:138个
txx:5个
资源分类:Python库 所属语言:Python 资源全名:rapidfuzz-0.8.2.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
Python库 | rapidfuzz-0.8.2.tar.gz (630个子文件)
setup.cfg 38B
py_fuzz.cpp 15KB
py_levenshtein.cpp 7KB
py_utils.cpp 2KB
difflib.h 14KB
open.h 9KB
endian.h 7KB
make.h 5KB
arm.h 5KB
x86.h 4KB
simd.h 3KB
visualc.h 3KB
versions.h 3KB
stdcpp.h 3KB
bsd.h 3KB
nvcc.h 3KB
32.h 3KB
x86_amd.h 3KB
intel.h 3KB
m68k.h 3KB
metrowerks.h 3KB
net.h 2KB
sunpro.h 2KB
mingw.h 2KB
mips.h 2KB
ibm.h 2KB
ppc.h 2KB
version_number.h 2KB
ios.h 2KB
gcc.h 2KB
sgi_mipspro.h 2KB
greenhills.h 2KB
compaq.h 2KB
parisc.h 2KB
unix.h 2KB
ppc.h 2KB
convex.h 2KB
mingw64.h 2KB
borland.h 2KB
mingw32.h 2KB
windows_uwp.h 2KB
macos.h 2KB
free.h 2KB
superh.h 2KB
stlport.h 2KB
mpw.h 2KB
aix.h 2KB
pgi.h 2KB
comeau.h 2KB
arm.h 2KB
windows_runtime.h 2KB
alpha.h 2KB
hp_acc.h 2KB
compiler.h 2KB
windows_desktop.h 2KB
windows_store.h 2KB
ekopath.h 1KB
clang.h 1KB
qnxnto.h 1KB
gnu.h 1KB
diab.h 1KB
watcom.h 1KB
dignus.h 1KB
edg.h 1KB
llvm.h 1KB
roguewave.h 1KB
digitalmars.h 1KB
dinkumware.h 1KB
palm.h 1KB
tendra.h 1KB
iar.h 1KB
zos.h 1KB
windows_phone.h 1KB
rs6k.h 1KB
kai.h 1KB
gcc_xml.h 1KB
windows_system.h 1KB
sparc.h 1KB
windows_server.h 1KB
ios.h 1KB
metaware.h 1KB
windows.h 1KB
stdcpp3.h 1KB
microtec.h 1KB
stdc.h 1KB
versions.h 1KB
msl.h 1KB
cloudabi.h 1KB
dragonfly.h 1KB
ia64.h 1KB
64.h 1KB
cuda.h 1KB
versions.h 1KB
cygwin.h 1KB
linux.h 1KB
architecture.h 1KB
sgi.h 1KB
android.h 1KB
vms.h 1KB
bsdi.h 1KB
共 630 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功