All Downloads are FREE. Search and download functionalities are using the official Maven repository.

se.lth.cs.srl.features.SingleFeature Maven / Gradle / Ivy

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy