Tabnine Logo
WebannoTsv3Writer
Code IndexAdd Tabnine to your IDE (free)

How to use
WebannoTsv3Writer
in
de.tudarmstadt.ukp.clarin.webanno.tsv

Best Java code snippets using de.tudarmstadt.ukp.clarin.webanno.tsv.WebannoTsv3Writer (Showing top 20 results out of 315)

origin: de.tudarmstadt.ukp.clarin.webanno/webanno-tsv

List<String> annoPerFeatures = new ArrayList<>();
featurePerLayer.putIfAbsent(aType.getName(), new LinkedHashSet<>());
int ref = getRefId(aType, aFs, aUnit);
if(ambigUnits.get(aType.getName()).get(getFirstUnit(aUnit))!=null && 
    ambigUnits.get(aType.getName()).get(getFirstUnit(aUnit)).equals(false)){
  ref = 0;
if(ambigUnits.get(aType.getName()).get(getFirstUnit(aUnit))== null && 
    ambigUnits.get(aType.getName()).get(aUnit).equals(false)){
  ref = 0;
        Type tType = targetFs.getType();
        AnnotationUnit firstUnit = getFirstUnit(targetFs);
        ref = getRefId(tType, targetFs, firstUnit);
        } else {
          role = replaceEscapeChars(role);
    } else {
      annotation = replaceEscapeChars(annotation);
    setAnnoFeature(aIsMultiToken, aIsFirst, annoPerFeatures, annotation);
  setAnnoFeature(aIsMultiToken, aIsFirst, annoPerFeatures, "*"+ (ref > 0 ? "[" + ref + "]" : ""));
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-io-tsv

throws AnalysisEngineProcessException
try (OutputStream docOS = getOutputStream(aJCas, filenameSuffix)) {
  resetVariables();
  setSlotLinkTypes();
  setLinkMaps(aJCas);
  setTokenSentenceAddress(aJCas);
  setAmbiguity(aJCas);
  setSpanAnnotation(aJCas);
  setChainAnnotation(aJCas);
  setRelationAnnotation(aJCas);
  writeHeader(docOS);
  for (AnnotationUnit unit : units) {
    if (sentenceUnits.containsKey(unit)) {
      String[] sentWithNl = sentenceUnits.get(unit).split("\n");
      IOUtils.write(LF + "#Text=" + escapeSpecial(sentWithNl[0]) + LF, 
          docOS, encoding);
          IOUtils.write("#Text=" + escapeSpecial(sentWithNl[i + 1]) + LF, docOS,
              encoding);
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-io-tsv

setChainAnnoPerFeature(aAnnotationsPertype, aType, aFs, aUnit, aLinkNo, achainNo, false,
    false);
sta.setEnd(aFs.getEnd());
sta.setText(aFs.getCoveredText());
boolean isMultiToken = isMultiToken(aFs);
boolean isFirst = true;
Set<AnnotationUnit> sus = new LinkedHashSet<>();
for (AnnotationUnit newUnit : getSubUnits(sta, sus)) {
  setChainAnnoPerFeature(aAnnotationsPertype, aType, aFs, newUnit, aLinkNo, achainNo,
      isMultiToken, isFirst);
  isFirst = false;
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-tsv

  continue;
int ref = getRefId(type, fs, depUnit);
String annotation = fs.getFeatureValueAsString(feature);
if (annotation == null) {
  annotation = replaceEscapeChars(annotation);
origin: webanno/webanno

ambigUnits.putIfAbsent(type.getName(), new HashMap<>());
for (AnnotationFS fs : CasUtil.select(aJCas.getCas(), type)) {
  AnnotationUnit unit = getFirstUnit(fs);
  if (isMultipleTokenAnnotation(fs.getBegin(), fs.getEnd())) {
    SubTokenAnno sta = new SubTokenAnno();
    sta.setBegin(fs.getBegin());
    sta.setText(fs.getCoveredText());
    Set<AnnotationUnit> sus = new LinkedHashSet<>();
    for (AnnotationUnit newUnit : getSubUnits(sta, sus)) {
      ambigUnits.get(type.getName()).put(newUnit, true);
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-tsv

setSpanAnnoPerFeature(annotationsPertype, type, fs, unit, false, false);
sta.setEnd(fs.getEnd());
sta.setText(fs.getCoveredText());
boolean isMultiToken = isMultiToken(fs);
boolean isFirst = true;
Set<AnnotationUnit> sus = new LinkedHashSet<>();
for (AnnotationUnit newUnit : getSubUnits(sta, sus)) {
  setSpanAnnoPerFeature(annotationsPertype, type, fs, newUnit, isMultiToken, isFirst);
  isFirst = false;
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-io-tsv

for (AnnotationUnit unit : units) {
  if (unit.begin >= newUnit.begin && unit.end >= newUnit.end) {
    updateUnitLists(tmpUnits, unit, newUnit);
    aSubUnits.add(newUnit);
    units = new ArrayList<>(tmpUnits);
    AnnotationUnit newUnit = new AnnotationUnit(aSTA.getBegin(), aSTA.getEnd(),
        false, aSTA.getText());
    updateUnitLists(tmpUnits, unit, newUnit);
      aSTA.getText());
  updateUnitLists(tmpUnits, unit, newUnit);
  aSubUnits.add(newUnit);
  updateUnitLists(tmpUnits, unit, newUnit);
  aSTA.setBegin(getNextUnitBegin(aSTA.getBegin()));
  getSubUnits(aSTA, aSubUnits);
  aSubUnits.add(newUnit);
  updateUnitLists(tmpUnits, prevUnit, newUnit);
  getSubUnits(aSTA, aSubUnits);
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-tsv

AnnotationUnit govUnit = getFirstUnit(
    getUnit(govFs.getBegin(), govFs.getEnd(), govFs.getCoveredText()));
if(ambigUnits.get(govType.getName()).get(govUnit)==null){
  govUnit =  getUnit(govFs.getBegin(), govFs.getEnd(), govFs.getCoveredText());
AnnotationUnit depUnit = getFirstUnit(
    getUnit(depFs.getBegin(), depFs.getEnd(), depFs.getCoveredText()));
if(ambigUnits.get(govType.getName()).get(depUnit)==null){
  depUnit =  getUnit(depFs.getBegin(), depFs.getEnd(), depFs.getCoveredText());
setRelationAnnoPerFeature(annotationsPertype, type, fs, depUnit, govUnit, govRef,
    depRef, govType);
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-tsv

for (FeatureStructure chainFs : selectFS(aJCas.getCas(), type)) {
  AnnotationFS linkFs = (AnnotationFS) chainFs.getFeatureValue(chainFirst);
  AnnotationUnit unit = getUnit(linkFs.getBegin(), linkFs.getEnd(), linkFs.getCoveredText());
  Type lType = linkFs.getType();
    AnnotationFS nextLinkFs = (AnnotationFS) linkFs.getFeatureValue(linkNext);
    if (nextLinkFs != null) {
      addChinFeatureAnno(annotationsPertype, lType, linkFs, unit, linkNo, chainNo);
    } else {
      addChinFeatureAnno(annotationsPertype, lType, linkFs, unit, linkNo, chainNo);
      unit = getUnit(linkFs.getBegin(), linkFs.getEnd(), linkFs.getCoveredText());
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-tsv

annotation = replaceEscapeChars(annotation);
origin: webanno/webanno

private AnnotationUnit getFirstUnit(AnnotationUnit aUnit)
{
  SubTokenAnno sta = new SubTokenAnno();
  sta.setBegin(aUnit.begin);
  sta.setEnd(aUnit.end);
  sta.setText(aUnit.token);
  Set<AnnotationUnit> sus = new LinkedHashSet<>();
  AnnotationUnit firstUnit = null;
  for (AnnotationUnit u : getSubUnits(sta, sus)) {
    firstUnit = u;
    break;
  }
  return firstUnit;
}
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-io-tsv

ambigUnits.putIfAbsent(type.getName(), new HashMap<>());
for (AnnotationFS fs : CasUtil.select(aJCas.getCas(), type)) {
  AnnotationUnit unit = getFirstUnit(fs);
  if (isMultipleTokenAnnotation(fs.getBegin(), fs.getEnd())) {
    SubTokenAnno sta = new SubTokenAnno();
    sta.setBegin(fs.getBegin());
    sta.setText(fs.getCoveredText());
    Set<AnnotationUnit> sus = new LinkedHashSet<>();
    for (AnnotationUnit newUnit : getSubUnits(sta, sus)) {
      ambigUnits.get(type.getName()).put(newUnit, true);
origin: webanno/webanno

setSpanAnnoPerFeature(annotationsPertype, type, fs, unit, false, false);
sta.setEnd(fs.getEnd());
sta.setText(fs.getCoveredText());
boolean isMultiToken = isMultiToken(fs);
boolean isFirst = true;
Set<AnnotationUnit> sus = new LinkedHashSet<>();
for (AnnotationUnit newUnit : getSubUnits(sta, sus)) {
  setSpanAnnoPerFeature(annotationsPertype, type, fs, newUnit, isMultiToken,
      isFirst);
  isFirst = false;
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-tsv

for(AnnotationUnit unit: units){
  if(unit.begin>=newUnit.begin && unit.end>=newUnit.end){
    updateUnitLists(tmpUnits, unit, newUnit);
    aSubUnits.add(newUnit);
    units = new ArrayList<>(tmpUnits);
   if(unit.begin==aSTA.begin){
     AnnotationUnit newUnit = new AnnotationUnit(aSTA.getBegin(), aSTA.getEnd(), false, aSTA.getText());
     updateUnitLists(tmpUnits, unit, newUnit);
  AnnotationUnit newUnit = new AnnotationUnit(aSTA.getBegin(), aSTA.getEnd(), false, aSTA.getText());
  updateUnitLists(tmpUnits, unit, newUnit);
  aSubUnits.add(newUnit);
  updateUnitLists(tmpUnits, unit, newUnit);
  aSTA.setBegin(getNextUnitBegin(aSTA.getBegin()));
  getSubUnits(aSTA, aSubUnits);
  aSubUnits.add(newUnit);
  updateUnitLists(tmpUnits, prevUnit, newUnit);
  getSubUnits(aSTA, aSubUnits);
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-io-tsv

AnnotationUnit govUnit = getFirstUnit(
    getUnit(govFs.getBegin(), govFs.getEnd(), govFs.getCoveredText()));
if (ambigUnits.get(govType.getName()).get(govUnit) == null) {
  govUnit = getUnit(govFs.getBegin(), govFs.getEnd(), govFs.getCoveredText());
AnnotationUnit depUnit = getFirstUnit(
    getUnit(depFs.getBegin(), depFs.getEnd(), depFs.getCoveredText()));
if (ambigUnits.get(govType.getName()).get(depUnit) == null) {
  depUnit = getUnit(depFs.getBegin(), depFs.getEnd(), depFs.getCoveredText());
setRelationAnnoPerFeature(annotationsPertype, type, fs, depUnit, govUnit, govRef,
    depRef, govType);
origin: webanno/webanno

  continue;
int ref = getRefId(type, fs, depUnit);
String annotation = fs.getFeatureValueAsString(feature);
if (annotation == null) {
  annotation = replaceEscapeChars(annotation);
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-io-tsv

for (FeatureStructure chainFs : selectFS(aJCas.getCas(), type)) {
  AnnotationFS linkFs = (AnnotationFS) chainFs.getFeatureValue(chainFirst);
  AnnotationUnit unit = getUnit(linkFs.getBegin(), linkFs.getEnd(),
      linkFs.getCoveredText());
  Type lType = linkFs.getType();
    AnnotationFS nextLinkFs = (AnnotationFS) linkFs.getFeatureValue(linkNext);
    if (nextLinkFs != null) {
      addChinFeatureAnno(annotationsPertype, lType, linkFs, unit, linkNo,
          chainNo);
      addChinFeatureAnno(annotationsPertype, lType, linkFs, unit, linkNo,
          chainNo);
    linkNo++;
    if (nextLinkFs != null) {
      unit = getUnit(linkFs.getBegin(), linkFs.getEnd(), linkFs.getCoveredText());
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-io-tsv

annotation = replaceEscapeChars(annotation);
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-tsv

private AnnotationUnit getFirstUnit(AnnotationUnit aUnit)
{
  SubTokenAnno sta = new SubTokenAnno();
  sta.setBegin(aUnit.begin);
  sta.setEnd(aUnit.end);
  sta.setText(aUnit.token);
  Set<AnnotationUnit> sus = new LinkedHashSet<>();
  AnnotationUnit firstUnit = null;
  for (AnnotationUnit u : getSubUnits(sta, sus)) {
    firstUnit = u;
    break;
  }
  return firstUnit;
}
origin: webanno/webanno

throws AnalysisEngineProcessException
try (OutputStream docOS = getOutputStream(aJCas, filenameSuffix)) {
  resetVariables();
  setSlotLinkTypes();
  setLinkMaps(aJCas);
  setTokenSentenceAddress(aJCas);
  setAmbiguity(aJCas);
  setSpanAnnotation(aJCas);
  setChainAnnotation(aJCas);
  setRelationAnnotation(aJCas);
  writeHeader(docOS);
  for (AnnotationUnit unit : units) {
    if (sentenceUnits.containsKey(unit)) {
      String[] sentWithNl = sentenceUnits.get(unit).split("\n");
      IOUtils.write(LF + "#Text=" + escapeSpecial(sentWithNl[0]) + LF, 
          docOS, encoding);
          IOUtils.write("#Text=" + escapeSpecial(sentWithNl[i + 1]) + LF, docOS,
              encoding);
de.tudarmstadt.ukp.clarin.webanno.tsvWebannoTsv3Writer

Javadoc

Export annotations in TAB separated format. Header includes information about the UIMA type and features The number of columns are depend on the number of types/features exist. All the spans will be written first and subsequently all the relations. relation is given in the form of Source-->Target and the RelationType is added to the Target token. The next column indicates the source of the relation (the source of the arc drown)

Most used methods

  • replaceEscapeChars
  • addChinFeatureAnno
  • getFirstUnit
  • getNextUnitBegin
  • getOutputStream
  • getRefId
    Annotations of same type those: 1) crosses multiple sentences AND 2) repeated on the same unit (ev
  • getSubUnits
  • getUnit
  • isMultiToken
  • isMultipleTokenAnnotation
    If there is at least one non-sub-token annotation whose begin is larger than this one, it is a multi
  • setAmbiguity
  • setAnnoFeature
  • setAmbiguity,
  • setAnnoFeature,
  • setChainAnnoPerFeature,
  • setChainAnnotation,
  • setLinkMaps,
  • setRelationAnnoPerFeature,
  • setRelationAnnotation,
  • setSlotLinkTypes,
  • setSpanAnnoPerFeature,
  • setSpanAnnotation

Popular in Java

  • Reading from database using SQL prepared statement
  • getSharedPreferences (Context)
  • getApplicationContext (Context)
  • addToBackStack (FragmentTransaction)
  • Path (java.nio.file)
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Notification (javax.management)
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you 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