Grooper.Core.DataInstance

A Data Instance represents a segment of text content within a document. Data Instances can represent anything from a single character to the entire content of a document. Data Instance objects are the input to and the output from all ESP™ extraction operations, and also represent the format in which document metadata is stored by the Extract activity.

Data Instances are created during the extraction process, when the raw OCR data for a Batch Folder object is loaded, forming a Document Instance which represents the entire content of the document. When Extraction is performed, this root instance becomes the source from which all data elements at the root of the Data Model will perform their extraction, and the extracted results will be saved as children of the Document Instance.


Inherits from: Grooper.EmbeddedObject

Constructors

Signature Description
New (Owner As ConnectedObject) Initializes a new instance of the DataInstance class.
Parameters
Owner
          Type: ConnectedObject
          The owner of the DataInstance.
New (Owner As ConnectedObject, Value As String) Initializes a new instance.
Parameters
Owner
          Type: ConnectedObject
          The owner of the DataInstance.
 
Value
          Type: String
          The DataInstance value.
New (Owner As ConnectedObject, Value As String, Location As RectangleExF, OcrResults As OcrResults) Initializes a new instance.
Parameters
Owner
          Type: ConnectedObject
          The owner of the DataInstance.
 
Value
          Type: String
          The DataInstance value.
 
Location
          Type: RectangleExF
          The location of the DataInstance.
 
OcrResults
          Type: OcrResults
          OCR Results associated with the DataInstance.
New (Owner As ConnectedObject, OcrResults As OcrResults) Initializes a new instance of the DataInstance class.
Parameters
Owner
          Type: ConnectedObject
          The owner of the DataInstance.
 
OcrResults
          Type: OcrResults
          OCR Results associated with the DataInstance.
New (Instance As DataInstance, CopyChildren As Boolean) Initializes a new instance of the DataInstance class from a source DataInstance.
Parameters
Instance
          Type: DataInstance
          The source DataInstance.
 
CopyChildren
          Type: Boolean
          If true then all children of the source DataInstance will be copied to the new DataInstance.
New (Owner As ConnectedObject, sdi As SimpleDataInstance, CopyChildren As Boolean)
Parameters
Owner
          Type: ConnectedObject
          
 
sdi
          Type: SimpleDataInstance
          
 
CopyChildren
          Type: Boolean
          

Fields

Field Name Field Type Description
Angle As System.Double System.Double
Database As Grooper.GrooperDb Grooper.GrooperDb
ExtractorId As System.Guid System.Guid
InstanceExpand As System.Double System.Double
InstanceNo As System.Int32 System.Int32
NoExpand As System.Boolean System.Boolean
Tag As System.Object System.Object

Properties

Property Name Property Type Description
AllChildren System.Collections.Generic.IEnumerable(Of T) Enumerates all children of this instance.
AllChildrenOfType(TypeToFind As Type) System.Collections.Generic.IEnumerable(Of T) Enumerates all descendants of this instance which are of the indicated type.
Parameters
TypeToFind
          Type: Type
          The type of descendants to find.
BatchFolder Grooper.Core.BatchFolder The Batch Folder object with which this instance is associated.
BatchObject Grooper.Core.BatchObject The Batch Folder object with which this instance is associated.
CenterPoint Grooper.PointExF Returns the center point of the region associated with this instance.
ChildrenAtLevel(Level As Int32) System.Collections.Generic.IEnumerable(Of T) Returns all children the specified number of levels below this item.
Parameters
Level
          Type: Int32
          The number of levels. A value of 1 will return the immediate children of this item.
ChildrenOfType(TypeToFind As Type) System.Collections.Generic.IEnumerable(Of T) Enumerates all direct children of this instance which are of the indicated type.
Parameters
TypeToFind
          Type: Type
          The type of children to find.
