Tabnine Logo
ChainAdapter.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
de.tudarmstadt.ukp.clarin.webanno.api.annotation.adapter.ChainAdapter
constructor

Best Java code snippets using de.tudarmstadt.ukp.clarin.webanno.api.annotation.adapter.ChainAdapter.<init> (Showing top 5 results out of 315)

origin: webanno/webanno

@Override
public ChainAdapter createAdapter(AnnotationLayer aLayer)
{
  ChainAdapter adapter = new ChainAdapter(featureSupportRegistry, eventPublisher, aLayer,
      schemaService.listAnnotationFeature(aLayer),
      layerBehaviorsRegistry.getLayerBehaviors(this, SpanLayerBehavior.class));
  return adapter;
}

origin: de.tudarmstadt.ukp.clarin.webanno/webanno-api-annotation

@Override
public ChainAdapter createAdapter(AnnotationLayer aLayer)
{
  ChainAdapter adapter = new ChainAdapter(featureSupportRegistry, eventPublisher, aLayer,
      schemaService.listAnnotationFeature(aLayer),
      layerBehaviorsRegistry.getLayerBehaviors(this, SpanLayerBehavior.class));
  return adapter;
}

origin: webanno/webanno

@Test
public void thatSpanCrossSentenceBehaviorOnCreateThrowsException()
{
  corefLayer.setCrossSentence(false);
  
  TokenBuilder<Token, Sentence> builder = new TokenBuilder<>(Token.class, Sentence.class);
  builder.buildTokens(jcas, "This is a test .\nThis is sentence two .");
  ChainAdapter sut = new ChainAdapter(featureSupportRegistry, null, corefLayer, asList(),
      behaviors);
  assertThatExceptionOfType(MultipleSentenceCoveredException.class)
      .isThrownBy(() -> sut.addSpan(document, username, jcas, 0, 
          jcas.getDocumentText().length()))
      .withMessageContaining("covers multiple sentences");
}
origin: webanno/webanno

@Test
public void thatSpanStackingBehaviorOnCreateThrowsException() throws AnnotationException
{
  TokenBuilder<Token, Sentence> builder = new TokenBuilder<>(Token.class, Sentence.class);
  builder.buildTokens(jcas, "This is a test .");
  ChainAdapter sut = new ChainAdapter(featureSupportRegistry, null, corefLayer, asList(),
      behaviors);
  // First time should work
  sut.addSpan(document, username, jcas, 0, 1);
  
  // Second time not
  assertThatExceptionOfType(AnnotationException.class)
      .isThrownBy(() -> sut.addSpan(document, username, jcas, 0, 1))
      .withMessageContaining("stacking is not enabled");
}

origin: webanno/webanno

  @Test
  public void thatSpanAnchoringAndStackingBehaviorsWorkInConcert() throws AnnotationException
  {
    TokenBuilder<Token, Sentence> builder = new TokenBuilder<>(Token.class, Sentence.class);
    builder.buildTokens(jcas, "This is a test .");

    ChainAdapter sut = new ChainAdapter(featureSupportRegistry, null, corefLayer, asList(),
        behaviors);

    // First time should work - we annotate the whole word "This"
    sut.addSpan(document, username, jcas, 0, 4);
    
    // Second time not - here we annotate "T" but it should be expanded to "This"
    assertThatExceptionOfType(AnnotationException.class)
        .isThrownBy(() -> sut.addSpan(document, username, jcas, 0, 1))
        .withMessageContaining("stacking is not enabled");
  }
}
de.tudarmstadt.ukp.clarin.webanno.api.annotation.adapterChainAdapter<init>

Popular methods of ChainAdapter

  • addSpan
  • addArc
  • collectLinks
  • createChainElementAnnotation
  • deleteArc
  • deleteSpan
  • getAnnotationTypeName
  • getChainFirstFeatureName
  • getChainForLink
    Find the chain head for the given link.
  • getChainTypeName
  • getFirstLink
    Get the first link of a chain from the chain head feature structure.
  • getLayer
  • getFirstLink,
  • getLayer,
  • getLinkNextFeatureName,
  • getNextLink,
  • getPrevLink,
  • handle,
  • isLinkedListBehavior,
  • newChain,
  • newLink

Popular in Java

  • Creating JSON documents from java classes using gson
  • findViewById (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • onRequestPermissionsResult (Fragment)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Permission (java.security)
    Legacy security code; do not use.
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • JComboBox (javax.swing)
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • 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