ImageGear for C and C++ on Windows v19.10 - Updated
IG_REC_UD_save
API Reference Guide > Recognition Component API Reference > Recognition Component Functions Reference > User Dictionary Functions > IG_REC_UD_save

Is used to save the User dictionary to a file.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_REC_UD_save(
   LPCSTR pFilename
);

Arguments:

Name Type Description
pFilename LPCSTR Pointer to the name of the User dictionary file. If it is NULL, the current dictionary name will be used as set by a previous call to the IG_REC_UD_set function.

Return Value:

Returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

This function does not process image pixels.

Example:

 
Copy Code
AT_ERRCOUNT ErrCount = 0;
ErrCount += IG_REC_UD_set("NEW_USER.DICT", "Section_A");
ErrCount += IG_REC_UD_edit_open();

ErrCount += IG_REC_UD_item_add("Section_B", L"[A-Z]", IG_REC_UD_ITEM_ATTR_REGULAR_EXPRESSION);
ErrCount += IG_REC_UD_item_delete("Section_B", L"[A-Z]", IG_REC_UD_ITEM_ATTR_REGULAR_EXPRESSION);

ErrCount += IG_REC_UD_save("NEW_USER2.DICT");
ErrCount += IG_REC_UD_edit_close();

Remarks:

  1. If the current dictionary was created by the IG_REC_UD_set function called with parameter NULL, the pFilename parameter should specify a real filename, otherwise this function returns with IGE_REC_EXTENDED_ERROR/IGE_REC_EXT_SPL_FOPEN_ERR.
  2. Saving the User dictionary under a different file name does not specify the User dictionary setting automatically. For this a separate IG_REC_UD_set call is necessary.