Confidence System.Double The confidence level assigned to this instance.
ContentType Grooper.Core.ContentType The Content Type of the Batch Folder associated with this Data Instance.
Count System.Int32 Returns the number of child instances.
DocumentInstance Grooper.Core.DocumentInstance Returns the root DocumentInstance.
EndIndex System.Int32 Returns the ending index (Index + Length - 1)
FirstPage System.Int32 Returns the 0-based index of the first page on which this instance appears.
HasOcrParity System.Boolean Indicates whether the instance has parity between the length of the string value and the number of OcrItems.
HasReferenceProperties System.Boolean Returns true if the object has properties which reference Grooper Node objects.
HasZoneInfo System.Boolean Indicates whether this instance has a region associated with it.
HighlightColor System.Drawing.Color Returns the color to be used for highlighting this instance.
Index System.Int32 The starting index of this instance within the parent instance.
IsEmpty System.Boolean Returns true if all properties with a ViewableAttribute are set to their default value.
IsWriteable System.Boolean Returns true if the object is writable, or false if it is not.
Item(index As Int32) Grooper.Core.DataInstance Returns the child instance at a specific index.
Parameters
index
          Type: Int32
          The 0-based index of the child instance.
LastPage System.Int32 Returns the 0-based index of the last page on which this instance appears.
Length System.Int32 The length of this instance, in characters, within the parent instance. Please note that length represents the length of the element within the parent instance. It does not necessarily indicate the number of characters in the Value property or the number of items in the OcrResults object.
Location Grooper.RectangleExF The location of this instance on the page.
Name System.String The name of this data instance.
Owner Grooper.ConnectedObject Returns the node that owns the connected object, if any.
OwnerNode Grooper.GrooperNode Returns the node that owns the connected object, if any.
PageCount System.Int32 Returns the number of pages referenced in the OCR data.
PageIndex System.Int32 The 0-based page index on which the starting character of this data element appears.
PageNo System.Int32 The 1-based page number on which this item appears.
Parent Grooper.Core.DataInstance Returns the parent instance of this instance.
Resolution System.Int32 The resolution, in DPI, of the source document associated with this instance.
Root Grooper.GrooperRoot Returns the root node
TypeDisplayName System.String The type display name of the Data Instance.
TypeName System.String The type name of the Data Instance.
Value System.String The value of this data instance.

Methods

Method Name Description
Add(item As DataInstance) Appends a new child instance to the children of this instance.
Parameters
item
          Type: DataInstance
          The item to add.
