Using OpenOffice spell provider in RadSpell

Thread is closed for posting
17 posts, 0 answers
  1. 63F75A2C-1F16-4AED-AFE8-B1BBD57646AD
    63F75A2C-1F16-4AED-AFE8-B1BBD57646AD avatar
    1572 posts
    Member since:
    Oct 2004

    Posted 11 Nov 2010 Link to this post

    Requirements

    RadControls version

    RadControls for ASP.NET AJAX
    Telerik.Web.UI, Q3 2010+
    .NET version

    as required by RadSpell
    Visual Studio version

    n/a
    programming language n/a
    browser support

    all browsers supported by RadControls


    PROJECT DESCRIPTION
    Starting from Q3 2010, we provide support for NHunspell and OpenOffice dictionaries for RadSpell. Here are the steps to enable this new feature:
    1. Download NHunSpell - http://nhunspell.sourceforge.net/
    2. Put the NHunSpell binaries in web application’s ~/bin folder (Hunspellx64.dll, Hunspellx86.dll, NHunspell.dll)
    3. Download OpenOffice dictionary for your language - http://extensions.services.openoffice.org/en/dictionaries  e.g. English (US)
    4. Rename dictionary file from .oxt to .zip – e.g. en_US.oxt to en_US.zip
    5. Open this zip archive and extract the .aff and .dic files to the RadSpell dictionary folder – e.g. en_US.aff and en_US.dic to ~/App_Data/RadSpell/
    6. Put the attached NHunSpell provider (NHunSpellCheckProvider.cs) in the App_Code folder
    7. Set the SpellCheckProviderTypeName property of the RadSpell control to "Telerik.Web.UI.NHunSpellCheckProvider, App_Code", e.g.

      You can also find attached a sample working example below.
  2. 639413A2-F9F4-4035-980F-16BC669BC398
    639413A2-F9F4-4035-980F-16BC669BC398 avatar
    5 posts
    Member since:
    Sep 2012

    Posted 11 Mar 2011 Link to this post

    I've used this demo and seems working fine. The only trouble is I am not able to add word to custom dictionary. I've 'en-US-custom.txt' file under ~/App_Data/RadSpell folder. I also tried explicitly setting the value for DictionaryPath and CustomDictionarySuffix properties like below:

    <telerik:RadSpell ID="RadSpell1" runat="server" 
    ControlsToCheck="TextBox1" DictionaryPath="~/App_Data/RadSpell/" CustomDictionarySuffix="-custom"
    SpellCheckProviderTypeName="Telerik.Web.UI.NHunSpellCheckProvider, App_Code" />
    <asp:TextBox ID="TextBox1" runat="server" Width="200">samplle misstaken kontent</asp:TextBox> while adding custom word i am getting Server Error:500 "No dictionary loaded.Set the
    DictionaryPath property from the spell checker settings or copy the dictionaries to ~/App_Data/RadSpell/"
    
    Will you please suggest what should be done to resolve this? 
    
    P.S i've used same project which was given for demo.

  3. DF60784D-55A5-4263-9F10-A12FA48C9ADC
    DF60784D-55A5-4263-9F10-A12FA48C9ADC avatar
    14477 posts
    Member since:
    Apr 2022

    Posted 16 Mar 2011 Link to this post

    Hello Tarang,

    For the time being RadSpell does not offer support for saving custom words when the NHunSpellCheckProvider is used. That is why my suggestion is to remove the Add Custom Words button by setting AllowAddCustom="false" in the RadSpell's declaration.

    Best regards,
    Rumen
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  4. 0D8F305F-6B00-4FDA-BD6D-B7B8C2F51217
    0D8F305F-6B00-4FDA-BD6D-B7B8C2F51217 avatar
    485 posts
    Member since:
    Oct 2008

    Posted 16 Mar 2011 Link to this post

    Any timeframe when this might be available?  Is this something that will be available in the next release, of your product, or in the near future?  I have a requirement to have a custom addition of items to the dictionary, and I would like to use NHunspell if possible.

    Is there a way to modify the given spell check provider to add this ourselves even?  That's an option too.

    Thanks.
  5. DF60784D-55A5-4263-9F10-A12FA48C9ADC
    DF60784D-55A5-4263-9F10-A12FA48C9ADC avatar
    14477 posts
    Member since:
    Apr 2022

    Posted 21 Mar 2011 Link to this post

    Hi Brian,

    I could not provide a firm estimate when this feature request will be implemented, because it is requested so far only by you and its priority is not high. If more users request this useful feature, we will increase its priority.
    You can  find the feedback item here: http://feedback.telerik.com/Project/108/Feedback/Details/119174-add-ability-to-add-word-to-custom-dictionary-when-using-openoffice-spell-provider.
     
    Best regards,
    Rumen
    the Telerik team
  6. 3C21D7AC-FCE0-4CC2-8BF3-52BE9C56A8D5
    3C21D7AC-FCE0-4CC2-8BF3-52BE9C56A8D5 avatar
    2150 posts
    Member since:
    Oct 2016

    Posted 20 Apr 2011 Link to this post

    Hi,

    A quick workaround to get the add custom words functionality working with the NHunSpell provider is to just put the original RadSpell dictionary in the ~/App_Data/RadSpell/ folder next to the OpenOffice dictionaries. For example, for English (en-US), put the en-US.tdf file and not only the en_US.aff and en_US.dic files. This will fix the custom words and the spell checker will create a custom dictionary called en-US-Custom.txt.

    Best wishes,
    Lini
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  7. 8ECEF1B9-387B-4A1A-A114-9211AB52A9D7
    8ECEF1B9-387B-4A1A-A114-9211AB52A9D7 avatar
    5 posts
    Member since:
    Jun 2012

    Posted 24 Jan 2013 Link to this post

    I have set up open office NHunspell as described above. I downloaded a medical dictionary .aff and .dic files (en_US_OpenMedSpel) and included them in the App_Data/RadSpell dictionary along with the en_US.aff and en_US.dic files. When I test the spell check with a word found in the medical dictionary, but not in the en_US dictionary, it fails to find the word. 
    "<telerik:RadSpell ID="RadSpell1" runat="server" ButtonType="LinkButton"
           ControlToCheck="txtObjectiveText"
           SupportedLanguages="en-US,English,en_US_OpenMedSpel"  
           AllowAddCustom="false"
           SpellCheckProviderTypeName="Telerik.Web.UI.NHunSpellCheckProvider, App_Code" />
    I tried including "en_US_OpenMedSpel" under hte supportedLanguages. That did not work either. Regular spell check is working fine.
    Did I miss something on the setup. How do I use multiple languages for a single text box.  I tried to just use the medical dictionary and that failded. It was still looking for english.  Any assistance would be appreciated.



  8. DF60784D-55A5-4263-9F10-A12FA48C9ADC
    DF60784D-55A5-4263-9F10-A12FA48C9ADC avatar
    14477 posts
    Member since:
    Apr 2022

    Posted 24 Jan 2013 Link to this post

    Hello,

    Could you, please, provide a download link to the medical dictionary that you try to use with the NHunspell and RadSpell?

    Greetings,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  9. 8ECEF1B9-387B-4A1A-A114-9211AB52A9D7
    8ECEF1B9-387B-4A1A-A114-9211AB52A9D7 avatar
    5 posts
    Member since:
    Jun 2012
  10. DF60784D-55A5-4263-9F10-A12FA48C9ADC
    DF60784D-55A5-4263-9F10-A12FA48C9ADC avatar
    14477 posts
    Member since:
    Apr 2022

    Posted 25 Jan 2013 Link to this post

    Hi,

    The provided en-us-openmedspel.oxt dictionary has an extensions which is not supported by the  NHunSpellCheckProvider.cs provider of RadSpell. If you open the NHunSpellCheckProvider.cs file you will see that the provider can read and work with .aff and .dic extensions only, e.g.

    _spell.Load(path + ".aff", path + ".dic");

    Greetings,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  11. 8ECEF1B9-387B-4A1A-A114-9211AB52A9D7
    8ECEF1B9-387B-4A1A-A114-9211AB52A9D7 avatar
    5 posts
    Member since:
    Jun 2012

    Posted 25 Jan 2013 Link to this post

    The files I downloaded from the link provied are en_US_OpenMedSpel.aff and en_US_OpenMedSpel.dic. That seems like it should work.
  12. DF60784D-55A5-4263-9F10-A12FA48C9ADC
    DF60784D-55A5-4263-9F10-A12FA48C9ADC avatar
    14477 posts
    Member since:
    Apr 2022

    Posted 25 Jan 2013 Link to this post

    Hello,

    Thank you for the additional information. I was able to extract the en_US_OpenMedSpel.aff and en_US_OpenMedSpel.dic from the en-us-openmedspel.oxt archive using WinRar.

    After that I put these files in the \App_Data\RadSpell\ folder and set the DictionaryLanguage property of RadSpell to en_US_OpenMedSpel. The final steps was to replace private string _language = "en-US"; with private string _language = "en_US_OpenMedSpel"; in the \App_Code\NHunSpellCheckProvider.cs provider file.

    For your convenience I have attached the modified project.

    Kind regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  13. 8ECEF1B9-387B-4A1A-A114-9211AB52A9D7
    8ECEF1B9-387B-4A1A-A114-9211AB52A9D7 avatar
    5 posts
    Member since:
    Jun 2012

    Posted 25 Jan 2013 Link to this post

    Thanks. That works well for the medical terms.  Is it possible to use more than one dictionary for a single RadSpell control?  What is happening is the common words are being caught by the medical dictionary and the suggestions are all medical terms instead of common words. For example: for the misspelled word "samplle" it suggests "symplex". "Samplink"..., but not "sample".  I tried just adding the medical terms to the end of the list of word in the en_US.dic file and that worked, but was looking for a more elegant solution. I would like to update the medical dictionary periodically as new versions are released.

     

  14. DF60784D-55A5-4263-9F10-A12FA48C9ADC
    DF60784D-55A5-4263-9F10-A12FA48C9ADC avatar
    14477 posts
    Member since:
    Apr 2022

    Posted 28 Jan 2013 Link to this post

    Hello,

    It is possible to add custom words to the TDF dictionaries of RadSpell as well as add custom words when using the built-in EditDistance and Phonetic dictionary providers.

    The NHunSpellCheckProvider provider offers the ability to only read a single OpenOffice dictionary at a time. If you are able to copy the words from the English Open Office dictionary to the medical one and this works, you can use this approach.


    Best regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  15. 9E8AFFEB-C99A-4471-9FC3-1291363C74A4
    9E8AFFEB-C99A-4471-9FC3-1291363C74A4 avatar
    19 posts
    Member since:
    May 2010

    Posted 26 Sep 2013 Link to this post

    Is this feature supported in Silverlight? Can you help me how to do the same?
  16. CBE705B6-10C0-4BE4-B42B-B49B5A2D00DC
    CBE705B6-10C0-4BE4-B42B-B49B5A2D00DC avatar
    3 posts
    Member since:
    Jun 2012

    Posted 20 Jul 2014 in reply to DF60784D-55A5-4263-9F10-A12FA48C9ADC Link to this post

    Has there been any update on this (allowing custom words to be added when using hunspell)?

    The PITS link is no longer available and it is something that would be of great benefit.

    Thanks
    -R
  17. A1CE16C4-4C2E-464E-BF18-532525D276CA
    A1CE16C4-4C2E-464E-BF18-532525D276CA avatar
    5948 posts
    Member since:
    Apr 2022

    Posted 21 Jul 2014 Link to this post

    Hello Roger,

    I have fixed the link and you can find the page in our feedback portal here: http://www.telerik.com/support/code-library/using-openoffice-spell-provider-in-radspell. I am afraid that such a feature is not implemented yet in the control and we do not have immediate plans for this request. For the time being, the workaround described there is the only option.

    Regards,

    Marin Bratanov
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top

This Code Library is part of the product documentation and subject to the respective product license agreement.