se.lth.cs.srl.features.SingleFeature Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of srl Show documentation
Show all versions of srl Show documentation
mate-tools Semantic Role Labeler
The newest version!
package se.lth.cs.srl.features;
import java.util.Collection;
import se.lth.cs.srl.corpus.Predicate;
import se.lth.cs.srl.corpus.Sentence;
import se.lth.cs.srl.corpus.Word;
public abstract class SingleFeature extends Feature {
private static final long serialVersionUID = 1L;
protected SingleFeature(FeatureName name,boolean includeArgs,boolean usedForPredicateIdentification,String POSPrefix) {
super(name,includeArgs,usedForPredicateIdentification,POSPrefix);
}
@Override
public void addFeatures(Sentence s, Collection indices, int predIndex, int argIndex, Integer offset,boolean allWords) {
Integer i=indexOf(getFeatureString(s,predIndex,argIndex));
if(i!=-1 && (allWords || i indices,Predicate pred,Word arg, Integer offset,boolean allWords){
Integer i=indexOf(getFeatureString(pred,arg));
if(i!=-1 && (allWords || i