AddRange(Items As IEnumerable(Of DataInstance)) Adds a list of items to the collection.
Parameters
Items
          Type: IEnumerable`1
          The items to add.
Append(Instance As DataInstance) Appends the content of the provided instance to this instance.
Parameters
Instance
          Type: DataInstance
          The instance to append.
Append(PageNo As Int32, Instance As DataInstance) Appends the content of the provided instance to this instance, setting the Page No property of all OCR Items to the indicated page number.
Parameters
PageNo
          Type: Int32
          The page number being appended.
 
Instance
          Type: DataInstance
          The DataInstance to append.
Append(PageIndex As Int32, ch As Char) Appends a single character to the instance content.
Parameters
PageIndex
          Type: Int32
          
 
ch
          Type: Char
          
Append(PageIndex As Int32, LiteralValue As String) Appends a string value to the instance content.
Parameters
PageIndex
          Type: Int32
          
 
LiteralValue
          Type: String
          
Clear() Deletes all children of this instance.
ClearCache()
Contains(item As DataInstance) As Boolean Determines if the specified instance is a child of this instance.
Parameters
item
          Type: DataInstance
          
Deserialize(Json As String, Type As Type, Owner As ConnectedObject) As ConnectedObject Deserializes an EmbeddedObject.
Parameters
Json
          Type: String
          The JSON text to deserialize.
 
Type
          Type: Type
          The type. Must inherit from ConnectedObject.
 
Owner
          Type: ConnectedObject
          The parent object.
FindChild(Id As Guid) As DataInstance Finds a child of this instance by Id.
Parameters
Id
          Type: Guid
          The Id to search for.
FindChild(Name As String, Normalize As Boolean) As DataInstance Finds a child of this instance by name.
Parameters
Name
          Type: String
          The name to search for.
 
Normalize
          Type: Boolean
          If true, names will be normalized during the search to ignore case and to ignore the distinction between " " and "_".
GetAnnotations(PageIndex As Int32) As IEnumerable(Of Annotation)
Parameters
PageIndex
          Type: Int32
          
GetPathInstances(BaseInstance As DataInstance) As DataInstanceCollection Returns a list of DataInstances which represents the path from the root to the indicated BaseInstance.
Parameters
BaseInstance
          Type: DataInstance
          
GetProperties() As PropertyDescriptorCollection
GetReferences() As List(Of GrooperNode) Returns a list of GrooperNode objects referenced in the properties of this object.
GetSubInstance(Index As Int32, Length As Int32) As DataInstance Gets a sub portion of this instance.
Parameters
Index
          Type: Int32
          The starting character index.
 
Length
          Type: Int32
          The character length to extract.
GetSubInstance(PageIndex As Int32, Bounds As RectangleExF) As DataInstance Gets a sub portion of this instance.
Parameters
PageIndex
          Type: Int32
          
 
Bounds
          Type: RectangleExF
          The rectangle of the area to extract, in inches.
GetSubInstance(Location As Span) As DataInstance Gets a sub portion of this instance.
Parameters
Location
          Type: Span
          The TextLocation for the sub instance.
GetSubInstance(PageIndex As Int32) As DataInstance Returns a new instance containing all characters on the indicated page.
Parameters
PageIndex
          Type: Int32
          The index of the page to extract.
GetTextBounds(PageIndex As Int32) As RectangleExF Returns a rectangle representing the bounds of the page on which this instance appears. Units are in inches.
Parameters
PageIndex
          Type: Int32
          The 0-based index of the page.
HasChild(Name As String) As Boolean Determines whether this element has a child element with the provided name.
Parameters
Name
          Type: String
          
HasGeometricOverlap(OtherInstance As DataInstance) As Boolean
Parameters
OtherInstance
          Type: DataInstance
          
HasIndexOverlap(OtherInstance As DataInstance) As Boolean
Parameters
OtherInstance
          Type: DataInstance
          
IndexOf(item As DataInstance) As Int32 Returns the 0-based index of the indicated instance within the collection of child instances.
Parameters
item
          Type: DataInstance
          The instance to return the index of.
Insert(index As Int32, item As DataInstance) Inserts a child instance at the indicated position within the collection of children.
Parameters
index
          Type: Int32
          The 0-based index at which to insert the item.
 
item
          Type: DataInstance
          The item to insert.
IsPropertyEnabled(PropertyName As String) As Nullable(Of Boolean) Defines whether a property is currently enabled.
Parameters
PropertyName
          Type: String
          The name of the property to determine the enabled state for.
IsPropertyVisible(PropertyName As String) As Nullable(Of Boolean) Defines whether a property is currently visible.
Parameters
PropertyName
          Type: String
          The name of the property to determine the visible state for.
IsType(Type As Type) As Boolean Returns true if the object is of the type specified, or if it derives from the type specfied.
Parameters
Type
          Type: Type
          The type to check.
OverlapsWith(OtherInstance As DataInstance) As Boolean Determines if the instance overlaps with another instance.
Parameters
OtherInstance
          Type: DataInstance
          
Remove(item As DataInstance) As Boolean Removes the indicated child item from the collection of children.
Parameters
item
          Type: DataInstance
          The item to remove.
RemoveAt(index As Int32) Removes the child instance at the specified index.
Parameters
index
          Type: Int32
          A 0-based index specifying the child's position.
Serialize() As String Serializes the object.
SetDatabase(Database As GrooperDb) Sets the database connection of the object.
Parameters
Database
          Type: GrooperDb
          
SetOwner(Owner As ConnectedObject, SkipInitialization As Boolean) Sets the owner of the connected object with another object that implements the IConnected interface.
Parameters
Owner
          Type: ConnectedObject
          
 
SkipInitialization
          Type: Boolean
          
SetValue(Value As String, Location As RectangleExF, OcrResults As OcrResults) Replaces the value, location, and OCR results of this instance.
Parameters
Value
          Type: String
          The value of the instance.
 
Location
          Type: RectangleExF
          The location of this instance.
 
OcrResults
          Type: OcrResults
          The OCR Results associated with the instance.
SortChildren(Comparer As IComparer(Of DataInstance)) Sorts child instances using the specified implementation of IComparer.
Parameters
Comparer
          Type: IComparer`1
          
TopDescendantsWithName(Name As String) As IEnumerable(Of DataInstance) Enumerates top descendants with the provided name.
Parameters
Name
          Type: String
          
ToString() As String Returns a string representation of the object.
Translate(X As Double, Y As Double) Translates the location of this instance by X and Y amounts.
Parameters
X
          Type: Double
          The offset on the X axis, in inches.
 
Y
          Type: Double
          The offset on the Y axis, in inches.
ValidateProperties() As ValidationErrorList Validates the properties of the object, returning a list of validation errors.