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

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

问题描述

刚开始使用阿拉伯语的 R 语言,因为我计划使用 Hadith 语料库进行文本分析和文本挖掘.我一直在阅读与我的问题相关的主题,但仍然无法在这里获得真正的基础知识(抱歉,绝对是初学者).

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="character",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,

推荐答案

我刚刚发布了一个答案,说在我看到您在 OSX 上的评论之前,您一定是在 Windows 上使用 R.在 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天全站免登陆