WinterMensch
WinterMensch

Reputation: 653

R LSA LSAFUN enconding problems

I would like to use the genericSummary function from package LSAfun. Here´s a german sample text.

library("LSAfun")
text = " Gegen die Firma wurde während der letzten Woche ein Zwangsvollstreckungsverfahren eingeleitet. Darüber witzeln die Konkurrenten."

The encoding of my texts is "UTF-8". Actually, the encoding of this sample text is "latin1". Therefore I converted to utf8

text = enc2utf8(text)

When I call

genericSummary(text, k=2)

I get the following error:

Error in FUN(X[[i]], ...) : 
  [lsa] - could not open file C:\Users\MA\AppData\Local\Temp\RtmpcRnDPw\file16c81a35d06/sentence1.txt due to encoding problems of the file.

Does anyone know how to solve this?

Upvotes: 1

Views: 429

Answers (1)

Michael
Michael

Reputation: 11

had the same problem. It seems that the special characters like 'ü' and 'ä' are the cause here. By replacing them with 'ue' and 'ae' the coding will work.

try this: genericSummary(text,k=2, language="german", breakdown=T)

the breakdown option will do the job, see also R-help to this function.

Kind regards, Michael.

Upvotes: 1

Related Questions