HED JavaScript Library
    Preparing search index...

    Class CharacterSets

    A read-only view of character_sets.json: named sets, aliases, defaults, whole-value rules and exclusions.

    Index
    _regexCache: Map<any, any>
    aliases: any
    declarationWinsFrom: any
    forbidden: any
    sets: {}

    The named character sets: name -> {regex, description}.

    valueClassDefaults: any
    valueClassWords: any
    • Resolve an alias ("slash" -> "forward-slash"); any other name is returned unchanged.

      Parameters

      • name: string

        A character set name.

      Returns string

      The canonical name.

    • The character set names of an allowedCharacter declaration.

      Each value of the attribute is one name; a value that is not a single character may also hold several names separated by commas. A single character, a comma included, names itself (literal_names).

      Parameters

      • values: Iterable<any, any, any>

        The values of the attribute.

      Returns string[]

      The names, in declaration order.

    • The default character names of a standard value class for a standard schema version.

      Parameters

      • className: string

        A value class name.

      • standardVersion: string | null

        The standard schema version in force; null picks the newest entry.

      Returns string[]

      The names; empty when the file has no defaults for the class.

    • Say what the names allow, for an error message.

      A single named set is followed by its description without the markdown backticks; several names are listed as written; a literal punctuation character is quoted.

      Parameters

      • names: string[]

        Set names, aliases, or single literal characters.

      Returns string

      The description.

    • Whether no HED string may contain a character (hed_string.forbidden: listed characters and code ranges).

      Parameters

      • character: string

        A single character.

      Returns boolean

    • Whether a name is a set, an alias, or a single literal character (section 2.2, literal names).

      Parameters

      • name: string

        A character set name.

      Returns boolean

    • The characters of a text that none of the names allows.

      Parameters

      • text: string

        The text to check.

      • names: string[]

        Set names, aliases, or single literal characters. No names means no constraint.

      Returns [number, string][]

      [index, character] pairs; the index counts UTF-16 code units, as JavaScript string indices do.

    • A regular expression matching exactly one character that any of the names allows.

      Parameters

      • names: string[]

        Set names, aliases, or single literal characters.

      Returns RegExp

      The expression (Unicode mode, so a character outside the BMP is one character).

    • The whole-value regular expression of a value class, if it has one.

      Parameters

      • className: string

        A value class name.

      Returns RegExp | null

      The expression, or null.