Collapse
CollapsingX
  • - or -

Accessing SureDotOCR step results


You should typically access results for the SureDotOCR step according to each String under the StringsToRead collection. For example, to get the score of the first string and second string read, you can use:

SureDotOCR.StringsToRead("String").Score
SureDotOCR.StringsToRead("String2").Score

You can access the results by displaying the outputs from the Link editor. The following is a hierarchical view of the results available for the SureDotOCR step. The Score property of the first String is highlighted.

At design-time, you can use the Quick Evaluate pane to examine the value of a result. To change the string you want to access, move the cursor over the item in parentheses, and when the cursor changes shape (from an arrow to a hand), click to pop up the selection box. You can also do this to change other interactive type values, such as index (for example, for CharacterOccurrences).

The String entries under StringsToRead (for example, "String" and "String2") correspond to the Strings to read that you added to your step, each of which has one or more string models. Regardless of the number of string models, only one string can be read and returned as a result for every string to read (one string per line of text). The string read is the one that best corresponds to its string model (the one with the highest score).

Results directly under each String, such as Score, correspond to the string that was read. If that string has multiple string models, and you want to know which one was used to read, you can call StringModelUsed; for example:

SureDotOCR.StringsToRead("String").StringModelUsed
SureDotOCR.StringsToRead("String2").StringModelUsed

You can also access results using the StringModels themselves, however this rarely required, as results for the string read are given at the top level. Such calls, therefore, are not usually made:

SureDotOCR.StringsToRead("String").StringModels("StringModel").Score

String formatting

You can retrieve the string result as a FormattedString or a String; for example:

SureDotOCR.StringsToRead("String").FormattedString
SureDotOCR.StringsToRead("String").String

By selecting FormattedString, you will retrieve the string that was read, according to its format in the image. This includes the characters in the string, and also spaces, if they are greater than the minimum spacing and less than the maximum spacing.

By selecting String, you will retrieve the string that was read, according to its model definition. This generally includes just the characters in the string. It can also include spaces, but only if they correspond to space constraints explicitly defined in the string model (not typically done).

Character results

The Occurrences(index) allows you to retrieve results for each character by specifying its index. For example, to retrieve the first character in the first string read, its score, and the font that represents it, you can use:

SureDotOCR.StringsToRead("String").CharacterOccurrences(1).Character
SureDotOCR.StringsToRead("String").CharacterOccurrences(1).Score
SureDotOCR.StringsToRead("String").CharacterOccurrences(1).Font

To access multiple results in a single call, you can use the FLATTEN function, which can be useful when dealing with collections. For more information on the FLATTEN function, arrays and sub-arrays, see the Array functions section in Chapter 27: Using arrays.