You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@opennlp.apache.org by "Russ, Daniel (NIH/CIT) [E]" <dr...@mail.nih.gov> on 2015/06/10 16:43:52 UTC
JWNL bug???
Hi,
I am not sure if this is a bug or not. In getLemmas(String word, String tag) method of JWNLDictionary, if you are looking up adjectives it checks if the tag starts with "J" or "a". Anyone know if this a bug or deliberate? (JWNL-1.3.3 distributed with opennlp-1.5.3)
if (tag.startsWith("N") || tag.startsWith("n")) {
pos = POS.NOUN;
}
else if (tag.startsWith("V") || tag.startsWith("v")) {
pos = POS.VERB;
}
else if (tag.startsWith("J") || tag.startsWith("a")) {
pos = POS.ADJECTIVE;
}
else if (tag.startsWith("R") || tag.startsWith("r")) {
pos = POS.ADVERB;
}
else {
pos = POS.NOUN;
}
Dan
Re: JWNL bug???
Posted by "Russ, Daniel (NIH/CIT) [E]" <dr...@mail.nih.gov>.
That make sense.
Thank you.
Dan
On Jun 10, 2015, at 3:51 PM, Aliaksandr Autayeu wrote:
> Most likely not. It looks like the first option refers to PennTreeBank tags
> (nouns - N-N, N-NS, etc, verbs - V-B, V-BD, etc, adjectives - J-J, J-JR,
> J-JS, adverbs - R-B, etc) and the second option refers to WordNet "nvar"
> tags - n-oun, v-erb, a-djective, adve-r-b. It's a bit strange to see two
> type of tags together, but it does not seem too random :) This line from
> "main" confirms the first guess:
>
> dict.getLemmas(word,"NN")
>
> Aliaksandr
>
>>
Re: JWNL bug???
Posted by Aliaksandr Autayeu <al...@autayeu.com>.
Most likely not. It looks like the first option refers to PennTreeBank tags
(nouns - N-N, N-NS, etc, verbs - V-B, V-BD, etc, adjectives - J-J, J-JR,
J-JS, adverbs - R-B, etc) and the second option refers to WordNet "nvar"
tags - n-oun, v-erb, a-djective, adve-r-b. It's a bit strange to see two
type of tags together, but it does not seem too random :) This line from
"main" confirms the first guess:
dict.getLemmas(word,"NN")
Aliaksandr
On 10 June 2015 at 16:43, Russ, Daniel (NIH/CIT) [E] <dr...@mail.nih.gov>
wrote:
> Hi,
> I am not sure if this is a bug or not. In getLemmas(String word,
> String tag) method of JWNLDictionary, if you are looking up adjectives it
> checks if the tag starts with "J" or "a". Anyone know if this a bug or
> deliberate? (JWNL-1.3.3 distributed with opennlp-1.5.3)
>
> if (tag.startsWith("N") || tag.startsWith("n")) {
> pos = POS.NOUN;
> }
> else if (tag.startsWith("V") || tag.startsWith("v")) {
> pos = POS.VERB;
> }
> else if (tag.startsWith("J") || tag.startsWith("a")) {
> pos = POS.ADJECTIVE;
> }
> else if (tag.startsWith("R") || tag.startsWith("r")) {
> pos = POS.ADVERB;
> }
> else {
> pos = POS.NOUN;
> }
>
> Dan
>