Share via


IWordBreaker::Init Method

Initializes the IWordBreaker implementation and indicates the mode in which the component operates.

Syntax

HRESULT Init(      
    BOOL fQuery,
    ULONG ulMaxTokenSize,
    BOOL *pfLicense
);

Parameters

  • fQuery
    [in] Flag that indicates the mode in which a word breaker operates. TRUE indicates query-time word breaking. FALSE indicates index-time word breaking.
  • ulMaxTokenSize
    [in] Maximum number of characters in words that are added to the WordSink. Words that exceed this limit may be truncated.
  • pfLicense
    [out] Pointer to an output variable. The output variable receives a flag that indicates where there are license restrictions for this IWordBreaker implementation. TRUE indicates that the stemmer is restricted to authorized use only. FALSE indicates that this IWordBreaker implementation can be used freely.

Return Value

Returns one of the following values.

S_OK Successful completion.
LANGUAGE_E_DATABASE_NOT_FOUND One of the components for word breaking cannot be located.
E_INVALIDARG Invalid arguments. The pfLicense parameter is NULL.
E_FAIL Other errors.

Remarks

The functionality of the word breaker is similar in both index creation and querying. Differences are language dependent. If pfLicense is TRUE, and if you want more information about possible license restrictions, call the GetLicenseToUse method.

See Also

Implementing a Word Breaker, Language Resource Samples, Secure Code Practices