Search in sources :

Example 1 with STimeline

use of org.corpus_tools.salt.common.STimeline in project ANNIS by korpling.

the class TimelineReconstructor method addTimeline.

private void addTimeline() {
    STimeline timeline = graph.createTimeline();
    for (SToken virtualTok : graph.getSortedTokenByText()) {
        timeline.increasePointOfTime();
        // find all spans that are connected to this token and are part of an SOrderRelation
        for (SRelation<?, ?> inRel : virtualTok.getInRelations()) {
            if (inRel instanceof SSpanningRelation) {
                SSpanningRelation spanRel = (SSpanningRelation) inRel;
                SSpan overlappingSpan = spanRel.getSource();
                if (overlappingSpan != null) {
                    spans2TimelinePos.put(overlappingSpan, timeline.getEnd());
                }
            }
        }
        nodesToDelete.add(virtualTok);
    }
}
Also used : SToken(org.corpus_tools.salt.common.SToken) SSpan(org.corpus_tools.salt.common.SSpan) STimeline(org.corpus_tools.salt.common.STimeline) SSpanningRelation(org.corpus_tools.salt.common.SSpanningRelation)

Aggregations

SSpan (org.corpus_tools.salt.common.SSpan)1 SSpanningRelation (org.corpus_tools.salt.common.SSpanningRelation)1 STimeline (org.corpus_tools.salt.common.STimeline)1 SToken (org.corpus_tools.salt.common.SToken)1