SolarixGrammarEngineNET.GrammarEngine2.Load C# (CSharp) Method

Load() public method

Connect to the dictionary database using the information in XML configuration file
public Load ( string DictionaryXmlPath, bool LazyLexicon ) : void
DictionaryXmlPath string Configuration file path (read about it: http://www.solarix.ru/for_developers/docs/russian-grammatical-dictionary-configuration.shtml)
LazyLexicon bool Word entries are loaded by demand if true
return void
        public void Load( string DictionaryXmlPath, bool LazyLexicon )
        {
            GrammarEngine.EngineInstanceFlags flags = GrammarEngine.EngineInstanceFlags.SOL_GREN_DEFAULT;
               if( LazyLexicon ) flags = GrammarEngine.EngineInstanceFlags.SOL_GREN_LAZY_LEXICON;

               _hEngine = GrammarEngine.sol_CreateGrammarEngineW( "" );
               int rc = GrammarEngine.sol_LoadDictionaryExW( _hEngine, DictionaryXmlPath, flags );

               if( rc!=1 )
               {
            string msg = GrammarEngine.sol_GetErrorFX( _hEngine );
            throw new ApplicationException( string.Format( "Error has occured when connecting the dictionary database by {0}: {1}", DictionaryXmlPath, msg ) );
               }

               return;
        }

Usage Example

 public void LoadDictionary(string filepath)
 {
     gren = new SolarixGrammarEngineNET.GrammarEngine2();
     gren.Load(filepath, false);
     Init();
     return;
 }
All Usage Examples Of SolarixGrammarEngineNET.GrammarEngine2::Load