opennlp-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Kosin <james.ko...@gmail.com>
Subject Re: svn commit: r1448517 - in /opennlp/trunk/opennlp-tools/src: main/java/opennlp/tools/namefind/RegexNameFinder.java test/java/opennlp/tools/namefind/RegexNameFinderTest.java
Date Fri, 22 Feb 2013 02:30:15 GMT
On 2/21/2013 4:12 AM, Jörn Kottmann wrote:
> On 02/21/2013 06:34 AM, jkosin@apache.org wrote:
>> -  public RegexNameFinder(Pattern patterns[]) {
>> +  public RegexNameFinder(Pattern patterns[], String type) {
>>       if (patterns == null || patterns.length == 0) {
>>         throw new IllegalArgumentException("patterns must not be null 
>> or empty!");
>>       }
>>         mPatterns = patterns;
>> +    sType = type;
>>     }
>>   +  public RegexNameFinder(Pattern patterns[]) {
>> +    if (patterns == null || patterns.length == 0) {
>> +      throw new IllegalArgumentException("patiierns must not be null 
>> or empty!");
>> +    }
>> +
>> +    mPatterns = patterns;
>> +    sType = null;
>> +  }
>> +
>
> Thanks for fixing this James. If I am not mistaken, then the second 
> constructor could just call the
> first one and pass null for the type right? Then we do not need to 
> duplicate the init code.
>
> Jörn
>
Jorn,

I tried but was trying differently...  this(patterns, null) should 
work.  But null may need to be cast as a String.

James

Mime
View raw message