cjklib.test.readingconverter — Unit tests for reading.converter

Unit tests for cjklib.reading.converter.

Todo

  • Impl: Add second dimension to consistency check for converting between dialect forms for all entities. Use cartesian product option_list x dialects

Classes

class cjklib.test.readingconverter.BrailleGRConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterConsistencyTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.BraillePinyinConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterConsistencyTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.BraillePinyinReferenceTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterReferenceTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.BrailleWadeGilesConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterConsistencyTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.CantoneseYaleDialectConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterConsistencyTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.CantoneseYaleDialectReferenceTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterReferenceTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.GRBrailleConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterConsistencyTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.GRDialectConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterConsistencyTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

testAbbreviationConsistency()
Check that no abbreviation overlaps with another one.
class cjklib.test.readingconverter.GRDialectReferenceTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterReferenceTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.GRIPAConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterConsistencyTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

cleanDecomposition(decomposition, reading, **options)
class cjklib.test.readingconverter.GRPinyinConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterConsistencyTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

cleanDecomposition(decomposition, reading, **options)
class cjklib.test.readingconverter.GRPinyinReferenceTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterReferenceTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.GRWadeGilesConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterConsistencyTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

cleanDecomposition(decomposition, reading, **options)
class cjklib.test.readingconverter.JyutpingDialectConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterConsistencyTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.JyutpingYaleConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterConsistencyTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.JyutpingYaleReferenceTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterReferenceTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.MandarinBrailleIPAConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterConsistencyTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.PinyinBrailleConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterConsistencyTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.PinyinBrailleReferenceTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterReferenceTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.PinyinDialectConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterConsistencyTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.PinyinDialectReferenceTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterReferenceTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.PinyinGRConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterConsistencyTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.PinyinICUTest(methodName='runTest')

Bases: cjklib.test.NeedsDatabaseTest, unittest.TestCase

Test Pinyin tonemark conversion on ICU transformation rule.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

setUp()
testToneMarkPlacement()
Test Pinyin tonemark conversion on ICU transformation rule.
class cjklib.test.readingconverter.PinyinIPAConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterConsistencyTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.PinyinIPAReferenceTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterReferenceTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.PinyinWadeGilesConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterConsistencyTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.PinyinWadeGilesReferenceTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterReferenceTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.ReadingConverterConsistencyTest

Bases: cjklib.test.readingconverter.ReadingConverterTest

Base class for consistency testing of ReadingConverter classes.

FROM_DIALECTS
List of dialects of the source reading.
OPTIONS_LIST
List of option configurations, simmilar to test.readingoperator.DIALECTS.
TO_DIALECTS
List of dialects of the target reading.
testConversionValid()
Check if converted entities are valid in the target reading.
testDefaultOptions()
Test if option dict returned by getDefaultOptions() is well-formed and includes all options found in the test case’s options.
testInstantiation()
Test if given conversion can be instantiated
testLetterCaseConversion()
Check if letter case is transferred during conversion.
testReadingConverterUnique()
Test if only one ReadingConverter exists for each reading.
class cjklib.test.readingconverter.ReadingConverterReferenceTest

Bases: cjklib.test.readingconverter.ReadingConverterTest

Base class for testing of references against ReadingConverter classes. These tests assure that the given values are returned correctly.

CONVERSION_REFERENCES
References to test decompose() operation. List of options/reference tuples, schema: ({options, sourceOptions={}, targetOptions={}}, [(reference, target)])
testConversionReferences()
Test if the given conversion references are reached.
class cjklib.test.readingconverter.ReadingConverterTest

Bases: cjklib.test.NeedsDatabaseTest

Base class for testing of ReadingConverter classes.

CONVERSION_DIRECTION
Tuple of reading names for conversion from reading A to reading B.
static getReadingConverterClasses()

Gets all classes from the reading module that implement ReadingConverter.

Return type:dictionary of string class pairs
Returns:dictionary of all classes inheriting form ReadingConverter
setUp()
shortDescription()
tearDown()
class cjklib.test.readingconverter.ReadingConverterTestCaseCheck(methodName='runTest')

Bases: cjklib.test.NeedsDatabaseTest, unittest.TestCase

Checks if every ReadingConverter has its own ReadingConverterConsistencyTest.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

static getReadingConverterConsistencyTestClasses()

Gets all classes implementing cjklib.test.readingconverter.ReadingConverterConsistencyTest.

Return type:list
Returns:list of all classes inheriting form cjklib.test.readingconverter.ReadingConverterConsistencyTest
testEveryConverterHasConsistencyTest()
Check if every reading has a test case.
class cjklib.test.readingconverter.WadeGilesBrailleConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterConsistencyTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.WadeGilesDialectConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterConsistencyTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.WadeGilesDialectReferenceTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterReferenceTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.WadeGilesGRConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterConsistencyTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.WadeGilesIPAConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterConsistencyTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.WadeGilesIPAReferenceTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterReferenceTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.WadeGilesPinyinConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterConsistencyTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.WadeGilesPinyinReferenceTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterReferenceTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

LOC_CONVERSION_TABLE

Conversion table from the Library of Congress Pinyin Conversion Project - New Chinese Romanization Guidelines: http://www.loc.gov/catdir/pinyin/romcover.html, 28.05.1999 This list contains syllables taken from Dìmíng Hànzì Yìyīnbiǎo (名漢字譯音表, 1971) and ALA-LC romanization tables (1997) for the Wade-Giles parts and furthermore Xiàndài Hànyǔ Cídiǎn (现代汉语词典, 1983) for the Pinyin parts.

Corrected entry: lüeh -> lue to lüe, nüeh -> nue to nüe, o -> e to ê, Removed entry: lüan -> luan (missing source)

setUp()
testLOCTableReferences()
Test if all LoC references are reached.
class cjklib.test.readingconverter.YaleJyutpingConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterConsistencyTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class cjklib.test.readingconverter.YaleJyutpingReferenceTest(methodName='runTest')

Bases: cjklib.test.readingconverter.ReadingConverterReferenceTest, unittest.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

Table Of Contents

Previous topic

cjklib.test.readingoperator — Unit tests for reading.operator

Next topic

cjklib.util — Utilities

This Page