R package syuzhet does not work in Hungarian

18 Views Asked by At

I would like to get sentiments of Hungarian songs. I use syuzhet 1.07. It works fine with default settings or with some languages, but not with Hungarian. Is this a bug, or I should load other dictionaries?

syuzhet::get_nrc_sentiment(c('love', 'hate', 'apple'))
  anger anticipation disgust fear joy sadness surprise trust negative positive
1     0            0       0    0   1       0        0     0        0        1
2     1            0       1    1   0       1        0     0        1        0
3     0            0       0    0   0       0        0     0        0        0
> syuzhet::get_nrc_sentiment(c('love', 'hate', 'apple'), language='english')
  anger anticipation disgust fear joy sadness surprise trust negative positive
1     0            0       0    0   1       0        0     0        0        1
2     1            0       1    1   0       1        0     0        1        0
3     0            0       0    0   0       0        0     0        0        0
> syuzhet::get_nrc_sentiment(c('love', 'hate', 'apple'), language='italian')
  anger anticipation disgust fear joy sadness surprise trust negative positive
1     0            0       0    0   0       0        0     0        0        0
2     0            0       0    0   0       0        0     0        0        0
3     0            0       0    0   0       0        0     0        0        0
> syuzhet::get_nrc_sentiment(c('love', 'hate', 'apple'), language='hungarian')
Error in value[[jvseq[[jjj]]]] : subscript out of bounds

I would expect the same at least zeros, but not error and the same values for the Hungarian translation syuzhet::get_nrc_sentiment(c('szeretet', 'utálat', 'alma'), language='hungarian')

0

There are 0 best solutions below