use of edu.illinois.cs.cogcomp.lbjava.classify.Feature in project cogcomp-nlp by CogComp.
the class labelTwoBeforeU method cachedFeatureValue.
private Feature cachedFeatureValue(Object __example) {
if (__example == __exampleCache.get())
return (Feature) __cache.get();
__exampleCache.set(__example);
String __cachedValue = _discreteValue(__example);
Feature __result = new DiscretePrimitiveStringFeature(containingPackage, name, "", __cachedValue, valueIndexOf(__cachedValue), (short) allowableValues().length);
__cache.set(__result);
return __result;
}
use of edu.illinois.cs.cogcomp.lbjava.classify.Feature in project cogcomp-nlp by CogComp.
the class POSTaggerKnown method cachedFeatureValue.
private Feature cachedFeatureValue(Object __example) {
Token w = (Token) __example;
String __cachedValue = w.partOfSpeech;
if (__cachedValue != null) {
return new DiscretePrimitiveStringFeature(containingPackage, name, "", __cachedValue, valueIndexOf(__cachedValue), (short) allowableValues().length);
}
Feature __result;
__result = valueOf(w, baselineTarget.allowableTags(wordForm.discreteValue(w)));
w.partOfSpeech = __result.getStringValue();
return __result;
}
use of edu.illinois.cs.cogcomp.lbjava.classify.Feature in project cogcomp-nlp by CogComp.
the class labelOrBaseline method cachedFeatureValue.
private Feature cachedFeatureValue(Object __example) {
if (__example == __exampleCache.get())
return (Feature) __cache.get();
__exampleCache.set(__example);
String __cachedValue = _discreteValue(__example);
Feature __result = new DiscretePrimitiveStringFeature(containingPackage, name, "", __cachedValue, valueIndexOf(__cachedValue), (short) allowableValues().length);
__cache.set(__result);
return __result;
}
use of edu.illinois.cs.cogcomp.lbjava.classify.Feature in project cogcomp-nlp by CogComp.
the class Chunker method cachedFeatureValue.
private Feature cachedFeatureValue(Object __example) {
Token word = (Token) __example;
String __cachedValue = word.type;
if (__cachedValue != null) {
return new DiscretePrimitiveStringFeature(containingPackage, name, "", __cachedValue, valueIndexOf(__cachedValue), (short) allowableValues().length);
}
Feature __result;
__result = super.featureValue(__example);
word.type = __result.getStringValue();
return __result;
}
Aggregations