Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

A general purpose indexer written in Python.

Project Description

A general purpose indexer written in Python. Licensed under the MIT license.

Features

The indexr.buildr package is capable of constructing an inverted index.

The indexr.utils package contains utilities, such as a tokenization method for converting a text to tokens.

Setup

This package can be installed using pip:

pip install indexr

Examples

In this example, an indexer is constructed for 3 files. The example uses the following 3 files:

0.txt:

The 0th document.

1.txt:

The 1st document.

2.txt:

The 2nd document. Some words: repeat, repeat, repeat.

The following code sample can be found in the demo directory (demo/buildr.py).

# Build the index
index = build_index(files, 'index', force_rebuild=True, indexer=SPIMI(show_progress=True))

# Try to find the word "1st"
print('All found occurrences of "1st":')
print(index.find('1st', frequencies=True), "\n")

# Try to find the word "The"
print('All found occurrences of "The":')
print(index.find('The', frequencies=True), "\n")

# Try to find the word "repeat"
print('All found occurrences of "repeat":')
print(index.find('repeat', frequencies=True), "\n")

It gives the following output:

>>> All found occurrences of "1st":
>>> {'1.txt': 1}
>>>
>>> All found occurrences of "The":
>>> {'0.txt': 1, '1.txt': 1, '2.txt': 1}
>>>
>>> All found occurrences of "repeat":
>>> {'2.txt': 3}

So indeed, it finds 1 occurrence of “1st”, 3 occurrences of “The” (1 occurrence in each file) and 3 occurrences of “repeat” (3 occurrences in one file).

Credits

Tools used in rendering this package:

History

1.0.1 (2015-12-07)

  • First release, including the BSB algorithm and the SPIMI algorithm.

0.1.0 (2015-12-04)

  • First release on PyPI.
Release History

Release History

This version
History Node

1.0.1

History Node

1.0.0

History Node

0.1.12

History Node

0.1.11

History Node

0.1.10

History Node

0.1.9

History Node

0.1.8

History Node

0.1.7

History Node

0.1.6

History Node

0.1.5

History Node

0.1.4

History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
indexr-1.0.1-py2.py3-none-any.whl (12.7 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Dec 7, 2015
indexr-1.0.1.zip (24.9 kB) Copy SHA256 Checksum SHA256 Source Dec 7, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting