Skip to main content

Addok-trigrams

Alternative indexation pattern for Addok, based on trigrams.

Installation

pip install addok-trigrams

Configuration

In your local configuration file:

  • remove unwanted RESULTS_COLLECTORS_PYPATHS:

      from addok.config.default import RESULTS_COLLECTORS_PYPATHS
      RESULTS_COLLECTORS_PYPATHS.remove('addok.helpers.collectors.extend_results_reducing_tokens')
      RESULTS_COLLECTORS_PYPATHS.remove('addok.autocomplete.only_commons_but_geohash_try_autocomplete_collector')
      RESULTS_COLLECTORS_PYPATHS.remove('addok.autocomplete.no_meaningful_but_common_try_autocomplete_collector')
      RESULTS_COLLECTORS_PYPATHS.remove('addok.autocomplete.only_commons_try_autocomplete_collector')
      RESULTS_COLLECTORS_PYPATHS.remove('addok.autocomplete.autocomplete_meaningful_collector')
      RESULTS_COLLECTORS_PYPATHS.remove('addok.fuzzy.fuzzy_collector')
    
  • remove all autocomplete and fuzzy RESULTS_COLLECTORS_PYPATHS, add new ones:

      RESULTS_COLLECTORS_PYPATHS += [
          'addok_trigrams.extend_results_removing_numbers',
          'addok_trigrams.extend_results_removing_one_whole_word',
          'addok_trigrams.extend_results_removing_successive_trigrams',
      ]
    
  • add trigramize to PROCESSORS_PYPATHS:

      from addok.config.default import PROCESSORS_PYPATHS
      PROCESSORS_PYPATHS += [
          'addok_trigrams.trigramize',
      ]
    
  • remove pairs and autocomplete indexers from INDEXERS_PYPATHS:

      from addok.config.default import INDEXERS_PYPATHS
      INDEXERS_PYPATHS.remove('addok.pairs.PairsIndexer')
      INDEXERS_PYPATHS.remove('addok.autocomplete.EdgeNgramIndexer')
    

By default, digit only words are not turned into trigrams. To prevent this, set TRIGRAM_SKIP_DIGIT=False.

Usage

Use addok batch just like with genuine addok for importing documents, but no need for running addok ngrams, given they are already part of the index strategy.

Release files for addok-trigrams 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for addok-trigrams 1.1.1
File Size Uploaded
addok-trigrams-1.1.1.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for addok-trigrams 1.1.1
File Interpreter ABI Platform
addok_trigrams-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 6.7 kB

Release files / addok-trigrams-1.1.1.tar.gz

Download URL addok-trigrams-1.1.1.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
7a7a0f3055f83e2c27b2fb5df2292317f707326b56bb1020e420e63dd1875ef0
BLAKE2b-256 checksum
How to use checksums
d275e118256b0042a35914f3063ac4efe0237d525e6a0a5c138ec4f6b18679cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / addok_trigrams-1.1.1-py3-none-any.whl

Download URL addok_trigrams-1.1.1-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af2bb4b87cd116ab92da2b2e658cddcb894d438e83c58b0482c9fd92ba4752dd
BLAKE2b-256 checksum
How to use checksums
effa883eb846c6c26bcaeae3256e9c7e326d1765c1011c04d84f5d29f9aae23e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page