Package cjklib :: Module build :: Class WordIndexBuilder
[hide private]
[frames] | no frames]

Class WordIndexBuilder

source code


Builds a translation word index for a given dictionary.

Searching for a word will return a headword and reading. This allows to find several dictionary entries with same headword and reading, with only one including the translation word.


To Do (Fix):
Nested Classes [hide private]
  WordEntryGenerator
Generates words for a list of dictionary entries.
Instance Methods [hide private]
 
__init__(self, dataPath, dbConnectInst, quiet=False)
Constructs the TableBuilder.
source code
 
getGenerator(self)
Returns the entry generator.
source code

Inherited from EntryGeneratorBuilder: build, getEntryDict, remove

Inherited from TableBuilder: buildIndexObjects, buildTableObject, findFile

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]
  COLUMNS = ['Headword', 'Reading', 'Word']
Columns that will be built
  COLUMN_TYPES = {'Headword': String(length=255, convert_unicode...
Column types for created table
  INDEX_KEYS = [['Word']]
Index keys (not unique) of the created table
  TABLE_SOURCE = None
Dictionary source
  HEADWORD_SOURCE = 'Headword'
Source of headword

Inherited from EntryGeneratorBuilder: PRIMARY_KEYS

Inherited from TableBuilder: DEPENDS, PROVIDES

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, dataPath, dbConnectInst, quiet=False)
(Constructor)

source code 

Constructs the TableBuilder.

Parameters:
  • dataPath - optional list of paths to the data file(s)
  • dbConnectInst - instance of a DatabaseConnector. If not given all sql code will be printed to stdout.
  • quiet - if true no status information will be printed to stderr
Overrides: object.__init__
(inherited documentation)

getGenerator(self)

source code 

Returns the entry generator. Needs to be implemented by child classes.

Overrides: EntryGeneratorBuilder.getGenerator
(inherited documentation)

Class Variable Details [hide private]

COLUMN_TYPES

Column types for created table

Value:
{'Headword': String(length=255, convert_unicode=False, assert_unicode=\
None),
 'Reading': String(length=255, convert_unicode=False, assert_unicode=N\
one),
 'Word': String(length=255, convert_unicode=False, assert_unicode=None\
)}