Google spellcheck service

7 posts, 0 answers
  1. Roland
    Roland avatar
    11 posts
    Member since:
    Mar 2007

    Posted 10 May 2010 Link to this post

    Wasnt this implemented recently? I even had information on how to put it in -

    Create a GoogleSpellCheckProvider class that implements the ISpellCheckProvider.

    Set SpellCheckProviderTypeName property of RadSpell to = typeof(Telerik.Web.UI.GoogleSpellCheckProvider).AssemblyQualifiedName of compiled GoogleSpellCheckProvider created.

    This still works?

    Thanks.

    Roland
  2. Petio Petkov
    Admin
    Petio Petkov avatar
    825 posts

    Posted 11 May 2010 Link to this post

    Hello Roland,

    You should set the AllowAddCustom  property to false too.
    A simple example which illustrates how to use GoogleSpellCheckProvider is available here:
    http://demos.telerik.com/aspnet-ajax/spell/examples/googlespell/defaultcs.aspx
    Let us know if you have any other questions.


    Regards,
    Petio Petkov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Roland
    Roland avatar
    11 posts
    Member since:
    Mar 2007

    Posted 11 May 2010 Link to this post

    Hi Petio.

    Thanks for the reply. Yes, i set that property as well.

    The next problem we had was our company has some issues with letting Google be the dictionary as well so we wanted to spellcheck locally but send mistaken words to the service instead as it gives better suggestions.

    So I tweaked the GoogleSpellCheckProvider class as follows -

    public GoogleSpellCheckProvider(SpellChecker checker)  
            {  
                this.checker = checker;  
                this.textWords = checker.TextWords;  
                this._language = checker.DictionaryLanguage.Substring(0, 2).ToLower();  
                StringBuilder sb = new StringBuilder();  
     
                //create new spellcheck to check words.   
                SpellChecker chk = new SpellChecker(HttpContext.Current.Server.MapPath("~/App_Data/RadSpell/"));  
                chk.SpellCheckProvider = SpellCheckProvider.PhoneticProvider;  
                chk.Text = checker.Text;  
                chk.WordIgnoreOptions = checker.WordIgnoreOptions;  
                  
                SpellCheckErrors errors = chk.CheckText();  
     
                //append misspelled words instead of ALL the words.   
                foreach (SpellCheckError error in errors)  
                {  
                    sb.Append(error.MistakenWord);  
                    sb.Append(" ");  
                }  
                  
                //for (int i = 0; i < textWords.Length; i++)  
                //{  
                //    sb.Append(textWords[i].Word);  
                //    sb.Append(" ");  
                //}  
                this._text = sb.ToString();  
                //make Google request  
                string uri = BuildUri(this._language);  
                byte[] buffer = Encoding.UTF8.GetBytes(get_request(this._text));  
                WebClient webClient = new WebClient();  
                webClient.Headers.Add("Content-Type""text/xml");  
                byte[] response = webClient.UploadData(uri, "POST", buffer);  
                string resultXML = Encoding.UTF8.GetString(response);  
                this.parseResultXML(resultXML); //fill the suggestions dictionary  
            } 

    Seems to be working fine. Am I missing anything?

    Thanks.

    Roland
  5. Petio Petkov
    Admin
    Petio Petkov avatar
    825 posts

    Posted 13 May 2010 Link to this post

    Hi Roland,

    Everything in the code provided seems to be fine.
    My suggestion is to add try/catch for the code related to the Google SpellCheck service - if you cannot reach Google due to some reason(e.g. missing connectivity), use the already found mistaken words from the Telerik.Web.UI.SpellChecker.

    All the best,
    Petio Petkov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. Roland
    Roland avatar
    11 posts
    Member since:
    Mar 2007

    Posted 08 Nov 2010 Link to this post

    Hi Petio.

    Did the ISpellCheckProvider get removed from the recent releases?

    Thanks.

    Roland
  7. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 09 Nov 2010 Link to this post

    Hi Roland,

    No, it is not. You can see the ISpellCheckProvider is used in the following demo:

    Custom Google spellcheck provider.

    Best regards,
    Rumen
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. Roland
    Roland avatar
    11 posts
    Member since:
    Mar 2007

    Posted 09 Nov 2010 Link to this post

    Hi Rumen.

    Thanks for the reply. Just seemed odd that some functionality went down when I upgraded to Q1 2010 for spellcheck and treeview. Upgrading to Q2 2010 fixed a lot of issues.

    Thanks.

    Roland
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017