Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CollationOptions

Options used to configure collation options.

Hierarchy

  • CollationOptions

Index

Constructors

constructor

Methods

getLocale

  • getLocale(): string
  • The ICU locale. See Supported Languages and Locales for a list of supported locales.

    The default value is simple which specifies simple binary comparison.

    Returns string

getStrength

  • getStrength(): any
  • Optional. The level of comparison to perform. Corresponds to ICU Comparison Levels. Possible values are:

    Value Description 1 Primary level of comparison. Collation performs comparisons of the base characters only, ignoring other differences such as diacritics and case. 2 Secondary level of comparison. Collation performs comparisons up to secondary differences, such as diacritics. That is, collation performs comparisons of base characters (primary differences) and diacritics (secondary differences). Differences between base characters takes precedence over secondary differences. 3 Tertiary level of comparison. Collation performs comparisons up to tertiary differences, such as case and letter variants. That is, collation performs comparisons of base characters (primary differences), diacritics (secondary differences), and case and variants (tertiary differences). Differences between base characters takes precedence over secondary differences, which takes precedence over tertiary differences. This is the default level.

    4 Quaternary Level. Limited for specific use case to consider punctuation when levels 1-3 ignore punctuation or for processing Japanese text. 5 Identical Level. Limited for specific use case of tie breaker.

    Returns any

isBackwards

  • isBackwards(): boolean
  • Optional. Flag that determines whether strings with diacritics sort from back of the string, such as with some French dictionary ordering.

    If true, compare from back to front. If false, compare from front to back.

    The default value is false.

    Returns boolean

isCaseLevel

  • isCaseLevel(): boolean
  • Optional. Flag that determines whether to include case comparison at strength level 1 or 2.

    If true, include case comparison; i.e.

    When used with strength:1, collation compares base characters and case. When used with strength:2, collation compares base characters, diacritics (and possible other secondary differences) and case. If false, do not include case comparison at level 1 or 2. The default is false.

    Returns boolean

isNormalization

  • isNormalization(): boolean
  • Optional. Flag that determines whether to check if text require normalization and to perform normalization. Generally, majority of text does not require this normalization processing.

    If true, check if fully normalized and perform normalization to compare text. If false, does not check.

    The default value is false.

    Returns boolean

isNumericOrdering

  • isNumericOrdering(): boolean
  • Optional. Flag that determines whether to compare numeric strings as numbers or as strings.

    If true, compare as numbers; i.e. "10" is greater than "2". If false, compare as strings; i.e. "10" is less than "2".

    Default is false.

    Returns boolean

setBackwards

  • Optional. Flag that determines whether strings with diacritics sort from back of the string, such as with some French dictionary ordering.

    If true, compare from back to front. If false, compare from front to back.

    The default value is false.

    Parameters

    • backwards: boolean

    Returns CollationOptions

setCaseLevel

  • Optional. Flag that determines whether to include case comparison at strength level 1 or 2.

    If true, include case comparison; i.e.

    When used with strength:1, collation compares base characters and case. When used with strength:2, collation compares base characters, diacritics (and possible other secondary differences) and case. If false, do not include case comparison at level 1 or 2. The default is false.

    Parameters

    • caseLevel: boolean

    Returns CollationOptions

setLocale

  • The ICU locale. See Supported Languages and Locales for a list of supported locales.

    The default value is simple which specifies simple binary comparison.

    Parameters

    • locale: string

    Returns CollationOptions

setNormalization

  • Optional. Flag that determines whether to check if text require normalization and to perform normalization. Generally, majority of text does not require this normalization processing.

    If true, check if fully normalized and perform normalization to compare text. If false, does not check.

    The default value is false.

    Parameters

    • normalization: boolean

    Returns CollationOptions

setNumericOrdering

  • Optional. Flag that determines whether to compare numeric strings as numbers or as strings.

    If true, compare as numbers; i.e. "10" is greater than "2". If false, compare as strings; i.e. "10" is less than "2".

    Default is false.

    Parameters

    • numericOrdering: boolean

    Returns CollationOptions

setStrength

  • Optional. The level of comparison to perform. Corresponds to ICU Comparison Levels. Possible values are:

    Value Description 1 Primary level of comparison. Collation performs comparisons of the base characters only, ignoring other differences such as diacritics and case. 2 Secondary level of comparison. Collation performs comparisons up to secondary differences, such as diacritics. That is, collation performs comparisons of base characters (primary differences) and diacritics (secondary differences). Differences between base characters takes precedence over secondary differences. 3 Tertiary level of comparison. Collation performs comparisons up to tertiary differences, such as case and letter variants. That is, collation performs comparisons of base characters (primary differences), diacritics (secondary differences), and case and variants (tertiary differences). Differences between base characters takes precedence over secondary differences, which takes precedence over tertiary differences. This is the default level.

    4 Quaternary Level. Limited for specific use case to consider punctuation when levels 1-3 ignore punctuation or for processing Japanese text. 5 Identical Level. Limited for specific use case of tie breaker.

    Parameters

    • strength: any

    Returns CollationOptions

toJson

  • toJson(): {}
  • Returns {}

    • [key: string]: any

Generated using TypeDoc