trinker / qdap

Quantitative Discourse Analysis Package: Bridging the gap between qualitative data and quantitative analysis
http://cran.us.r-project.org/web/packages/qdap/index.html
175 stars 44 forks source link

polarity with negator and oposing polarities #203

Closed trinker closed 9 years ago

trinker commented 9 years ago

Consider...

counts(polarity("notebook is a good but i love batterytop"))
counts(polarity("notebook is not good but i love batterytop"))
> counts(polarity("notebook is a good but i love batterytop"))
  all wc polarity  pos.words neg.words                                 text.var
1 all  8    0.707 good, love         - notebook is a good but i love batterytop

> counts(polarity("notebook is not good but i love batterytop"))
  all wc polarity  pos.words neg.words                                   text.var
1 all  8   -0.707 good, love         - notebook is not good but i love batterytop

I'd expect the outcome to be 0 polarity for the second one. It seems the negator is negating everything, not just that chunk.

trinker commented 9 years ago

This is expected now as the not is included in the second chunk and thus negates both chunks. Consider:

counts(polarity("notebook is not good but i WORD love batterytop"))

##   all wc polarity  pos.words neg.words                                        text.var
## 1 all  9        0 good, love         - notebook is not good but i WORD love batterytop