Problem with adding custom words to hunspell dictionary in R

风流意气都作罢 提交于 2020-05-17 07:25:08

问题


I was able to figure out how to add custom words into the hunspell dictionary in R. However, I'm not sure why it's not being used in spell checking. Here is what I used:

library(hunspell)
#adding custom words into hunspell dictionary
hunspell::dictionary(lang = "en_US", affix = NULL, add_words = "bing", cache = TRUE)

but hunspell("bing") still determine "bing" is incorrect.

Anyone have experience with this before? Thanks.


回答1:


The dictionary() function returns a new dictionary that you can use. It doesn't change the default behavior or anything. You can do

library(hunspell)
mydict <- dictionary(lang = "en_US", affix = NULL, add_words = "bing", cache = TRUE)
hunspell("bing", dict=mydict)


来源:https://stackoverflow.com/questions/56043887/problem-with-adding-custom-words-to-hunspell-dictionary-in-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!