DocumentSource Class
- java.
lang. Object - com.
azure. ai. contentunderstanding. models. ContentSource - com.
azure. ai. contentunderstanding. models. DocumentSource
- com.
- com.
public final class DocumentSource
extends ContentSource
Represents a parsed document grounding source in the format D(page,x1,y1,x2,y2,x3,y3,x4,y4).
The page number is 1-based. The polygon is a quadrilateral defined by four points with coordinates in the document's coordinate space.
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| RectangleF |
getBoundingBox()
Gets the axis-aligned bounding rectangle computed from the polygon coordinates. |
| int |
getPageNumber()
Gets the 1-based page number. |
| List<PointF> |
getPolygon()
Gets the polygon coordinates as four points defining a quadrilateral region. |
|
static
List<Document |
parse(String source)
Parses a source string containing one or more document source segments separated by |
Methods inherited from ContentSource
Methods inherited from java.lang.Object
Method Details
getBoundingBox
public RectangleF getBoundingBox()
Gets the axis-aligned bounding rectangle computed from the polygon coordinates. Useful for drawing highlight rectangles over extracted fields.
Returns:
getPageNumber
public int getPageNumber()
Gets the 1-based page number.
Returns:
getPolygon
public List<PointF> getPolygon()
Gets the polygon coordinates as four points defining a quadrilateral region.
Returns:
parse
public static List<DocumentSource> parse(String source)
Parses a source string containing one or more document source segments separated by ;.
Parameters:
; delimiters).
Returns: