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

Class UnihanDerivedBuilder

source code


Provides an abstract class for building a table with a relation between a Chinese character and another column using the Unihan database.

Instance Methods [hide private]
 
__init__(self, dataPath, dbConnectInst, quiet=False)
Constructs the TableBuilder.
source code
 
getGenerator(self)
Returns the entry generator.
source code
 
build(self)
Build the table provided by the TableBuilder.
source code

Inherited from EntryGeneratorBuilder: 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]
  DEPENDS = ['Unihan']
Contains the names of the tables needed for the build process.
  COLUMN_SOURCE = None
Unihan table column providing content for the table.
  COLUMN_TARGET = None
Column name for new data in created table.
  COLUMN_TARGET_TYPE = Text(length=None, convert_unicode=False, ...
Type of column for new data in created table.
  GENERATOR_CLASS = None
Class defining the iterator for creating the table's data.

Inherited from EntryGeneratorBuilder: COLUMNS, COLUMN_TYPES, INDEX_KEYS, PRIMARY_KEYS

Inherited from TableBuilder: 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)

build(self)

source code 

Build the table provided by the TableBuilder.

Methods should raise an IOError if reading a data source fails. The DatabaseBuilder knows how to handle this case and is able to proceed.

Overrides: TableBuilder.build
(inherited documentation)

Class Variable Details [hide private]

COLUMN_SOURCE

Unihan table column providing content for the table. Needs to be overwritten in subclass.

Value:
None

COLUMN_TARGET

Column name for new data in created table. Needs to be overwritten in subclass.

Value:
None

COLUMN_TARGET_TYPE

Type of column for new data in created table.

Value:
Text(length=None, convert_unicode=False, assert_unicode=None)

GENERATOR_CLASS

Class defining the iterator for creating the table's data. The constructor needs to take two parameters for the list of entries from the Unihan database and the 'quiet' flag. Needs to be overwritten in subclass.

Value:
None