使用多种语言的DevExpress拼写检查程序

时间:2011-04-05 12:50:41

标签: devexpress

我需要检查英语和希腊语单词。我使用SpellCheckerOpenOfficeDictionary添加英语和希腊词典。但它不起作用

Public Sub SpellCheckSettings(ByRef objSpellChecker As SpellChecker)
    Dim objDictionary, objGreekdic As SpellCheckerOpenOfficeDictionary
    Dim objCulture, objGreekCulture As CultureInfo

    Try
        objCulture = New CultureInfo("en-US")
        objSpellChecker.Culture = objCulture
        objDictionary = New SpellCheckerOpenOfficeDictionary(GetLanguageDictionaryPath("en_US.dic"), GetLanguageDictionaryPath("en_US.aff"), objCulture)
        objSpellChecker.Dictionaries.Add(objDictionary)


        objGreekCulture = New CultureInfo("el")
        objGreekdic = New SpellCheckerOpenOfficeDictionary(GetLanguageDictionaryPath("el_GR.dic"), GetLanguageDictionaryPath("el_GR.aff"), objGreekCulture)
        objSpellChecker.Dictionaries.Add(objGreekdic)
    Catch ex As Exception
    End Try
End Sub

如果我使用上述任何一种,拼写检查效果很好。任何人请帮忙

1 个答案:

答案 0 :(得分:0)

将SpellChecker的文化设置为不变值。在这种情况下,spellChecker将使用两个词典来检查单词和计算建议。您可以使用以下代码设置spellChecker的文化:

        spellChecker1.Culture = System.Globalization.CultureInfo.InvariantCulture;