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

Class CEDICTFormatBuilder

source code


Provides an abstract class for loading CEDICT formatted dictionaries.

Two column will be provided for the headword (one for traditional and simplified writings each), one for the reading (e.g. in CEDICT Pinyin) and one for the translation.


To Do (Impl): Proper collation for Translation and Reading columns.

Nested Classes [hide private]

Inherited from EDICTFormatBuilder: TableGenerator

Instance Methods [hide private]
 
__init__(self, dataPath, dbConnectInst, quiet=False)
Constructs the TableBuilder.
source code

Inherited from EDICTFormatBuilder: build, buildFTS3CreateTableStatement, buildFTS3Tables, getArchiveContentName, getFileHandle, getGenerator, insertFTS3Tables, remove, testFTS3

Inherited from EntryGeneratorBuilder: getEntryDict

Inherited from TableBuilder: buildIndexObjects, buildTableObject, findFile

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

Class Variables [hide private]
  COLUMNS = ['HeadwordTraditional', 'HeadwordSimplified', 'Readi...
Columns that will be built
  INDEX_KEYS = [['HeadwordTraditional'], ['HeadwordSimplified'],...
Index keys (not unique) of the created table
  COLUMN_TYPES = {'HeadwordSimplified': String(length=255, conve...
Column types for created table

Inherited from EDICTFormatBuilder: ENCODING, ENTRY_REGEX, FILE_NAMES, FILTER, FULLTEXT_COLUMNS, IGNORE_LINES, 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)

Class Variable Details [hide private]

COLUMNS

Columns that will be built

Value:
['HeadwordTraditional',
 'HeadwordSimplified',
 'Reading',
 'Translation']

INDEX_KEYS

Index keys (not unique) of the created table

Value:
[['HeadwordTraditional'], ['HeadwordSimplified'], ['Reading']]

COLUMN_TYPES

Column types for created table

Value:
{'HeadwordSimplified': String(length=255, convert_unicode=False, asser\
t_unicode=None),
 'HeadwordTraditional': String(length=255, convert_unicode=False, asse\
rt_unicode=None),
 'Reading': String(length=255, convert_unicode=False, assert_unicode=N\
one),
 'Translation': Text(length=None, convert_unicode=False, assert_unicod\
e=None)}