【问题标题】:Problem with adding custom words to hunspell dictionary in R在 R 中向 hunspell 词典添加自定义单词的问题
【发布时间】:2019-05-08 23:17:42
【问题描述】:

我能够弄清楚如何将自定义单词添加到 R 中的 hunspell 字典中。但是,我不确定为什么它没有用于拼写检查。这是我使用的:

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

hunspell("bing") 仍然确定“bing”不正确。

有人有这方面的经验吗?谢谢。

【问题讨论】:

    标签: r dictionary hunspell


    【解决方案1】:

    dictionary() 函数返回一个您可以使用的新字典。它不会改变默认行为或任何东西。你可以这样做

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

    【讨论】:

      猜你喜欢
      • 2023-03-10
      • 1970-01-01
      • 1970-01-01
      • 2013-01-28
      • 1970-01-01
      • 1970-01-01
      • 2013-08-29
      • 1970-01-01
      • 2018-06-07
      相关资源
      最近更新 更多