This is a migrated thread and some comments may be shown as answers.

Server-Side SpellCheck using RadSpell taking lot of time

0 Answers 37 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Venky
Top achievements
Rank 2
Venky asked on 20 Sep 2012, 09:49 AM
Here is the below code, which i used. 

private string GetNextWrongWord() {
//SpellChecker spell = new SpellChecker(Server.MapPath("~/App_Data/RadSpell"));
spellCheck.Text = Session["Spell"].ToString();
if(ddlLanguage.SelectedValue.ToString() == "1") {
spellCheck.DictionaryLanguage = "en-US";
} else if(ddlLanguage.SelectedValue.ToString() == "2") {
spellCheck.DictionaryLanguage = "fr-FR";
} else if(ddlLanguage.SelectedValue.ToString() == "3") {
spellCheck.DictionaryLanguage = "de-DE";
} else if(ddlLanguage.SelectedValue.ToString() == "4") {
spellCheck.DictionaryLanguage = "es-ES";
} else if(ddlLanguage.SelectedValue.ToString() == "5") {
spellCheck.DictionaryLanguage = "en-AU";
} else {
spellCheck.DictionaryLanguage = "en-GB";
}
string sWrongWord = "";
spellCheck.CheckText();
if(Flagignore == 2) {
int k = 0;
SpellCheckErrors errors = spellCheck.Errors;
foreach(SpellCheckError error in errors) {
sWrongWord = error.MistakenWord.ToString();
try {
if(sWrongWord == strIgnoreAllWords[k].ToString()) {
sWrongWord = "";
} else {
bool a = Array.Exists(strIgnoreAllWords, element => element == sWrongWord);
if(a == true) {
sWrongWord = "";
} else {
return sWrongWord;
}
}
} catch(Exception) {
break;
}
k++;
}
} else {
int k = 0;
SpellCheckErrors errors = spellCheck.Errors;
foreach(SpellCheckError error in errors) {
sWrongWord = error.MistakenWord.ToString();
try {
strIgnoreNewWords = Session["IgnoreWord"].ToString().Split(',');
if(strIgnoreNewWords != null) {
bool a = Array.Exists(strIgnoreNewWords, element => element == sWrongWord);
if(a == true) {
sWrongWord = "";
} else {
return sWrongWord;
}
} else {
if(sWrongWord == strIgnoreWords[k].ToString()) {
sWrongWord = "";
} else {
break;
}
}
} catch(Exception) {
break;
}
k++;
}
}


return sWrongWord;
}

So please help me.

No answers yet. Maybe you can help?

Tags
Editor
Asked by
Venky
Top achievements
Rank 2
Share this question
or