Hi,

On 2013-09-23 15:57, Jyothsna wrote:
HI,

I am new to RUTA as well as UIMA. As part of my work i have to extract the
first names from a given data by using a big list of firstnames.txt(which
has a big list of first names). I was able to do it by using UIMA like the
follwing.

CollectionReader-->FirstnameAnnotator-->AnnotationPrinter.

In the Firstnameannotator's process method i read the CAS, compare it with
firstname from list using regular expression and extracted the matched words.
Then i have assign those words to FirstName type
(FirstName.SetFirstName(matched). After that in the AnnotationPrinter, i was
able to printed out sing getFirstName().

But Now i have extract the firstnames ending with optional space or comma or
hiphen, or double space..

I think writing RUTA script would be better idea.But i did not the idea of
how can i write the java file which reads CAS apply RUTA script and print
the matched firstnames with start and end index.I have gone through RUTA
example projects but i did not find any java files there....

I recently wrote a blog post on how to use a ruta script in a maven project that might interest you :

- Blog : http://textjuicer.com/blog/2013/09/08/using-ruta-in-a-maven-project/
- Github project : https://github.com/apatry/ruta-with-maven

This is about a really simple date annotator, but there is a first name annotator example in RUTA's documentation (http://uima.apache.org/d/ruta-current/tools.ruta.book.html#d5e2309).

Aside from RUTA, you might also want to take a look at the ConceptMapper (http://uima.apache.org/downloads/sandbox/ConceptMapperAnnotatorUserGuide/ConceptMapperAnnotatorUserGuide.html), a dictionary driven annotator.

Hope this help,

Alexandre

--
Alexandre Patry, Ph.D
Chercheur / Researcher
http://KeaText.com

Transformez vos documents en outils de décision
<< Turn your documents into decision tools

Reply via email to