[英]How to Spell Check without using third party library in .Net
I want to implement a method in C# class library project which will take a word as an input parameter and return correct spelling or suggestions of the words using .Net PresentationFramework.dll
dll.我想在 C# 类库项目中实现一个方法,该方法将一个单词作为输入参数,并使用 .Net
PresentationFramework.dll
dll 返回单词的正确拼写或建议。
In WPF, PresentationFramework.dll provides this feature for a text box control when we enable the SpellCheck property value to true.在 WPF 中,当我们将 SpellCheck 属性值启用为 true 时,PresentationFramework.dll 为文本框控件提供了此功能。
<TextBox SpellCheck.IsEnabled="True" Name="myTextBox"></TextBox>
But I need similar feature in class library project where I will not have any controls to type the input value.但是我在类库项目中需要类似的功能,我将没有任何控件来键入输入值。 Just I want to use this spell check feature in custom method.
只是我想在自定义方法中使用此拼写检查功能。 Is there any way to use this DLL functionality to achieve the same?
有没有办法使用这个 DLL 功能来实现相同的功能?
There is the win32 Spellcheck API .有 win32 Spellcheck API 。
HRESULT Check(
[in] LPCWSTR text,
[out, retval] IEnumSpellingError **value
);
As far as I know there is no first party wrapper around this in .net, but a quick google suggest there are at least one third party wrapper .据我所知,.net 中没有第一方包装器,但快速谷歌建议至少有一个第三方包装器。
So you might need to decide if you want to use a library or write your own wrapper.因此,您可能需要决定是要使用库还是编写自己的包装器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.