[Zope-CVS] CVS: Products/ZCTextIndex - ILexicon.py:1.1.2.1

Barry Warsaw barry@wooz.org
Tue, 30 Apr 2002 17:35:38 -0400


Update of /cvs-repository/Products/ZCTextIndex
In directory cvs.zope.org:/tmp/cvs-serv12092

Added Files:
      Tag: TextIndexDS9-branch
	ILexicon.py 
Log Message:
The ILexicon interface.


=== Added File Products/ZCTextIndex/ILexicon.py ===
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
# 
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
# 
##############################################################################
"""

Revision information:
$Id: ILexicon.py,v 1.1.2.1 2002/04/30 21:35:38 bwarsaw Exp $
"""

from Interface import Base as Interface

class ILexicon(Interface):
    """Object responsible for converting text to word identifiers."""

    def termToWordIds(text):
        """Return a sequence of ids of the words parsed from the text.

        Parses the text as if they are search terms, and skips words that
        aren't in the lexicon.
        """

    def sourceToWordIds(text):
        """Return a sequence of ids of the words parsed from the text.

        Parses the text as if they come from a source document, and creates
        new word ids for words that aren't (yet) in the lexicon.
        """