Skip to content

Commit

Permalink
Merge pull request #1400 from dkpro/feature/81-Check-usefulness-of-Ta…
Browse files Browse the repository at this point in the history
…g-type

#81 - Check usefulness of Tag type
  • Loading branch information
reckart authored Aug 11, 2019
2 parents a73a72e + e63a97a commit 101765d
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ classpath*:desc/type/Chunks.xml
classpath*:desc/type/Constituency.xml
classpath*:desc/type/Dependency.xml
classpath*:desc/type/PennTree.xml
classpath*:desc/type/Tag.xml
21 changes: 0 additions & 21 deletions dkpro-core-api-syntax-asl/src/main/resources/desc/type/Tag.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos.POS;
import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token;
import de.tudarmstadt.ukp.dkpro.core.api.syntax.type.PennTree;
import de.tudarmstadt.ukp.dkpro.core.api.syntax.type.Tag;
import de.tudarmstadt.ukp.dkpro.core.api.syntax.type.constituent.Constituent;
import de.tudarmstadt.ukp.dkpro.core.api.syntax.type.dependency.Dependency;
import edu.stanford.nlp.ling.CoreLabel;
Expand Down Expand Up @@ -153,15 +152,6 @@ private Annotation createConstituentAnnotationFromTree(
// calculate span for the current subtree
IntPair span = tokenTree.getSpan(aNode);

// Check if the node has been marked by a TSurgeon operation.
// If so, add a tag-annotation on the constituent
if (nodeLabelValue.contains(TAG_SEPARATOR) && !nodeLabelValue.equals(TAG_SEPARATOR)) {
int separatorIndex = nodeLabelValue.indexOf(TAG_SEPARATOR);
String tag = nodeLabelValue.substring(0, separatorIndex);
nodeLabelValue = nodeLabelValue.substring(separatorIndex + 1, nodeLabelValue.length());
createTagAnnotation(span.getSource(), span.getTarget(), tag);
}

// Check if node is a constituent node on sentence or phrase-level
if (aNode.isPhrasal()) {

Expand Down Expand Up @@ -229,23 +219,6 @@ else if (aNode.isPreTerminal()) {
}
}

/**
* Creates a tag-annotation over a constituent
*
* @param aBegin
* start-index of the constituent span
* @param aEnd
* end-index of the constituent span
* @param aTag
* the tag value
*/
public void createTagAnnotation(int aBegin, int aEnd, String aTag)
{
Tag newTag = new Tag(jCas, aBegin, aEnd);
newTag.setValue(aTag);
jCas.addFsToIndexes(newTag);
}

/**
* Creates a new Constituent annotation. Links to parent- and child-annotations are not yet
* created here.
Expand Down

0 comments on commit 101765d

Please sign in to comment.