简体   繁体   English

如何在不使用 .Net 中的第三方库的情况下进行拼写检查

[英]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.

相关问题 如何在不使用.Net Core 中的第三方记录器的情况下登录文件? - How to log to a file without using third party logger in .Net Core? 没有第三方库的 C#.NET XMPP over HTTP - C#.NET XMPP over HTTP without third party library 无需使用第三方库即可转换为PDF的c#代码 - c# code for converting into PDF without using third party library 在不使用C#的第三方库的情况下将图像转换为PDF - Image to PDF conversion without using third party library in C# 使用依赖于来自 .NET 6 应用程序的 NLog 的第三方库 - Using a third party library which depends on NLog from a .NET 6 application 有没有办法在不使用任何第三方库 asp.net 的情况下生成条形码并在 pdf 上写入条形码? - Is there any way generating barcode and write barcode on a pdf done without using any third party library asp.net? 无需第三方库即可将媒体上传到推特 - Media upload to twitter without third party library .NET TIFF 文件:RGB 到 CMYK 的转换可以在没有第三方库的情况下进行吗? - .NET TIFF file: RGB to CMYK conversion possible without a third party library? 使用第三方库(带有反射)的.NET应用程序。 - .NET application using third-party library (with reflection) older .NET version 如何在没有第三方短信门方式的情况下使用asp.net C#从网站发送短信 - How send sms from websites using asp.net c# without third party sms gate way
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM