dictdlib
index
/home/jgoerzen/tree/dictdlib/dictdlib.py

# Dictionary creation library
# Copyright (C) 2002 John Goerzen
# <jgoerzen@complete.org>
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

 
Modules
            
string
sys
 
Classes
            
DictWriter
 
class DictWriter
       
   Methods defined here:
__init__(self, basename, url='unknown', shortname='unknown', longinfo='unknown', quiet=0)
Initialize a DictWriter object.  Will create 'basename.dict' and
'basename.index' files.  url, shortname, and longinfo specify the
respective attributes of the database.  If quiet is 1,
status messages are not printed.
finish(self, dosort=1)
Called to finish the writing process.  **REQUIRED**.
This will write the index and close the files.
 
dosort is optional and defaults to true.  If set to false,
dictlib will not sort the index file.  In this case, you
MUST manually sort it through "sort -df" before it can be used.
You might want to do this if you have a very large file since
dictdlib's sort algorithm is not very efficient yet.
update(self, string)
Writes string out, if not quiet.
writeentry(self, defstr, headwords)
Writes an entry.  defstr holds the content of the definition.
headwords is a list specifying one or more words under which this
definition should be indexed.  This function always adds 
 
to the end of defstr.

Data and non-method functions defined here:
__doc__ = None
__module__ = 'dictdlib'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
 
Functions
            
b64_decode(str)
Takes as input a string and returns an integer value of it decoded
with the base64 algorithm used by dict indexes.
b64_encode(val)
Takes as input an integer val and returns a string of it encoded
with the base64 algorithm used by dict indexes.
sortnormalize(x)
Returns a value such that x is mapped to a format that sorts properly
with standard comparison.
 
Data
             __file__ = './dictdlib.pyc'
__name__ = 'dictdlib'
b64_list = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
info_headword = '00-database-info'
short_headword = '00-database-short'
url_headword = '00-database-url'
validdict = {' ': 1, '0': 1, '1': 1, '2': 1, '3': 1, '4': 1, '5': 1, '6': 1, '7': 1, '8': 1, ...}
x = ' '