You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@opennlp.apache.org by ABHISHEK MAITI <ab...@iiitd.ac.in> on 2017/02/08 15:01:00 UTC

Help Required in Code

Hi!
I was going through the codebase which is present on Github. I found a line
in this
<https://github.com/apache/opennlp/blob/master/opennlp-tools/src/main/java/opennlp/tools/sentdetect/DefaultEndOfSentenceScanner.java>
file which I couldn't understand (line no. 31).Is it supposed to be char
eosCharacters[]? I was expecting it to be char[] eosCharacters.

Thanks!

*Abhishek Maiti*
*B.Tech 2016 | Computer Science and Engineering*
Indraprastha Institute Of Information Technology
New Delhi
+918447549121

Re: Help Required in Code

Posted by "Russ, Daniel (NIH/CIT) [E]" <dr...@mail.nih.gov>.
I am not an expert on this part of the code, but I believe the idea is that there are multiple characters that can end a sentence (in English, think .!?). So it might be looking if any of the characters in the text match any of the end of sentence characters.
Daniel

On 2/8/17, 10:01 AM, "ABHISHEK MAITI" <ab...@iiitd.ac.in> wrote:

    Hi!
    I was going through the codebase which is present on Github. I found a line
    in this
    <https://github.com/apache/opennlp/blob/master/opennlp-tools/src/main/java/opennlp/tools/sentdetect/DefaultEndOfSentenceScanner.java>
    file which I couldn't understand (line no. 31).Is it supposed to be char
    eosCharacters[]? I was expecting it to be char[] eosCharacters.
    
    Thanks!
    
    *Abhishek Maiti*
    *B.Tech 2016 | Computer Science and Engineering*
    Indraprastha Institute Of Information Technology
    New Delhi
    +918447549121
    


Re: Help Required in Code

Posted by ABHISHEK MAITI <ab...@iiitd.ac.in>.
I get it now.
But shouldn't it be changed to char [] so it is more widely understood by
new contributors?
I found it in use a bit too frequently.

On Feb 8, 2017 20:51, "Suneel Marthi" <sm...@apache.org> wrote:

> In Java both are valid syntaxes to represent an array of chars, the
> preferred syntax should have been char[] eosCharacters.
>
> The getter method actually returns a char[]
>
> public char[] getEndOfSentenceCharacters() {
>   return eosCharacters;
> }
>
>
> On Wed, Feb 8, 2017 at 10:01 AM, ABHISHEK MAITI <abhishek16005@iiitd.ac.in
> >
> wrote:
>
> > Hi!
> > I was going through the codebase which is present on Github. I found a
> line
> > in this
> > <https://github.com/apache/opennlp/blob/master/opennlp-
> > tools/src/main/java/opennlp/tools/sentdetect/
> DefaultEndOfSentenceScanner.
> > java>
> > file which I couldn't understand (line no. 31).Is it supposed to be char
> > eosCharacters[]? I was expecting it to be char[] eosCharacters.
> >
> > Thanks!
> >
> > *Abhishek Maiti*
> > *B.Tech 2016 | Computer Science and Engineering*
> > Indraprastha Institute Of Information Technology
> > New Delhi
> > +918447549121
> >
>

Re: Help Required in Code

Posted by Suneel Marthi <sm...@apache.org>.
In Java both are valid syntaxes to represent an array of chars, the
preferred syntax should have been char[] eosCharacters.

The getter method actually returns a char[]

public char[] getEndOfSentenceCharacters() {
  return eosCharacters;
}


On Wed, Feb 8, 2017 at 10:01 AM, ABHISHEK MAITI <ab...@iiitd.ac.in>
wrote:

> Hi!
> I was going through the codebase which is present on Github. I found a line
> in this
> <https://github.com/apache/opennlp/blob/master/opennlp-
> tools/src/main/java/opennlp/tools/sentdetect/DefaultEndOfSentenceScanner.
> java>
> file which I couldn't understand (line no. 31).Is it supposed to be char
> eosCharacters[]? I was expecting it to be char[] eosCharacters.
>
> Thanks!
>
> *Abhishek Maiti*
> *B.Tech 2016 | Computer Science and Engineering*
> Indraprastha Institute Of Information Technology
> New Delhi
> +918447549121
>