Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install products.unicodelexicon

How to install Products.UnicodeLexicon

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install products.unicodelexicon
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
2.2 Available View build log
2.1 Available View build log
2.0 Available View build log
Windows (64-bit)
2.2 Available View build log
2.1 Available View build log
2.0 Available View build log
Mac OS X (10.5+)
2.2 Available View build log
2.1 Available View build log
2.0 Available View build log
Linux (32-bit)
2.2 Available View build log
2.1 Available View build log
2.0 Available View build log
Linux (64-bit)
2.2 Available View build log
2.1 Available View build log
2.0 Available View build log
 
License
BSD
Dependencies
Lastest release
version 2.2 on Jan 31st, 2011

Motivation

The standard ZCTextIndex lexicon only deals with 8-bit strings (and only if you get the zope.conf locale setting right). It does not handle Unicode or UTF-8. UnicodeLexicon fills this gap.

Installation

This product adds a ZCTextIndex Unicode Lexicon type to Zope. The lexicon comes with word splitters, stop word removers, a case normalizer, and two accent normalizers.

If you have GenericSetup installed, you can use the included extension profile to create a UnicodeLexicon in your portal_catalog and update the Title, Description, and SearchableText ZCTextIndexes.

There is no upgrade path from UnicodeLexicon 1.0. If you have 1.0 on your system, you have to delete and recreate the lexicon.

Pipeline Elements

The splitter works with all languages that separate words with whitespace characters.

The stop word remover knows about English language stop words only.

The accent normalizer comes in two flavors. There is a normalizer for Latin and Western European text (fr, es, pt, it, en, nl), and one for German and Scandinavian text (de, dk, no, se, fi, is). The latter keeps the umlaut characters ä, ö, and ü in tact.

Custom Pipeline Elements

Additional pipeline elements can be registered via ZCML. E.g.:

<configure
  xmlns="http://namespaces.zope.org/zope"
  xmlns:unicodelexicon="http://namespaces.zope.org/unicodelexicon">

  <include package="Products.UnicodeLexicon" file="meta.zcml" />

  <unicodelexicon:registerPipelineElement
    group="Accent Normalizer"
    name="Normalize accented chars (Custom text)"
    factory="my.package.pipeline.MyCustomNormalizer"
    />

</configure>

Default Encoding

The lexicon assumes either Unicode or UTF-8. If your application uses a different encoding, you can override the default by registering the encoding as a utility:

<configure
  xmlns="http://namespaces.zope.org/zope">

  <utility
    provides="Products.UnicodeLexicon.interfaces.IDefaultEncoding"
    component="my.package.pipeline.defaultEncoding"
    />

</configure>

Changelog

2.2 - 2011-01-30
  • Allow to override the default encoding in ZCML. [stefan]
2.1 - 2011-01-26
  • Add ability to register pipeline elements in ZCML. [stefan]
  • Fix a bug when updating PipelineFactory. [stefan]
2.0 - 2011-01-21
  • Add an ordered PipelineFactory. [stefan]
  • Add an accent-normalizing pipeline element originally contributed by Marc-Auréle Darche. [stefan]
  • Release as Python egg. [stefan]
1.0 - 2006-08-14
  • Initial release. [stefan]

Subscribe to package updates

Last updated Jan 31st, 2011

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.