__init__ constructor

init

Initializes a new instance of the HighlightOptions class which is used to extract a fixed-length highlight.

def __init__(self):
    ...

init

Initializes a new HighlightOptions instance used to extract a fixed-length highlight.

def __init__(self, max_length):
    ...
Parameter Type Description
max_length int The maximum text length.

init

Initializes a new instance of the HighlightOptions class which is used to extract a line‑limited highlight.

def __init__(self, max_length, is_line_limited):
    ...
Parameter Type Description
max_length Optional[int] The maximum text length.
is_line_limited bool Indicates whether the highlight extraction is limited by the start (or the end) of a text line.

Example

from groupdocs.parser.options import HighlightOptions

# Create options to extract a highlight with a maximum length of 200 characters,
# limiting the highlight to the start/end of a line.
options = HighlightOptions(max_length=200, is_line_limited=True)

init

Initializes a new HighlightOptions instance used to extract a highlight with a fixed word count.

def __init__(self, max_length, word_count):
    ...
Parameter Type Description
max_length Optional[int] The maximum text length.
word_count int The maximum word count.

init

Initializes a new HighlightOptions instance.

def __init__(self, max_length, word_count, is_line_limited):
    ...
Parameter Type Description
max_length Optional[int] The maximum text length.
word_count Optional[int] The maximum word count.
is_line_limited bool The value that indicates whether the highlight extraction is limited by the start (or the end) of a text line.

See Also