AddValue method
The AddValue method adds a character data value (ASCII code) and the associated confidence level to the character object. You can use this method to correct optical character recognition (OCR) errors.
In addition to the primary data value, each character in a field can have multiple alternative data values. Each of the alternative data values has an associated confidence level (0 - 9 internally and 1 - 10 in the page XML file). Each time that you add a value by using the AddValue method, the new value is appended to the list of existing values. Also, a new confidence level is appended to the list of existing confidence levels.
In the following example, the fourth character contains a primary confidence level value of 6, a first alternative confidence level of 8, and a second alternative confidence level of 10. The fourth character also contains a primary character value of 110, a first alternative character value of 52, and a second alternative character value of 56.
<F id="Vendor">
<V n="TYPE">Vendor</V>
<V n="Position">0,0,0,0</V>
<V n="STATUS">1</V>
<C n="6,8,10" cr="0,0,0,0">83,49,53</C>
<C n="6,8,10" cr="0,0,0,0">116,50,54</C>
<C n="6,8,10" cr="0,0,0,0">105,51,55/C>
<C n="6,8,10" cr="0,0,0,0">110,52,56</C>
</F>Syntax
- VBScript
oDCO.AddValue (Value as Long, Confidence as Long) as Boolean- C#
int AddValue(int nValue, int nConfidence)
Applies to
Character objects only.
Arguments
- nValue
- The ASCII code of the character.
- nConfidence
- A number between 0 (low) and 9 (high) representing the confidence level.
Returns
- VBScript
- Returns true if successful; returns false if unsuccessful.
- C#
- Returns
1if successful; returns0if unsuccessful.
C# example
This example adds the ASCII character 50 with a confidence level of 3 to the character object:
m_oDCOChar.AddValue(50,3);