Title Back Colour Keyoti Title Line Title Curve
Blue Box Top

SetDictFileStream exception - RapidSpell WPF - Forum

Welcome Guest Search | Active Topics | Log In | Register

Options
Sybren
#1 Posted : Friday, August 24, 2018 10:08:33 AM
Rank: Newbie

Groups: Registered

Joined: 8/24/2018
Posts: 1
Location: Netherlands
We sometimes see an exception when setting the dictionary file stream:

Relevant callstack:

at Keyoti.RapidSpell.Wpf.RapidSpellChecker.f()
at Keyoti.RapidSpell.Wpf.RapidSpellChecker.e()
at Keyoti.RapidSpell.Wpf.RapidSpellChecker.SetDictFileStream(Stream dictFileStream, String dictionaryID, DateTime modifiedDate)

Code:

private static void PrepareSpellCheck(ICheckerEngine SpellCheck)
        {
            SpellCheck.LanguageParser = LanguageType.DUTCH;
            SpellCheck.CheckCompoundWords = true;

            var _dictStream = Application.GetResourceStream(new Uri("somevaliddictlocation")).Stream;
            SpellCheck.SetDictFileStream(_dictStream, "Words.dict", DateTime.Now);
        }


Note: the uri is a valid uri in our situation.
Note2: the Check method isn't called before this code

Are we setting the Stream in the wrong way?
I read that SetDictFileStream doesn't close stream, do we have to wrap it in an using block to solve this exception?
I'm wondering what's going wrong? What's the correct way to set the dict file stream?

Jim
#2 Posted : Friday, August 24, 2018 2:17:38 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
Hi, do you know that you don't need to manually load the stream and set it? Please see this https://keyoti.com/produ.../The%20Dictionaries.htm

You should be able to just set the DictFile property to the name of the .dict file (with extension) and it will find the resource for you.

Otherwise, if you still need to do it that way, can you let me know the exception type and message?

Thanks
Jim
-your feedback is helpful to other users, thank you!


Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.




About | Contact | Site Map | Privacy Policy

Copyright © 2002- Keyoti Inc.