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

Class CEDICTBuilder

source code


Builds the CEDICT dictionary.

Nested Classes [hide private]

Inherited from EDICTFormatBuilder: TableGenerator

Instance Methods [hide private]
tuple
filterUmlaut(self, entry)
Converts the 'u:' to 'ü'.
source code
tuple
FILTER(self, entry)
Filter to apply to the read entry before writing to table.
source code
str
getArchiveContentName(self, filePath)
Function extracting the name of contained file from the zipped archive using the file name.
source code

Inherited from CEDICTFormatBuilder: __init__

Inherited from EDICTFormatBuilder: build, buildFTS3CreateTableStatement, buildFTS3Tables, 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]
  PROVIDES = 'CEDICT'
Contains the name of the table provided by this module.
  FILE_NAMES = ['cedict_1_0_ts_utf-8_mdbg.zip', 'cedict_1_0_ts_u...
Names of file containing the edict formated dictionary.
  ENCODING = 'utf-8'
Encoding of the dictionary file.

Inherited from CEDICTFormatBuilder: COLUMNS, COLUMN_TYPES, INDEX_KEYS

Inherited from EDICTFormatBuilder: ENTRY_REGEX, FULLTEXT_COLUMNS, IGNORE_LINES, PRIMARY_KEYS

Inherited from TableBuilder: DEPENDS

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

filterUmlaut(self, entry)

source code 

Converts the 'u:' to 'ü'.

Parameters:
  • entry (tuple) - a dictionary entry
Returns: tuple
the given entry with corrected ü-voul

FILTER(self, entry)

source code 

Filter to apply to the read entry before writing to table.

Parameters:
  • entry (tuple) - a dictionary entry
Returns: tuple
the given entry with corrected ü-voul
Overrides: FILTER

getArchiveContentName(self, filePath)

source code 

Function extracting the name of contained file from the zipped archive using the file name. Reimplement and adapt to own needs.

Parameters:
  • filePath - path of file
Returns: str
name of file in archive
Overrides: EDICTFormatBuilder.getArchiveContentName
(inherited documentation)

Class Variable Details [hide private]

FILE_NAMES

Names of file containing the edict formated dictionary.

Value:
['cedict_1_0_ts_utf-8_mdbg.zip',
 'cedict_1_0_ts_utf-8_mdbg.txt.gz',
 'cedictu8.zip',
 'cedict_ts.u8',
 'cedict_1_0_ts_utf-8_mdbg.txt']