You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@opennlp.apache.org by Svetoslav Marinov <sv...@findwise.com> on 2012/02/27 16:00:04 UTC

Regex Name Finder

Hi all,

Where can I find an example of how the Regular expression name finder is used? How should one specify the regular expressions? And where should one specify them? Can one test it via the command line or should it be done via the API? Is it only based on the tokens or can it take POS tags in consideration?

Best regards,

Svetoslav

Re: Regex Name Finder

Posted by James Kosin <ja...@gmail.com>.
On 2/27/2012 10:00 AM, Svetoslav Marinov wrote:
> Hi all,
>
> Where can I find an example of how the Regular expression name finder is used? How should one specify the regular expressions? And where should one specify them? Can one test it via the command line or should it be done via the API? Is it only based on the tokens or can it take POS tags in consideration?
>
> Best regards,
>
> Svetoslav
>
Svetoslav,

Sorry for the belated response.

It looks like the RegexNameFinder is supplied an array of Pattern []
that is defined by java.util.regex.Pattern class. So, if you could
express the pattern for finding names as a regular expression you could
use it to look for the name types you wanted. It probably would be best
suited used to find monetary amounts and dates that are easily expressed
as regular expressions. Eg: 2012.03.13 is one way to express a date, as
is 02/22/1980, 02-22, etc. You could build a series of regular
expressions to easily handle them and use that to perform the name
finding for the date fields.

Currently you would have to use it as a library, as there is no
interface to it from the CLI or other tools. A lot of the sources are
mainly libraries for other applications to access the models. The CLI
was started to train the model, initially and later implemented to
perform some of the routine tasks.

Another usage would be for $ 1,000.00 or 1.000,00 € .... for finding
currency. You would have to turn them into Patterns to be useful.

References for patterns:
http://docs.oracle.com/javase/1.4.2/docs/api/java/util/regex/Pattern.html
http://www.kodejava.org/browse/38.html

Google "java util regex pattern examples" for more...

James