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()
data = [b'apple', b'banana', b'orange']
values = [1, 3, 2]
darts.build(data, values=values)
result = darts.exact_match_search('apple'.encode('utf-8'))
print(result)
result = darts.common_prefix_search('apples'.encode('utf-8'), pair_type=False)
print(result)
darts.save('sample.dic')
darts.clear()
darts.open('sample.dic')
array = darts.array()
darts.clear()
darts.set_array(array)