uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luca Foppiano <l...@foppiano.org>
Subject Re: uima-fit and uima annotators (in my case Whitespace annotator)
Date Wed, 29 Jan 2014 16:32:38 GMT
On Thu, Jan 23, 2014 at 3:13 PM, Richard Eckart de Castilho
<rec@apache.org>wrote:

> Hi,
>

Hi again,
  see below my feedback about the points you've previously made.
[...]

- it is not mandatory to have the type system java classes (JCas wrappers)
> present in a project if none of your components (Readers, AEs, CCs) use
> them.
>

Indeed, in my sample I want to take an 3rd party annotator and experiment
the integration.


> - it is possible to manually load a type system description (TSD) and pass
> it to the components. But then the TSD is the second argument to the
> createXXXDescription call, e.g.
>
>   createEngineDescription(SimpleCC.class, tsd,
>     SimpleCC.PARAM_OUTPUT_DIR, "…");
>


- the type systems of all components in a pipeline is automatically merged
> when a pipeline is run (e.g. using SimplePipeline.runPipeline). Thus, it
> would also work to pass a TSD with all types used in the pipeline only to
> the reader, but not to any of the subsequent components.
>

Ok, that's an important point in fact.
Do you know if the order (if it is passed to the first or last component)
does matters?


> - alternatively, it is possible to have uimaFIT automatically detect your
> types [1]. If you do that, there is no need at all to pass the TSD to the
> component - it happens automatically.
>
>   createEngineDescription(SimpleCC.class,
>     SimpleCC.PARAM_OUTPUT_DIR, "…");
>

OK. Do you have an example/use case of when the TSD should be passed to the
engine? Perhaps when the type system is loaded by manually fetching the
information or reading the descriptor programmatically?



> - if you want to retrieve annotation from the CAS without using the JCas
> wrappers, you can have a look at the CasUtil class. E.g.
>
>   CasUtil.select(cas, CasUtil.getType(cas, "my.package.name.MyType"))
>
> Mind, this call works only if "MyType" inherits from the built-in
> "Annotation" type. Otherwise, you would use "selectFS" instead of "select".
>
> I would recommend using the CAS/CasUtil only if you want to implement a
> generic component that can be configured to work with different types. If
> your component is fixed to a certain type system, then using the
> JCas/JCasUtil is much more convenient.
>
> OK, that's definitely helpful, but I still have a bit of confusion in my
head between JCas and CAS.

In my example I could use JCAs, the problem is that the JCASUtils.select()
method require the Class Type system

[...] select([...],  *final Class<T> type*) [...]

while the Cas/CasUtil select() method takes the type defined as Type. Is
there a reason for this difference? I might have missed/forgotten something
or some part of the documentation

Thank you again
-- 
Luca Foppiano

Software Engineer
+31615253280
luca@foppiano.org
www.foppiano.org

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