public class ChunkFactory extends Object
ChunkFactory provides static factory methods for
creating chunks from components. Each chunk must specify the index
of its first character and the index of one past its last
character. A chunk may optionally specify a string-based type and
score. If a type or score is not specified, the default values
DEFAULT_CHUNK_TYPE and DEFAULT_CHUNK_SCORE,
respecitively.| Modifier and Type | Field and Description |
|---|---|
static double |
DEFAULT_CHUNK_SCORE
The default chunk score,
Double.NEGATIVE_INFINITY. |
static String |
DEFAULT_CHUNK_TYPE
The default chunk type,
"CHUNK". |
| Modifier and Type | Method and Description |
|---|---|
static Chunk |
createChunk(int start,
int end)
Return a chunk with the specified start and end positions, with
default type and score.
|
static Chunk |
createChunk(int start,
int end,
double score)
Return a chunk with the specified start and end positions,
specified score and default type.
|
static Chunk |
createChunk(int start,
int end,
String type)
Return a chunk with the specified start and end positions, specified
type and default score.
|
static Chunk |
createChunk(int start,
int end,
String type,
double score)
Return a chunk with the specified start and end positions, type
and score.
|
public static final String DEFAULT_CHUNK_TYPE
"CHUNK".public static final double DEFAULT_CHUNK_SCORE
Double.NEGATIVE_INFINITY. This
value, unlike Double.NaN, is less than other double
values and equal (==) to itself.public static Chunk createChunk(int start, int end)
DEFAULT_CHUNK_TYPE and default score by DEFAULT_CHUNK_SCORE.start - Index of the first character in the chunk.end - Index of one past the last character in the chunk.IllegalArgumentException - If start is less than zero or
end is less than start.public static Chunk createChunk(int start, int end, String type)
DEFAULT_CHUNK_SCORE.start - Index of the first character in the chunk.end - Index of one past the last character in the chunk.type - Type of the chunk created.IllegalArgumentException - If start is less than zero or
end is less than start.public static Chunk createChunk(int start, int end, double score)
DEFAULT_CHUNK_TYPE.start - Index of the first character in the chunk.end - Index of one past the last character in the chunk.score - Score of created chunk.IllegalArgumentException - If start is less than zero or
end is less than start.public static Chunk createChunk(int start, int end, String type, double score)
start - Index of the first character in the chunk.end - Index of one past the last character in the chunk.type - Type of the chunk created.score - Score of created chunk.IllegalArgumentException - If start is less than zero or
end is less than start.Copyright © 2019 Alias-i, Inc.. All rights reserved.