uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Thygesen <pt.activ...@gmail.com>
Subject How to create a FeaturePath when using JCas?
Date Tue, 07 Aug 2012 14:34:10 GMT
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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message