阿拉伯文字未显示在R-中 [英] Arabic text not showing in R-

查看:88
本文介绍了阿拉伯文字未显示在R-中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我计划使用Hadith语料库进行文本分析和文本挖掘时,刚开始使用阿拉伯语R进行研究.我一直在阅读与我的问题相关的主题,但仍然无法在此处获得REAL基础知识(对不起,绝对是初学者).

Just started working with R in Arabic as I plan to do text analysis and text mining with Hadith corpus. I have been reading threads related to my question but nevertheless, still can't manage to get the REAL basics here (sorry, absolute beginner).

因此,我输入: textarabic.v<-scan("data/arabic-text.txt",encoding ="UTF-8",what =字符",sep ="\ n")

So, I entered: textarabic.v <- scan("data/arabic-text.txt", encoding="UTF-8", what= "character",sep="\n")

textarabic.v的结果当然是符号(图片).在此之前,我在线程中阅读时将文本保存在utf-8中,但阿拉伯语仍然没有显示.

And what comes out textarabic.v is of course, symbols (pic). Prior to this, I saved my text in utf-8 as I read in a thread but still nothing shows in Arabic.

我可以输入阿拉伯文R,但是扫描会将文本带到符号中.

I can type in Arabic R but scan brings the text in symbols.

也阅读并尝试实现其他用户的代码是使阿拉伯文本功能的代码,但我什至不知道如何以及在何处实现它们. 我添加了R,tm和NLP软件包.

Also read and tried to implement other user's are codes to make Arabic text function but I don't even know how and where to implement them. I added to R, tm and NLP packages.

您建议我下一步做什么? 预先感谢,

What do you suggest for me to do next? Thanks in advance,

推荐答案

我刚刚发布了一个答案,说您肯定在Windows上使用R,然后才能看到您对OSX的评论.在OSX上,情况并非如此严峻.问题是您使用的R版本太旧.如果我没记错,3.2之前的任何版本都无法正确处理Unicode.尝试从 https://cran.r-project.org/bin/macosx安装3.3.3 /,并在必要时重新安装所需的软件包.那你应该没事的. بالتوفيق!

I just posted an answer saying that you must definitely be using R on Windows before I saw your comment that you're on OSX. On OSX the situation is not quite so dire. The problem is that you're using too old a version of R. If I right remember, anything prior to 3.2 does not handle Unicode correctly. Try installing 3.3.3 from https://cran.r-project.org/bin/macosx/ and if necessary re-install the packages you need. Then you should be fine. بالتوفيق!

这篇关于阿拉伯文字未显示在R-中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