Type

Bidirectional character types (UAX #9).

Namespace: Com\Tecnick\Unicode\Data

class Type

Source: src/Type.php:39

Bidirectional character types (UAX #9).

Generated by tools/generate.php from the Unicode Character Database 17.0.0. Do not edit manually.

Constants

DEFAULT_RANGES

Bidirectional type of the unassigned code points of the blocks whose default type is not L, as [first code point, last code point, type].

public const DEFAULT_RANGES = [[0x590, 0x5ff, 'R'], [0x600, 0x7bf, 'AL'], [0x7c0, 0x85f, 'R'], [0x860, 0x8ff, 'AL'], [0x20a0, 0x20cf, 'ET'], [0xfb1d, 0xfb4f, 'R'], [0xfb50, 0xfdcf, 'AL'], [0xfdf0, 0xfdff, 'AL'], [0xfe70, 0xfeff, 'AL'], [0x10800, 0x10cff, 'R'], [0x10d00, 0x10d3f, 'AL'], [0x10d40, 0x10ebf, 'R'], [0x10ec0, 0x10eff, 'AL'], [0x10f00, 0x10f2f, 'R'], [0x10f30, 0x10f6f, 'AL'], [0x10f70, 0x10fff, 'R'], [0x1e800, 0x1ec6
// … truncated, see source

Source: src/Type.php:16493

EXPLICIT_FORMATTING

Array of Explicit formatting codes.

public const EXPLICIT_FORMATTING = [
    'LRE' => 0x202a,
    // Left-to-Right Embedding
    'LRO' => 0x202d,
    // Left-to-Right Override
    'RLE' => 0x202b,
    // Right-to-Left Embedding
    'RLO' => 0x202e,
    // Right-to-Left Override
    'PDF' => 0x202c,
    // Pop Directional Format
    'LRI' => 0x2066,
// … truncated, see source

Source: src/Type.php:89

NEUTRAL

Array of Neutral bidirectional character types.

public const NEUTRAL = [
    'B' => 'B',
    // Paragraph Separator
    'S' => 'S',
    // Segment Separator
    'WS' => 'WS',
    // Whitespace
    'ON' => 'ON',
]

Source: src/Type.php:77

STRONG

Array of Strong bidirectional character types.

public const STRONG = [
    'L' => 'L',
    // Left-to-Right
    'R' => 'R',
    // Right-to-Left
    'AL' => 'AL',
]

Source: src/Type.php:51

UNI

Bidirectional type of the code points whose type is not L (Left-to-Right).

Code points missing from this map take the type returned by getType().

public const UNI = [0x0 => 'BN', 0x1 => 'BN', 0x2 => 'BN', 0x3 => 'BN', 0x4 => 'BN', 0x5 => 'BN', 0x6 => 'BN', 0x7 => 'BN', 0x8 => 'BN', 0x9 => 'S', 0xa => 'B', 0xb => 'S', 0xc => 'WS', 0xd => 'B', 0xe => 'BN', 0xf => 'BN', 0x10 => 'BN', 0x11 => 'BN', 0x12 => 'BN', 0x13 => 'BN', 0x14 => 'BN', 0x15 => 'BN', 0x16 => 'BN', 0x17 => 'BN', 0x18 => 'BN', 0x19 => 'BN', 0x1a => 'BN', 0x1b => 'BN', 0x1c => 'B', 0x1d => 'B', 0
// … truncated, see source

Source: src/Type.php:107

UNICODE_VERSION

Version of the Unicode Character Database the tables are derived from.

public const UNICODE_VERSION = '17.0.0'

Source: src/Type.php:44

WEAK

Array of Weak bidirectional character types.

public const WEAK = [
    'EN' => 'EN',
    // European Number
    'ES' => 'ES',
    // European Number Separator
    'ET' => 'ET',
    // European Number Terminator
    'AN' => 'AN',
    // Arabic Number
    'CS' => 'CS',
    // Common Number Separator
    'NSM' => 'NSM',
// … truncated, see source

Source: src/Type.php:62

Methods

getBidiClass()

Get the bidirectional class of a Unicode code point.

Returns null for the explicit formatting codes (LRE, LRO, RLE, RLO, PDF, LRI, RLI, FSI, PDI).

public static getBidiClass(int $ord): ?BidiClass

Parameters:

  • $ord (int): Unicode code point.

Returns: ?BidiClass

Source: src/Type.php:16555

getType()

Get the bidirectional type of a Unicode code point.

public static getType(int $ord): string

Parameters:

  • $ord (int): Unicode code point.

Returns: string

Source: src/Type.php:16524