Skip to main content

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


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.8.0.tar.gz (17.4 kB view details)

Uploaded Source

File details

Details for the file dartsclone-0.8.0.tar.gz.

File metadata

  • Download URL: dartsclone-0.8.0.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

File hashes

Hashes for dartsclone-0.8.0.tar.gz
Algorithm Hash digest
SHA256 9ee267b9760427e767152433be3ae264b3de5cfe5e5a20027ecf6e1b719a06f8
MD5 b412d6725dc6cd84138dd0abbe1deacc
BLAKE2b-256 68bae4a1e07b24ad0f26c5519ca37978efe30c9616f556bd49709e42e64dd5dc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page