Michael Baessler wrote:
I know that we already have FeaturePath implementation in the core but
I think this is not very intuitive and does not match most use cases.
My suggestion for the FeaturePath interface is shown below:
Currently there are two featurePath helpers available
- FeaturePath
public interface FeaturePath {
int size();
Feature getFeature(int i);
void addFeature(Feature feat);
}
- FeatureValuePath
public interface FeatureValuePath {
public Object evaluate(int currentFS, LowLevelCAS cas);
public Float evaluateAsFloat(int currentFS, LowLevelCAS cas);
public Float[] evaluateAsFloatArray(int currentFS, LowLevelCAS
cas);
public Integer evaluateAsInt(int currentFS, LowLevelCAS cas);
public Integer[] evaluateAsIntArray(int currentFS, LowLevelCAS
cas);
public String evaluateAsString(int currentFS, LowLevelCAS cas);
public String[] evaluateAsStringArray(int currentFS,
LowLevelCAS cas);
public int getFSType();
public String getValueType();
public void typeSystemInit(int fsType, LowLevelTypeSystem ts)
throws CASRuntimeException;
}
I would like to use the current FeaturePath interface and extend it with
my suggestion and so with additional functionality where some of it is
currently
available at the FeatureValuePath interface. Given that I will deprecate
the FeatureValuePath stuff completely - I think the method names should
follow the
know CAS method style names (getIntValue()). If low level functionality
is still required I can easily add a low level API to my interface
(ll_getIntValue(int currentFS, LowLevelCAS cas)).
-- Michael