getStrokeCount(self,
char,
zVariant,
strokeCountDict,
unihanStrokeCountDict,
decompositionDict)
| source code
|
Gets the stroke count of the given character by summing up the stroke
count of its components and using the Unihan table as fallback.
For the sake of consistency this method doesn't take the stroke count
given by Unihan directly but sums up the stroke counts of the components
to make sure the sum of component's stroke count will always give the
characters stroke count. The result yielded will be in many cases even
more precise than the value given in Unihan (not depending on the actual
glyph form).
Once calculated the stroke count will be cached in the given
strokeCountDict object.
- Parameters:
char (str) - Chinese character
zVariant (int) - Z-variant of character
- Returns: int
- stroke count
- Raises:
ValueError - if stroke count is ambiguous due to inconsistent values wrt Unihan
vs. own data.
NoInformationError - if decomposition is incomplete
|