Options
All
  • Public
  • Public/Protected
  • All
Menu

A configuration object for text recognition options.

Text recognition settings need to be assigned (once) to scanning options via ScanSettings.setTextRecognitionSettings and said modified ScanSettings (due to TextRecognitionSettings changes) need to be applied to a scanner via BarcodePicker.applyScanSettings or Scanner.applyScanSettings to take effect.

Hierarchy

  • TextRecognitionSettings

Index

Constructors

constructor

  • new TextRecognitionSettings(parameters?: { regex?: string | RegExp; textDuplicateFilter?: number }): TextRecognitionSettings
  • Create a TextRecognitionSettings instance.

    Parameters

    • parameters: { regex?: string | RegExp; textDuplicateFilter?: number } = {}
      • Optional regex?: string | RegExp
        Default = undefined
        The regular expression for filtering the recognized characters. Text that does not match the regular expression is ignored. You must set a regex in order for text recognition to work.
      • Optional textDuplicateFilter?: number
        Default = 0
        The duplicate filter specifying how often a text can be scanned. When the filter is set to -1, each unique text is only scanned once. When set to 0, duplicate filtering is disabled. Otherwise the duplicate filter specifies an interval in milliseconds. When the same text is scanned within the specified interval it is filtered out as a duplicate.

    Returns TextRecognitionSettings

Methods

getProperty

  • getProperty(key: string): number
  • Get a Scandit Data Capture library text recognition property.

    This function is for internal use only and any functionality that can be accessed through it can and will vanish without public notice from one version to the next. Do not call this function unless you specifically have to.

    Parameters

    • key: string

      The property name.

    Returns number

    The property value. For properties not previously set, -1 is returned.

getRegex

  • getRegex(): undefined | string
  • Get the regular expression for filtering the recognized characters.

    By default, no regex is set. You must set a regex in order for text recognition to work.

    Returns undefined | string

    The regular expression.

getTextDuplicateFilter

  • getTextDuplicateFilter(): number
  • Get the text duplicate filter value.

    By default duplicate filtering is disabled.

    Returns number

    The text duplicate filter value.

setProperty

  • Set a Scandit Data Capture library text recognition property.

    This function is for internal use only and any functionality that can be accessed through it can and will vanish without public notice from one version to the next. Do not call this function unless you specifically have to.

    Parameters

    • key: string

      The property name.

    • value: number

      The property value.

    Returns TextRecognitionSettings

    The updated TextRecognitionSettings object.

setRegex

  • Set the regular expression for filtering the recognized characters.

    Text that does not match the regular expression is ignored.

    Using a regex with a capture group will make results contain only the text matching the capture group. To return the full text matching the regex, use a non-capturing group.

    By default, no regex is set. You must set a regex in order for text recognition to work.

    Parameters

    • Optional regex: string | RegExp

      The new regular expression.

    Returns TextRecognitionSettings

    The updated TextRecognitionSettings object.

setTextDuplicateFilter

  • Set the text duplicate filter value.

    When the filter is set to -1, each unique text is only scanned once. When set to 0, duplicate filtering is disabled. Otherwise the duplicate filter specifies an interval in milliseconds.

    By default duplicate filtering is disabled.

    Parameters

    • durationMilliseconds: number

      The new value (-1, 0, or positive integer).

    Returns TextRecognitionSettings

    The updated TextRecognitionSettings object.

toJSONString

  • toJSONString(): string
  • Returns string

    The configuration object as a JSON string.

Generated using TypeDoc