Grammatical dictionary instance initialization

int sol_CreateGrammarEngineW( const wchar_t * Filename )

int sol_CreateGrammarEngineA( const char * Filename )

int sol_CreateGrammarEngine8( const char * FilenameUtf8 )

Parameters:

Filename - XML dictionary information file, typically the dictionary.xml. This file is created by dictionary compiler. It contains the relative paths of dictionary database files.

Return value:

Handle of the instance of grammatical dictionary. This handle is used by almost all other API functions.

Remarks

Each of these functions does the following. It creates the empty instance of grammatical dictionary. After that it connects the instance with disk database files.

Functions differ in file path encoding. Function with W suffix accepts the wide character. Function with A suffix accepts the 1-byte characters and applies current locale settings. Function with 8 suffix accepts utf-8 string, making it most suitable for Linux.

If Filename is NULL of empty string then instance is not connected to the dictionary database. You can connect the instance to the database by use of sol_LoadDictionary.

Grammatical dictionary database is loaded in memory. Loading can take several seconds depending on the lexicon and thesaurus size. ORM library is another way to wortk with grammatical dictionary. The dictionary database connection using the DAL does not require any data to be loaded from server to memory.

There is a limitation on dictionary location under MS Windows: the engine can not load the database from network shared resources.

Dictionary instance is a result of sol_CreateGrammarEngine or sol_LoadDictionary call.

Dictionary database files can be locked by the engine until the dictionary is dropped (removed from memory).

The dictionary can be unloaded by sol_UnloadDictionary.

C++ sample code:

#include "solarix_grammar_engine.h"

...

HGREN hEngine = sol_CreateGrammarEngine(L"..\\..\\bin-windows\\dictionary.xml");

// ...

C# sample code:

IntPtr gren = SolarixGrammarEngineNET.GrammarEngine.sol_CreateGrammarEngineW("dictionary.xml");
// ...

Navigation

Purchase the Grammatical Dictionary SDK

Back to API functions list

API layer C++ source code: grammar_engine_api.cpp

Russian version of this page

  © Козиев Илья 2019
last change 04-Apr-11