Reputation: 779
I am doing a web based chattebot system and my problems are these.
Therefore What is the best C# API for wordnet?? Well what I want to do is get a sentence from a textbox and use it for synonym and spell check and there is both c# ASP and standalone app APIs on the wrodnet site.What is the best way?
Can I do both spell check and synonym check using wordnet and the other c# API??
I would be grateful if you could give me some solutions.
Thanks a lot.
Upvotes: 2
Views: 7582
Reputation: 6896
Of the API's listed here: http://wordnet.princeton.edu/wordnet/related-projects/#.NET, Matt Gerber's ( http://ptl.sys.virginia.edu/ptl/members/matthew-gerber/software#WordNet_API ) is the best.
It's not a great API, but it works okay and it was a good start for what I needed.
I've also not tried Proxem's Antelope yet as it seemed more like a heavyweight app then a simple API. It may be much more robust though, and the parsing engine could be very useful for what you are doing.
Upvotes: 1
Reputation: 160922
If you can I would use the WPF built in spell checker, just add a reference to PresentationFramework
in your ASP.NET project and you can programmatically create a WPF text box to use for spell check etc.
List<string> getSuggestions(string text)
{
System.Windows.Controls.TextBox wpfTextBox = new System.Windows.Controls.TextBox();
wpfTextBox.AcceptsReturn = true;
wpfTextBox.AcceptsTab = true;
wpfTextBox.SpellCheck.IsEnabled = true;
wpfTextBox.Text = text;
int index = 0;
List<string> suggestions = new List<string>();
while ((index = wpfTextBox.GetNextSpellingErrorCharacterIndex(index, System.Windows.Documents.LogicalDirection.Forward)) != -1)
{
string currentError = wpfTextBox.Text.Substring(index, wpfTextBox.GetSpellingErrorLength(index));
suggestions.Add(currentError);
foreach (string suggestion in wpfTextBox.GetSpellingError(index).Suggestions)
{
suggestions.Add(suggestion);
}
}
return suggestions;
}
Upvotes: 1