Server-Side SpellCheck using RadSpell taking lot of time

1 posts, 0 answers
  1. Venky
    Venky avatar
    10 posts
    Member since:
    Sep 2012

    Posted 20 Sep 2012 Link to this post

    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.
Back to Top