Yoctol Text Indexer
Project description
# text-indexer
[![Build Status](https://travis-ci.org/Yoctol/text-indexer.svg?branch=master)](https://travis-ci.org/Yoctol/text-indexer)
[![PyPI version](https://badge.fury.io/py/text-indexer.svg)](https://badge.fury.io/py/text-indexer)
Indexer transforms list of strings to list of integers according to the string2int mapping function(e.q. a look-up table).
## Getting Started
### Prerequisites
1. Please create a virtual environment with python 3.6
2. Type the following command in terminal:
```
make install
```
### Running the tests
```
make test
```
## How to completely save and load indexer?
### 1. Save
```python
from text_indexer.io import save_indexer
custom_indexer_instance = XXIndexer()
save_indexer(indexer=custom_indexer_instance, output_dir='directory-to-export-indexer')
```
If output_dir is `/home/user/example/`, you will get a tar file `/home/user/example-all.tar.gz` after calling
`save_indexer`.
### 2. Load
```python
from text_indexer.io import load_indexer
your_indexer = load_indexer(path='indexer-tar-filepath')
```
[![Build Status](https://travis-ci.org/Yoctol/text-indexer.svg?branch=master)](https://travis-ci.org/Yoctol/text-indexer)
[![PyPI version](https://badge.fury.io/py/text-indexer.svg)](https://badge.fury.io/py/text-indexer)
Indexer transforms list of strings to list of integers according to the string2int mapping function(e.q. a look-up table).
## Getting Started
### Prerequisites
1. Please create a virtual environment with python 3.6
2. Type the following command in terminal:
```
make install
```
### Running the tests
```
make test
```
## How to completely save and load indexer?
### 1. Save
```python
from text_indexer.io import save_indexer
custom_indexer_instance = XXIndexer()
save_indexer(indexer=custom_indexer_instance, output_dir='directory-to-export-indexer')
```
If output_dir is `/home/user/example/`, you will get a tar file `/home/user/example-all.tar.gz` after calling
`save_indexer`.
### 2. Load
```python
from text_indexer.io import load_indexer
your_indexer = load_indexer(path='indexer-tar-filepath')
```
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
text-indexer-1.1.1.tar.gz
(29.2 kB
view details)
Built Distribution
File details
Details for the file text-indexer-1.1.1.tar.gz
.
File metadata
- Download URL: text-indexer-1.1.1.tar.gz
- Upload date:
- Size: 29.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed8fddf1d45d7098ee9d38634395cb4967cdbd878ee693b6976897f91f16eae3 |
|
MD5 | afb183c0d49272fbbe2afe8c0aa96e98 |
|
BLAKE2b-256 | a629140eeb325ba32d13bd1b09055610771aaac6819555606625274f6d3ae44f |
File details
Details for the file text_indexer-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: text_indexer-1.1.1-py3-none-any.whl
- Upload date:
- Size: 25.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dece711b7c9c14bb5885596636ac0e05950ca9a51e794d6da517718f11982f51 |
|
MD5 | 933784017c5fa0745000939d06d31aca |
|
BLAKE2b-256 | 7b23a24d1b584ad1a8c75352e9dec332f70c347ca1a872788941d8397caf01cc |