Tabnine Logo
SpanAnchoringModeBehavior.adjust
Code IndexAdd Tabnine to your IDE (free)

How to use
adjust
method
in
de.tudarmstadt.ukp.clarin.webanno.api.annotation.adapter.SpanAnchoringModeBehavior

Best Java code snippets using de.tudarmstadt.ukp.clarin.webanno.api.annotation.adapter.SpanAnchoringModeBehavior.adjust (Showing top 3 results out of 315)

origin: webanno/webanno

int[] adjustedRange = SpanAnchoringModeBehavior.adjust(aJCas,
    layer.getAnchoringMode(), new int[] { selection.getBegin(),
        selection.getEnd() });
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-api-annotation

@Override
public CreateSpanAnnotationRequest onCreate(TypeAdapter aAdapter,
    CreateSpanAnnotationRequest aRequest)
  throws AnnotationException
{
  if (aRequest.getBegin() == aRequest.getEnd()) {
    if (!aAdapter.getLayer().getAnchoringMode().isZeroSpanAllowed()) {
      throw new AnnotationException(
          "Cannot create zero-width annotation on layers that lock to token boundaries.");
    }
    return aRequest;
  }
  
  int[] originalRange = new int[] { aRequest.getBegin(), aRequest.getEnd() };
  int[] adjustedRange = adjust(aRequest.getJcas(), aAdapter.getLayer().getAnchoringMode(),
      originalRange);
  
  if (adjustedRange.equals(originalRange)) {
    return aRequest;
  }
  else {
    return aRequest.changeSpan(adjustedRange[0], adjustedRange[1]);
  }
}

origin: webanno/webanno

@Override
public CreateSpanAnnotationRequest onCreate(TypeAdapter aAdapter,
    CreateSpanAnnotationRequest aRequest)
  throws AnnotationException
{
  if (aRequest.getBegin() == aRequest.getEnd()) {
    if (!aAdapter.getLayer().getAnchoringMode().isZeroSpanAllowed()) {
      throw new AnnotationException(
          "Cannot create zero-width annotation on layers that lock to token boundaries.");
    }
    return aRequest;
  }
  
  int[] originalRange = new int[] { aRequest.getBegin(), aRequest.getEnd() };
  int[] adjustedRange = adjust(aRequest.getJcas(), aAdapter.getLayer().getAnchoringMode(),
      originalRange);
  
  if (adjustedRange.equals(originalRange)) {
    return aRequest;
  }
  else {
    return aRequest.changeSpan(adjustedRange[0], adjustedRange[1]);
  }
}

de.tudarmstadt.ukp.clarin.webanno.api.annotation.adapterSpanAnchoringModeBehavioradjust

Popular methods of SpanAnchoringModeBehavior

  • <init>

Popular in Java

  • Creating JSON documents from java classes using gson
  • addToBackStack (FragmentTransaction)
  • getApplicationContext (Context)
  • compareTo (BigDecimal)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • ImageIO (javax.imageio)
  • JPanel (javax.swing)
  • Table (org.hibernate.mapping)
    A relational table
  • Top plugins for WebStorm
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