MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / canon

Function canon

src/__init__.py:23707–23717  ·  view source on GitHub ↗
(c)

Source from the content-addressed store, hash-verified

23705
23706
23707def canon(c):
23708 assert isinstance(c, int)
23709 # TODO: proper unicode case folding
23710 # TODO: character equivalence (a matches ä, etc)
23711 if c == 0xA0 or c == 0x2028 or c == 0x2029:
23712 return ord(' ')
23713 if c == ord('\r') or c == ord('\n') or c == ord('\t'):
23714 return ord(' ')
23715 if c >= ord('A') and c <= ord('Z'):
23716 return c - ord('A') + ord('a')
23717 return c
23718
23719
23720def chartocanon(s):

Callers 1

chartocanonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…