Class SimpleBoundaryScanner
- java.lang.Object
-
- org.apache.lucene.search.vectorhighlight.SimpleBoundaryScanner
-
- All Implemented Interfaces:
BoundaryScanner
public class SimpleBoundaryScanner extends java.lang.Object implements BoundaryScanner
Simple boundary scanner implementation that divides fragments based on a set of separator characters.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.Character[]
DEFAULT_BOUNDARY_CHARS
static int
DEFAULT_MAX_SCAN
-
Constructor Summary
Constructors Constructor Description SimpleBoundaryScanner()
SimpleBoundaryScanner(int maxScan)
SimpleBoundaryScanner(int maxScan, java.lang.Character[] boundaryChars)
SimpleBoundaryScanner(int maxScan, java.util.Set<java.lang.Character> boundaryChars)
SimpleBoundaryScanner(java.lang.Character[] boundaryChars)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
findEndOffset(java.lang.StringBuilder buffer, int start)
Scan forward to find start offset.int
findStartOffset(java.lang.StringBuilder buffer, int start)
Scan backward to find end offset.
-
-
-
Field Detail
-
DEFAULT_MAX_SCAN
public static final int DEFAULT_MAX_SCAN
- See Also:
- Constant Field Values
-
DEFAULT_BOUNDARY_CHARS
public static final java.lang.Character[] DEFAULT_BOUNDARY_CHARS
-
-
Constructor Detail
-
SimpleBoundaryScanner
public SimpleBoundaryScanner()
-
SimpleBoundaryScanner
public SimpleBoundaryScanner(int maxScan)
-
SimpleBoundaryScanner
public SimpleBoundaryScanner(java.lang.Character[] boundaryChars)
-
SimpleBoundaryScanner
public SimpleBoundaryScanner(int maxScan, java.lang.Character[] boundaryChars)
-
SimpleBoundaryScanner
public SimpleBoundaryScanner(int maxScan, java.util.Set<java.lang.Character> boundaryChars)
-
-
Method Detail
-
findStartOffset
public int findStartOffset(java.lang.StringBuilder buffer, int start)
Description copied from interface:BoundaryScanner
Scan backward to find end offset.- Specified by:
findStartOffset
in interfaceBoundaryScanner
- Parameters:
buffer
- scanned objectstart
- start offset to begin- Returns:
- the found start offset
-
findEndOffset
public int findEndOffset(java.lang.StringBuilder buffer, int start)
Description copied from interface:BoundaryScanner
Scan forward to find start offset.- Specified by:
findEndOffset
in interfaceBoundaryScanner
- Parameters:
buffer
- scanned objectstart
- start offset to begin- Returns:
- the found end offset
-
-