Tabnine Logo
AlignedString.replace
Code IndexAdd Tabnine to your IDE (free)

How to use
replace
method
in
de.tudarmstadt.ukp.dkpro.core.api.transform.alignment.AlignedString

Best Java code snippets using de.tudarmstadt.ukp.dkpro.core.api.transform.alignment.AlignedString.replace (Showing top 4 results out of 315)

origin: dkpro/dkpro-core

/**
 * Deletes data.
 * 
 * @param start
 *            the start offset.
 * @param end
 *            the end offset+1.
 */
public void delete(final int start, final int end)
{
  replace(start, end, null);
}
origin: de.tudarmstadt.ukp.dkpro.core/de.tudarmstadt.ukp.dkpro.core.textnormalizer-asl

  public static void applyChanges(AlignedString as, List<SofaChangeAnnotation> changes) {
    
    // If we remove or add stuff all offsets right of the change location
    // will change and thus the offsets in the change annotation are no
    // longer valid. If we move from right to left it works better because
    // the left offsets remain stable.
    Collections.reverse(changes);
    for (SofaChangeAnnotation c : changes) {
      if (OP_INSERT.equals(c.getOperation())) {
        // getContext().getLogger().log(INFO,
        // "Performing insert: "+a.getBegin()+"-"+a.getEnd());
        as.insert(c.getBegin(), c.getValue());
      }
      if (OP_DELETE.equals(c.getOperation())) {
        // getContext().getLogger().log(INFO,
        // "Performing delete: "+a.getBegin()+"-"+a.getEnd());
        as.delete(c.getBegin(), c.getEnd());
      }
      if (OP_REPLACE.equals(c.getOperation())) {
        // getContext().getLogger().log(INFO,
        // "Performing replace: "+a.getBegin()+"-"+a.getEnd());
        as.replace(c.getBegin(), c.getEnd(), c.getValue());
      }
    }
  }
}
origin: de.tudarmstadt.ukp.dkpro.core/de.tudarmstadt.ukp.dkpro.core.castransformation-asl

alignmentState.replace(a.getBegin(), a.getEnd(), a.getValue());
origin: dkpro/dkpro-core

  break;
case REPLACE:
  alignedString.replace(change.getStart(), change.getEnd(), change.getText());
  break;
default:
de.tudarmstadt.ukp.dkpro.core.api.transform.alignmentAlignedStringreplace

Javadoc

Replaces data.

Popular methods of AlignedString

  • <init>
  • delete
  • insert
  • get
  • resolve
  • addChangeListener
  • createBase
  • dataSegmentsToString
    Create a string representation of the segments. This is for debugging purposes.
  • dropSuperflourous
    If the given segment is a zero-length base segment, then it can be dropped. Zero-length oblique segm
  • fireChange
  • getAnchor
    Get an anchor at the specified position. Breaks up the segment at the given point if necessary. If t
  • getFirst
  • getAnchor,
  • getFirst,
  • getSegmentAt,
  • inverseResolve,
  • length,
  • updateCaches

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getApplicationContext (Context)
  • startActivity (Activity)
  • requestLocationUpdates (LocationManager)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Collectors (java.util.stream)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now