public class AlignedString extends Object implements Iterable<de.tudarmstadt.ukp.dkpro.core.api.transform.alignment.AlignedString.DataSegment>
Modifier and Type | Field and Description |
---|---|
protected de.tudarmstadt.ukp.dkpro.core.api.transform.alignment.AlignedString.AnchorSegment |
_first |
protected de.tudarmstadt.ukp.dkpro.core.api.transform.alignment.AlignedString.AnchorSegment |
_last |
Constructor and Description |
---|
AlignedString(AlignedString underlying) |
AlignedString(String base) |
Modifier and Type | Method and Description |
---|---|
String |
dataSegmentsToString()
Create a string representation of the segments.
|
void |
delete(int start,
int end)
Deletes data.
|
void |
fireChange() |
String |
get()
Fetch data
|
String |
get(int start,
int end)
Fetch data
|
de.tudarmstadt.ukp.dkpro.core.api.transform.alignment.AlignedString.Anchor |
getAnchor(int pos)
Get an anchor at the specified position.
|
Collection<de.tudarmstadt.ukp.dkpro.core.api.transform.alignment.AlignedString.Anchor> |
getAnchors()
Get all the anchors.
|
de.tudarmstadt.ukp.dkpro.core.api.transform.alignment.AlignedString.AbstractDataSegment |
getFirst() |
de.tudarmstadt.ukp.dkpro.core.api.transform.alignment.AlignedString.AbstractDataSegment |
getLast() |
de.tudarmstadt.ukp.dkpro.core.api.transform.alignment.AlignedString.AbstractDataSegment |
getSegmentAt(int position)
Get data segment currently at the given position.
|
Collection<de.tudarmstadt.ukp.dkpro.core.api.transform.alignment.AlignedString.DataSegment> |
getSegments()
Get all the segments.
|
void |
insert(int pos,
String s)
Inserts s at given position.
|
ImmutableInterval |
inverseResolve(ImmutableInterval i)
For the given interval on the underlying data, get the corresponding interval on this level.
|
Iterator<de.tudarmstadt.ukp.dkpro.core.api.transform.alignment.AlignedString.DataSegment> |
iterator()
Get an iterator over the internal data segments.
|
int |
length()
Gets total length of data.
|
void |
replace(int start,
int end,
String d)
Replaces data.
|
Interval |
resolve(Interval i)
For the given interval on the current data, get the corresponding interval in the wrapped
data.
|
String |
toString() |
void |
updateCaches() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
protected final de.tudarmstadt.ukp.dkpro.core.api.transform.alignment.AlignedString.AnchorSegment _first
protected final de.tudarmstadt.ukp.dkpro.core.api.transform.alignment.AlignedString.AnchorSegment _last
public AlignedString(String base)
public AlignedString(AlignedString underlying)
public void fireChange()
public Interval resolve(Interval i)
i
- an interval.public ImmutableInterval inverseResolve(ImmutableInterval i)
i
- the interval on the underlying data.public de.tudarmstadt.ukp.dkpro.core.api.transform.alignment.AlignedString.AbstractDataSegment getSegmentAt(int position)
position
- a position.public de.tudarmstadt.ukp.dkpro.core.api.transform.alignment.AlignedString.AbstractDataSegment getFirst()
public de.tudarmstadt.ukp.dkpro.core.api.transform.alignment.AlignedString.AbstractDataSegment getLast()
public Iterator<de.tudarmstadt.ukp.dkpro.core.api.transform.alignment.AlignedString.DataSegment> iterator()
public int length()
public String get()
public void updateCaches()
public String get(int start, int end)
start
- the start offset.end
- the end offset.public void insert(int pos, String s)
pos
- position at which to insert.s
- string to insert.public void delete(int start, int end)
start
- the start offset.end
- the end offset+1.public void replace(int start, int end, String d)
start
- the start offset.end
- the end offset+1.d
- the data used to replace the current data.public de.tudarmstadt.ukp.dkpro.core.api.transform.alignment.AlignedString.Anchor getAnchor(int pos)
pos
- a position.public Collection<de.tudarmstadt.ukp.dkpro.core.api.transform.alignment.AlignedString.Anchor> getAnchors()
public Collection<de.tudarmstadt.ukp.dkpro.core.api.transform.alignment.AlignedString.DataSegment> getSegments()
public String dataSegmentsToString()
Copyright © 2007–2018 Ubiquitous Knowledge Processing (UKP) Lab, Technische Universität Darmstadt. All rights reserved.