0

I am working on text analytics project, having a text file with both hindi and English text messages. I am able to read English text but special characters are coming where ever there is a message in hindi.

I want to create a word cloud and do sentiment analysis of both hindi and English words simultaneously. Can some body please help me? How can i read hindi message also in R.

First of all I am not able to start as I am not able to read the file?

I have used file encoding as UTF-8 also to handle special characters.

Erroneous File

Code i am using

Message <- readtext("C:/Users/admin/Desktop/Text_Body.txt", 
                    encoding = "UTF-8", sep = ",", header = TRUE)
SeGa
  • 9,454
  • 3
  • 31
  • 70
Napster
  • 1
  • 2
  • welcome to StackOverflow? what kind of file you are trying to read? that is a good start, try doing that first. If you stuck then ask that first, show the attempt and then move on towards this exercise, a generic view on sentiment analysis you can get on google. Please do read this meanwhile https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example . Happy TextMining and All the best – PKumar May 23 '18 at 15:03
  • Hello Kumar, I am trying to read txt file. I have read it successfully. The txt file contains text in Hindi and english both. After reading the file, i am getting text in english as it is, but for text in hindi i am getting special charaters and ? marks. – Napster May 23 '18 at 15:12
  • https://i.stack.imgur.com/1BQzl.png – Napster May 23 '18 at 15:12
  • Please refer the posted image for the data i am getting after reading the file. – Napster May 23 '18 at 15:13
  • 1
    please do a `dput(head(filename,10))` , Add that in your question. also don't write too many comments, whatever you want to change , edit your question – PKumar May 23 '18 at 15:14
  • 1
    Don't put images use dput like i mentioned, think about others how they can able to help, its not helping to copy any thing from an image right? – PKumar May 23 '18 at 15:15

0 Answers0