Classes | Functions | Variables
unicode Namespace Reference

Classes

class  Error
 
class  InputError
 

Functions

def _ParseContinue (s)
 
def _UInt (s)
 
def _URange (s)
 
def _UStr (v)
 
def CaseGroups (unicode_dir=_UNICODE_DIR)
 
def Categories (unicode_dir=_UNICODE_DIR)
 
def ReadUnicodeTable (filename, nfields, doline)
 
def Scripts (unicode_dir=_UNICODE_DIR)
 

Variables

int _RUNE_MAX = 0x10FFFF
 
string _UNICODE_DIR = "https://www.unicode.org/Public/12.1.0/ucd"
 

Function Documentation

◆ _ParseContinue()

def unicode._ParseContinue (   s)
private
Parses a Unicode continuation field.

These are of the form '<Name, First>' or '<Name, Last>'.
Instead of giving an explicit range in a single table entry,
some Unicode tables use two entries, one for the first
code value in the range and one for the last.
The first entry's description is '<Name, First>' instead of 'Name'
and the second is '<Name, Last>'.

  '<Name, First>' => ('Name', 'First')
  '<Name, Last>' => ('Name', 'Last')
  'Anything else' => ('Anything else', None)

Args:
  s: continuation field string

Returns:
  pair: name and ('First', 'Last', or None)

Definition at line 97 of file bloaty/third_party/re2/re2/unicode.py.

◆ _UInt()

def unicode._UInt (   s)
private
Converts string to Unicode code point ('263A' => 0x263a).

Args:
  s: string to convert

Returns:
  Unicode code point

Raises:
  InputError: the string is not a valid Unicode value.

Definition at line 30 of file bloaty/third_party/re2/re2/unicode.py.

◆ _URange()

def unicode._URange (   s)
private
Converts string to Unicode range.

  '0001..0003' => [1, 2, 3].
  '0001' => [1].

Args:
  s: string to convert

Returns:
  Unicode range

Raises:
  InputError: the string is not a valid Unicode range.

Definition at line 52 of file bloaty/third_party/re2/re2/unicode.py.

◆ _UStr()

def unicode._UStr (   v)
private
Converts Unicode code point to hex string.

  0x263a => '0x263A'.

Args:
  v: code point to convert

Returns:
  Unicode string

Raises:
  InputError: the argument is not a valid Unicode value.

Definition at line 78 of file bloaty/third_party/re2/re2/unicode.py.

◆ CaseGroups()

def unicode.CaseGroups (   unicode_dir = _UNICODE_DIR)
Returns list of Unicode code groups equivalent under case folding.

Each group is a sorted list of code points,
and the list of groups is sorted by first code point
in the group.

Args:
  unicode_dir: Unicode data directory

Returns:
  list of Unicode code groups

Definition at line 225 of file bloaty/third_party/re2/re2/unicode.py.

◆ Categories()

def unicode.Categories (   unicode_dir = _UNICODE_DIR)
Returns dict mapping category names to code lists.

Args:
  unicode_dir: Unicode data directory

Returns:
  dict mapping category names to code lists

Definition at line 280 of file bloaty/third_party/re2/re2/unicode.py.

◆ ReadUnicodeTable()

def unicode.ReadUnicodeTable (   filename,
  nfields,
  doline 
)
Generic Unicode table text file reader.

The reader takes care of stripping out comments and also
parsing the two different ways that the Unicode tables specify
code ranges (using the .. notation and splitting the range across
multiple lines).

Each non-comment line in the table is expected to have the given
number of fields.  The first field is known to be the Unicode value
and the second field its description.

The reader calls doline(codes, fields) for each entry in the table.
If fn raises an exception, the reader prints that exception,
prefixed with the file name and line number, and continues
processing the file.  When done with the file, the reader re-raises
the first exception encountered during the file.

Arguments:
  filename: the Unicode data file to read, or a file-like object.
  nfields: the number of expected fields per line in that file.
  doline: the function to call for each table entry.

Raises:
  InputError: nfields is invalid (must be >= 2).

Definition at line 124 of file bloaty/third_party/re2/re2/unicode.py.

◆ Scripts()

def unicode.Scripts (   unicode_dir = _UNICODE_DIR)
Returns dict mapping script names to code lists.

Args:
  unicode_dir: Unicode data directory

Returns:
  dict mapping script names to code lists

Definition at line 259 of file bloaty/third_party/re2/re2/unicode.py.

Variable Documentation

◆ _RUNE_MAX

int unicode._RUNE_MAX = 0x10FFFF
private

Definition at line 19 of file bloaty/third_party/re2/re2/unicode.py.

◆ _UNICODE_DIR

string unicode._UNICODE_DIR = "https://www.unicode.org/Public/12.1.0/ucd"
private

Definition at line 16 of file bloaty/third_party/re2/re2/unicode.py.



grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:53