public class Segment extends Part
Part.GetTarget| Modifier and Type | Field and Description |
|---|---|
static TargetState |
STATE_DEFAULT
Default value for the target state of a segment.
|
| Constructor and Description |
|---|
Segment(Segment original)
Copy constructor.
|
Segment(Store store)
Creates a new
Segment object. |
| Modifier and Type | Method and Description |
|---|---|
Segment |
createAndCopyMetadata()
Creates a new empty segment based on this one.
|
boolean |
getCanResegment()
Indicates if this segment can be re-segmented.
|
TargetState |
getState()
Gets the state for this segment.
|
java.lang.String |
getSubState()
Gets the sub-state for this segment.
|
boolean |
isSegment()
Indicates if this part is a segment or an ignorable.
|
void |
setCanResegment(boolean canResegment)
Sets the flag indicating if this segment can be re-segmented.
|
void |
setState(java.lang.String state)
Sets the state for this segment.
|
void |
setState(TargetState state)
Sets the state for this segment.
|
void |
setSubState(java.lang.String subState)
Sets the sub-state for this segment.
|
getId, getId, getPreserveWS, getSource, getSourceTags, getStore, getTarget, getTarget, getTargetOrder, getTargetTags, hasTarget, removeMarkers, setId, setPreserveWS, setSource, setSource, setTarget, setTarget, setTargetOrder, showProtectedContentpublic static final TargetState STATE_DEFAULT
public Segment(Segment original)
original - the original object to duplicate.public boolean getCanResegment()
public void setCanResegment(boolean canResegment)
canResegment - true to indicate that this segment can be re-segmented.public TargetState getState()
public void setState(java.lang.String state)
state - the new state for this segment.
The value must be "initial", "translated", "reviewed" or "final".
It can also be null and in that case the value is set to STATE_DEFAULT.public void setState(TargetState state)
state - the new state to set.public java.lang.String getSubState()
public void setSubState(java.lang.String subState)
subState - the new sub-state for this segment.
The string must be in the format "prefix:value" or it can be null.public boolean isSegment()
Partpublic Segment createAndCopyMetadata()
The new segment uses the same store and has the same core metadata (translate, can-re-segment, state, sub-state) as this segment. The metadata of the source and target are also copied, but not their content. The new segment has an empty target if this one has a target and it has no target if this one has no target. The new segment has also has a new id value.