new PiiEntity()
The PiiEntity
object is created when requesting the PII for a document. It represents personally identifiable information (PII) in the document retrieved using PCCViewer.ViewerControl#detectPii.
This constructor should not be used directly. Instead, only access PII entities created by PCCViewer.ViewerControl#detectPii, through the PCCViewer.PiiDetectionRequest object.
- See:
-
- Use PCCViewer.PiiDetectionRequest#getPiiEntities to get piiEntities from a `PiiDetectionRequest` object.
- Use PCCViewer.PiiDetectionRequest#piiEntities to get piiEntities from a `PiiDetectionRequest` object.
Members
(readonly) boundingRectangle :Object
Gets the bounding rectangle of the PII entity.
This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8.
Type:
- Object
(readonly) highlightColor :string
Gets the highlight color of the PII entity, in hex notation (e.g. "#F1F1F1").
The highlight color can be specified when calling PCCViewer.ViewerControl#detectPii. If a highlight color is not specified, then the default "#1C86EE" is used.
This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8.
Type:
- string
(readonly) id :number
Gets the ID of the PII entity.
This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8.
Type:
- number
(readonly) pageNumber :number
Gets the page number of the document, on which the PII entity starts.
This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8.
Type:
- number
(readonly) score :string
Gets a number ranging from 0 to 1 that represents the level of confidence in the accuracy of the detection.
This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8.
Type:
- string
(readonly) text :string
Gets the text of the PII entity.
This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8.
Type:
- string
(readonly) type :string
Gets the type of the PII entity.
This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8.
Type:
- string
Methods
getBoundingRectangle() → {Object}
Gets the bounding rectangle of the PII entity.
Example
var boundingRectangle = piiEntity.getBoundingRectangle();
Returns:
A rectangle object of the type {x: xValue, y: yValue, width: widthValue, height: heightValue}
.
- Type
- Object
getHighlightColor() → {string}
Gets the highlight color of the PII entity, in hex notation (e.g. "#F1F1F1").
The highlight color can be specified when calling PCCViewer.ViewerControl#detectPii. If a highlight color is not specified, then the default "#1C86EE" is used.
Example
var piiEntities = piiDetectionRequest.getPiiEntities()
var piiEntity = piiEntities[0];
var highlightColor = piiEntity.getHighlightColor();
Returns:
The color of the PII entity highlight, in hexadecimal notation.
- Type
- string
getId() → {number}
Gets the ID of the PII entity.
Example
var piiEntities = piiDetectionRequest.getPiiEntities();
var piiEntity = piiEntities[0];
var id = piiEntity.getId();
Returns:
The ID of the PII entity.
- Type
- number
getPageNumber() → {number}
Gets the page number of the document, on which the PII entity starts.
If the PII entity text is contained on a single page, this returns the page number of that page. If the PII entity text spans multiple pages, this returns the page number of the first page.
Example
var piiEntities = piiDetectionRequest.getPiiEntities()
var piiEntity = piiEntities[0];
var pageNumber = piiEntity.getPageNumber();
alert("PII entity found on page: " + pageNumber);
Returns:
The page number on which the PII entity starts.
- Type
- number
getScore() → {number}
Gets a number ranging from 0 to 1 that represents the level of confidence in the accuracy of the detection.
Example
var piiEntities = piiDetectionRequest.getPiiEntities()
var piiEntity = piiEntities[0];
var score = piiEntity.getScore();
alert("The PII entity has a score of " + score);
Returns:
A number ranging from 0 to 1 that represents the level of confidence in the accuracy of the detection.
- Type
- number
getStartIndexInPage() → {number}
Gets the start index of the PII entity text, within the entire text of the page that the piiEntity is on.
Example
var piiEntities = piiDetectionRequest.getPiiEntities()
var piiEntity = piiEntities[0];
var startIndex = piiEntity.getStartIndexInPage();
alert("The PII entity starts at character " + startIndex + " on the page.");
- See:
-
- Use PCCViewer.ViewerControl#requestPageText to get the full text of a page.
- Use PCCViewer.PiiEntity#getText to get the text of the PII entity.
Returns:
The start index of the PII entity text in the page.
- Type
- number
getText() → {string}
Gets the text of the PII entity.
Example
var piiEntities = piiDetectionRequest.getPiiEntities()
var piiEntity = piiEntities[0];
var text = piiEntity.getText();
alert("Detected the PII text: " + text);
Returns:
The PII entity text.
- Type
- string
getType() → {string}
Gets the type of the PII entity.
Example
var piiEntities = piiDetectionRequest.getPiiEntities()
var piiEntity = piiEntities[0];
var type = piiEntity.getType();
alert("The PII entity has type: " + type);
Returns:
The type of the PII entity.
- Type
- string