Hello,
that should work. What is the error you get?
The usual suspects are these:
- You did not specify the type parameters in your xml descriptor
- Your type system does not contain the types you want to retrieve
Hope that helps,
Jörn
On 08/14/2012 01:33 PM, Andreas Niekler wrote:
Hello,
i'm working on a MongoDB Cas Cosumer which consumes the openNLP CAS
Documents. Right now i'm having problems to correctly initialize the
TypeSystem. The following does not work. I bet this is because i do
not rely on the Annotators anymore and just want to grab the
annotations. But how can i address the types in a CAS_Consumer the
right way using the uima openNLP tools?
String sentenceTypeName =
CasConsumerUtil.getRequiredStringParameter(getUimaContext(),
UimaUtil.SENTENCE_TYPE_PARAMETER);
String tokenTypeName =
CasConsumerUtil.getRequiredStringParameter(getUimaContext(),
UimaUtil.TOKEN_TYPE_PARAMETER);
mSentenceType = CasConsumerUtil.getType(typeSystem,
sentenceTypeName);
mTokenType = CasConsumerUtil.getType(typeSystem, tokenTypeName);