JyutpingOperator — Jyutping

cjklib.reading.operator.JyutpingOperator is a mature implementation of the modern Jyutping romanisation for Cantonese developed by the Linguistic Society of Hong Kong (LSHK). Jyutping is frequently used online.


See also

The Linguistic Society of Hong Kong Cantonese Romanization Scheme


class cjklib.reading.operator.JyutpingOperator(**options)

Bases: cjklib.reading.operator.TonalRomanisationOperator

Provides an operator for the Cantonese romanisation Jyutping made by the Linguistic Society of Hong Kong (LSHK).

  • options – extra options
  • dbConnectInst – instance of a DatabaseConnector, if none is given, default settings will be assumed.
  • strictSegmentation – if True segmentation (using segment()) and thus decomposition (using decompose()) will raise an exception if an alphabetic string is parsed which can not be segmented into single reading entities. If False the aforesaid string will be returned unsegmented.
  • case – if set to 'lower', only lower case will be supported, if set to 'both' a mix of upper and lower case will be supported.
  • toneMarkType – if set to 'numbers' the default form of appended numbers from 1 to 6 will be used to mark tones, if set to 'none' no tone marks will be used and no tonal information will be supplied at all.
  • missingToneMark – if set to 'noinfo' no tone information will be deduced when no tone mark is found (takes on value None), if set to 'ignore' this entity will not be valid and for segmentation the behaviour defined by 'strictSegmentation' will take affect.
classmethod getDefaultOptions()

Splits the given plain syllable into onset (initial) and rhyme (final).

The syllabic nasals m, ng will be regarded as being finals.

Returned strings will be lowercase.

Parameter:plainSyllable (str) – syllable without tone marks
Return type:tuple of str
Returns:tuple of entity onset and rhyme
Raises InvalidEntityError:
 if the entity is invalid.


  • Impl: Finals ing, ik, ung, uk differ from other finals with same vowels. What semantics/view do we want to provide on the syllable parts?
getPlainReadingEntities(*args, **kwargs)
getReadingCharacters(*args, **kwargs)
getTonalEntity(plainEntity, tone)
getTones(*args, **kwargs)

Checks if the given plain syllable can occur with stop tones which is the case for syllables with unreleased finals.

Parameter:plainEntity (str) – entity without tonal information
Return type:bool
Returns:True if given syllable can occur with stop tones, False otherwise
isToneValid(plainEntity, tone)

Checks if the given plain entity and tone combination is valid.

Only syllables with unreleased finals occur with stop tones, other forms must not (see hasStopTone()).

  • plainEntity (str) – entity without tonal information
  • tone (str) – tone
Return type:



True if given combination is valid, False otherwise


Table Of Contents

Previous topic

CantoneseYaleOperator — Cantonese Yale

Next topic

CantoneseIPAOperator — IPA for Cantonese

This Page