Python binding of Darts Clone
Project description
darts-clone-python
Darts-clone binding for Python 3.x.
This repository provides Cython-based pip-installable package.
Installation
pip install dartsclone
Usage
darts-clone-python is almost compatible with darts-clone.
import dartsclone
darts = dartsclone.DoubleArray()
# build index
data = [b'apple', b'banana', b'orange']
values = [1, 3, 2]
darts.build(data, values=values)
# exact match search
result = darts.exact_match_search('apple'.encode('utf-8'))
print(result) # [1, 5]
# common prefix search
result = darts.common_prefix_search('apples'.encode('utf-8'), pair_type=False)
print(result) # [1]
# save index
darts.save('sample.dic')
# load index
darts.clear()
darts.open('sample.dic')
# dump array data
array = darts.array()
# load array data
darts.clear()
darts.set_array(array)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dartsclone-0.6.tar.gz
(17.3 kB
view details)
File details
Details for the file dartsclone-0.6.tar.gz.
File metadata
- Download URL: dartsclone-0.6.tar.gz
- Upload date:
- Size: 17.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b4f9732e2c3597428e8f88e2d6d7b0fc5fd3bf07cd41b7cc512488aea083f41
|
|
| MD5 |
e37906016d8d7bd1533eed67ebe7de7f
|
|
| BLAKE2b-256 |
7d4d45acbe9d0795d8ceef0fee1f9ac2dcbf27dca3a0578a023fcdc3fef6fd89
|