public class OcrSnippet extends Object
| Constructor and Description |
|---|
OcrSnippet(String text,
List<OcrBox> snippetRegions)
Create a new snippet on the given region on the page along with its plaintext.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addHighlightRegion(List<OcrBox> region)
Add a new highlighted region in the snippet.
|
List<OcrBox[]> |
getHighlightRegions()
Get the highlighted regions of the snippet region.
|
float |
getScore()
Get the score of the passage, compared to all other passages in the document
|
List<OcrBox> |
getSnippetRegions()
Get the region of the page that the snippes is located in
|
String |
getText()
Get the plaintext version of the highlighted page text with highlighting tags
|
void |
setScore(float score)
Set the score of the passage, compared to all other passages in the document
|
org.apache.solr.common.util.NamedList |
toNamedList()
Convert the snippet to a
NamedList that is used by Solr to populate the response. |
public void addHighlightRegion(List<OcrBox> region)
region - Location of the highlighted region relative to the snippet region.public String getText()
public List<OcrBox> getSnippetRegions()
public List<OcrBox[]> getHighlightRegions()
public float getScore()
public void setScore(float score)
public org.apache.solr.common.util.NamedList toNamedList()
NamedList that is used by Solr to populate the response.Copyright © 2019. All rights reserved.