How to check a string against the Windows dictiona

2019-09-01 01:06发布

How can you check if a certain string is in the Windows dictionary?

Or, in other words, how to you grab the entirety of the Windows dictionary, so you can set a new dictionary to have that content?

1条回答
一纸荒年 Trace。
2楼-- · 2019-09-01 01:40

For Windows 8 and Windows Server 2012 there is a Spelling Checking API, that can be consumed from VB.Net via COM.

There is a link to the Microsoft Word Dictionary format (.dic file) listed on Wotsit.org, unfortunately the site is currently unavailable (the link provided is via the Wayback machine).

Microsoft provide a Common Speller API (CSAPI) for Office spell checking, however it appears to require a third party dictionary.

Merriam-Webster provide an online Dictionary API which is free for non-commercial use.

Microsoft Small Basic provides a Dictionary API which connects to an online service and can be consumed from VB.Net, simply import the SmallBasicLibrary.dll.

Imports Microsoft.SmallBasic.Library

Module MyModule

    Sub Main()
        Dim definition = Dictionary.GetDefinition("vowel")
        ' A string is returned if the word exists in the dictionary
        Console.WriteLine(CStr(definition))
    End Sub

End Module
查看更多
登录 后发表回答