Standalone API Usage

The Eduction Software Development Kit (SDK) C API allows C developers to interact directly with the Eduction engine.

At the core of the API is an eduction engine. The first call of the API in an application should create the engine. You must then set a valid license for the engine.

After you create it, you can optionally configure an engine to determine its matching behavior. You must load one or more resource files that contain the eduction grammars, and you must add one or more entities, from the loaded resource files, to match against.

Data processing is performed in an eduction session. You can create multiple sessions for each eduction engine. All sessions use the same loaded grammars and entities. Each session maintains its own state so that the sessions can run concurrently in a multithreaded application.

You can use the session to process multiple documents. You can pull (stream) or push (add) data. You call a function to get the next available match. You can call this function repeatedly to cycle through all the matches. For each match, you can access the associated text and properties by using several function calls.

You can keep a session alive for as long as necessary. However, you must destroy it before you destroy the engine that is associated with it. The call to destroy the engine should be the last call of this API in an application.

This section describes the skeletal structure of a stand-alone application using the API. See the source code in C API Examples. Typically, your application takes the following actions:

  1. Include edk.h.
  2. Instantiate the engine and obtain an engine handle.

    You can create the engine without a configuration, or you can call EdkEngineCreateFromConfigFile to create an engine from an appropriate configuration file. If you use EdkEngineCreateFromConfigFile, you can skip steps 3 and 4.

  3. Set the license key.
  4. Configure the engine to:

  5. Create a session associated with the engine, and obtain a session handle. You can create and run concurrent sessions in a multithreaded application. Each session uses the same grammars, but maintains its own state.
  6. Feed UTF-8 encoded text to the session.
  7. Call EdkGetNextMatch to obtain an entity match. You can call this method repeatedly to obtain all matches.

    NOTE:

    If you create your engine from a configuration file that includes post-processing tasks, the post-processing tasks automatically run as part of EdkGetNextMatch and you do not need to run them separately.

  8. If required, call EdkGetRedactedText to produce redacted output.
  9. For each match, get details and properties of the match.
  10. To process multiple documents, repeat Step 6 to Step 9.
  11. Release resources when done. You must destroy all session handles before destroying the engine handle.

_FT_HTML5_bannerTitle.htm