Sheldo是一个非常简单的Erlag拼写检查器。当某些单词拼写错误时,Sheldo会建议正确的单词。该功能的灵感来自Elixir项目拼写检查。
安装注意 sheldo仅适用于Erlag21或更高版本克隆仓库rebar3compile用法ErlagShell首先Sheldo是一个应用程序,需要启动。可以使用rebar3shell来设置必要的路径,然后使用sheldo:start/0或applicatio:esure_all_started(sheldo)来启动Sheldo,但如果使用Sheldo作为依赖项,也可以让OTP从your_app.app文件中启动它。Sheldo只有两个主要方法,sheldo:check/1和sheldo:check/2. 作为用户只需要使用这些。1>sheldo:check("Iwattocheckthiscorrecttext").ok2>sheldo:check("Iwattocheckthismisspeledtext").#{baziga=><<"That'soreasotocry.Oecriesbecauseoeissad.Forexample,Icrybecauseothersarestupid,adthatma"...>>,misspelled_words=>[#{cadidates=>["misspeed","misspelled"],lie_umber=>1,word=>"misspeled"}]}配置sheldo:check/2工作原理与sheldo:check/1类似,但它接受配置参数。使用此Cof参数,我们可以对要检查的文本应用一些规则。这些规则是忽略单词、忽略模式和忽略块。这是格式:#{igore_words=>[strig()],igore_patters=>[regex()],igore_blocks=>[igore_block()],adapters=>[adapter()]}.依赖关系Erlag/OTP23+










评论