Suggestion in Spell checker from swedesh is not working

I have configured a spell checker from .net core.it is working for US English both spell checking and suggestions but for Swedish spell check function is working but suggestions are not working. here I want to configure a spell checker for both US English and Swedish so I want to know is there any issue with the Swedish version of the Humspell dictionary. if there is any working code sample please send me !!!.

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

======controller==========

public string SpellCheck([FromBody] SpellCheckJsonData spellChecker)

        {


            try

            {

                // SpellCheckDictionary ss = new SpellCheckDictionary(spellDictionary[0]);

                List<SpellCheckDictionary> ss = new List<SpellCheckDictionary>();

                foreach (var spell in spellDictionary)

                {

                    if(spell.LanguadeID == spellChecker.LanguageID)

                    {

                        ss.Add(new SpellCheckDictionary(spell));

                    }


                }

                SpellChecker spellCheck = new SpellChecker(ss);

                spellCheck.GetSuggestions(spellChecker.LanguageID, spellChecker.TexttoCheck, spellChecker.CheckSpelling, spellChecker.CheckSuggestion, spellChecker.AddWord);

                return Newtonsoft.Json.JsonConvert.SerializeObject(spellCheck);

            }

            catch(Exception e)

            {

                return "{\"SpellCollection\":[],\"HasSpellingError\":false,\"Suggestions\":null}";

            }

        }


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

startup

public Startup(IConfiguration configuration, IWebHostEnvironment env)

        {

            var builder = new ConfigurationBuilder()

                 .SetBasePath(env.ContentRootPath)

                 .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)

                 .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)

                 .AddEnvironmentVariables();


            Configuration = builder.Build();

            _contentRootPath = env.ContentRootPath;


            path = "";

            string jsonFileName = "spellcheck.json";

            //check the spell check dictionary path environment variable value and assign default data folder

            //if it is null.

            path = string.IsNullOrEmpty(path) ? Path.Combine(env.ContentRootPath, "App_Data") : Path.Combine(env.ContentRootPath, path);

            //Set the default spellcheck.json file if the json filename is empty.

        jsonFileName = string.IsNullOrEmpty(jsonFileName) ? Path.Combine(path, "spellcheck.json") : Path.Combine(path, jsonFileName);

            if (System.IO.File.Exists(jsonFileName))

            {

                string jsonImport = System.IO.File.ReadAllText(jsonFileName);

                List<DictionaryData> spellChecks = JsonConvert.DeserializeObject<List<DictionaryData>>(jsonImport);

                spellDictCollection = new List<DictionaryData>();

                //construct the dictionary file path using customer provided path and dictionary name

                foreach (var spellCheck in spellChecks)

                {

                    spellDictCollection.Add(new DictionaryData(spellCheck.LanguadeID,

                        Path.Combine(path, spellCheck.DictionaryPath), Path.Combine(path, spellCheck.AffixPath),

                        Path.Combine(path, spellCheck.PersonalDictPath)));


                    personalDictPath = Path.Combine(path, spellCheck.PersonalDictPath);

                }

            }

        }


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

spellcheck.json



  {

    "LanguadeID": 1033,

    "DictionaryPath": "en_US.dic",

    "AffixPath": "en_US.aff",

    "PersonalDictPath": "customDict.dic"

  },

  {

    "LanguadeID": 1053,

    "DictionaryPath": "sv.dic",

    "AffixPath": "sv.aff",

    "PersonalDictPath": "customDict.dic"

  }

]



6 Replies

AE Ajithamarlin Edward Syncfusion Team March 8, 2022 10:39 PM UTC

Hi Tharindu,


We will check and update further details by March 9,2022.


Regards,

Ajithamarlin E



AE Ajithamarlin Edward Syncfusion Team March 11, 2022 09:00 AM UTC

Hi Tharindu,


Sorry for the delay.


We will share the sample by March 11, 2022.


Regards,

Ajithamarlin E



AE Ajithamarlin Edward Syncfusion Team March 14, 2022 07:48 AM UTC

Hi Tharindu,


Sorry for the delay.


Currently we are working on creating a working sample. We will share the working sample by March 14,2022 without any delay.


Regards,

Ajithamarlin E



AE Ajithamarlin Edward Syncfusion Team March 21, 2022 08:58 AM UTC

Hi Tharindu,


Sorry for the delay.


Currently we are working on creating a working sample , we are facing some difficulties. We will share the working sample by March 21,2022 without any delay.


Regards,

Ajithamarlin E



AE Ajithamarlin Edward Syncfusion Team March 23, 2022 07:59 PM UTC

Hi Tharindu,


We can able to reproduce the reported issue. Currently, we are validating the issue and get back to you with more details by March 25,2022.


Regards,

Ajithamarlin E



AE Ajithamarlin Edward Syncfusion Team March 25, 2022 05:29 PM UTC

Hi Tharindu,


Thanks for your patience. 


The suggestion construction depends on the dictionary and affix file used. Recently the dictionary files were updated similarly we have to update the parsing logic in the spell checker assembly as well.


We have logged the feature request for this. We understand how this feature could be of value to you. But, due to other priority works, we are unable to implement this feature immediately. At present, it is not possible to provide revised timeline about this feature implementation. 

 
However, based on your interest in this feature, we will add priority to this feature request and consider implementing it sooner. Once we have a definite plan about this feature implementation, we will move the feedback to scheduled status with tentative release timeline.


You can track the status through below feedback link:  

https://www.syncfusion.com/feedback/22265/improve-suggestion-creation-logic  


Regards,

Ajithamarlin E


Loader.
Up arrow icon