HighlightOptions class
Leave feedback
On this page
Provides the options which are used to extract a highlight (a block of text around found text in search scenarios).
An instance of HighlightOptions is used as a parameter in Parser.get_highlight(int, bool, HighlightOptions) method. See the usage examples there.
Learn more:
- Extract highlights (https://docs.groupdocs.com/display/parsernet/Extract+highlights)
The HighlightOptions type exposes the following members:
| Constructor | Description |
|---|---|
| init | Initializes a new instance of the HighlightOptions class which is used to extract a fixed-length highlight. |
| init | Initializes a new HighlightOptions instance used to extract a fixed-length highlight. |
| init | Initializes a new instance of the HighlightOptions class which is used to extract a line‑limited highlight. |
| init | Initializes a new HighlightOptions instance used to extract a highlight with a fixed word count. |
| init | Initializes a new HighlightOptions instance. |
| Property | Description |
|---|---|
| is_line_limited | The value indicating whether highlight extraction is limited by the start (or the end) of a text line. |
| max_length | The maximum text length. |
| word_count | The maximum word count. |
from groupdocs.parser import Parser
from groupdocs.parser.options import HighlightOptions
parser = Parser("sample.docx")
options = HighlightOptions(20)
highlight = parser.get_highlight(1, True, options)
print(highlight.text)
- module
groupdocs.parser.options
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.