uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ludwig Wildner <ludwig.wild...@scai.fraunhofer.de>
Subject Re: How to create a FeaturePath when using JCas?
Date Tue, 07 Aug 2012 16:46:17 GMT
Hi Peter,

try this:

FeaturePath featurePath = aJCas.createFeaturePath();


----- Urspr√ľngliche Mail -----
Von: "Peter Thygesen" <pt.activemq@gmail.com>
An: user@uima.apache.org
Gesendet: Dienstag, 7. August 2012 16:34:10
Betreff: How to create a FeaturePath when using JCas?

I'm trying to write the code for a filtered iterator using
createFilteredIterator and FSMatchConstraint.

I used jcasgen to create java classes for my type system.

I have a type calles SearchProfile which has a feature isCaseSensitive.

I cannot figure out how to get the path to "isCaseSensitive" from my type
SearchProfile. I want to do it in a type safe way (compile-time).


ConstraintFactory constraintFactory = aJCas.getConstraintFactory();

    FSBooleanConstraint booleanConstraint = new FSBooleanConstraintImpl();

    FeaturePath featurePath = ???

    FSMatchConstraint matchConstraint = constraintFactory.embedConstraint(
featurePath ,booleanConstraint);

    FSIndex profileFSIndex = aJCas.getAnnotationIndex(SearchProfile.type);
    FSIterator<SearchProfile> profileIterator =
aJCas.createFilteredIterator(profileFSIndex.iterator(), matchConstraint);


Peter Thygesen

View raw message