IWordBreaker::BreakText method

[Indexing Service is no longer supported as of Windows XP and is unavailable for use as of Windows 8. Instead, use Windows Search for client side search and Microsoft Search Server Express for server side search.]

Parses text to identify words and phrases and provides the results to the WordSink and PhraseSink objects.

Syntax

HRESULT BreakText(
  [in] TEXT_SOURCE *pTextSource,
  [in] IWordSink   *pWordSink,
  [in] IPhraseSink *pPhraseSink
);

Parameters

  • pTextSource [in]
    A pointer to a TEXT_SOURCE structure that contains Unicode text.

  • pWordSink [in]
    A pointer to the WordSink object that receives and handles words generated by this method. NULL indicates that this method identifies phrases only.

  • pPhraseSink [in]
    A pointer to the PhraseSink object that receives and handles phrases generated by this method. NULL indicates that this method identifies individual words, not phrases.

Return value

This method can return one of these values.

Return code Description
S_OK

The operation was completed successfully. No more text is available to refill the buffer, pTextSource.

E_INVALIDARG

The pTextSource parameter is NULL.

 

Remarks

This method should be optimized for pPhraseSink = 0 because word breakers more commonly parse for individual words than phrases. Either pWordSink or pPhraseSink may be NULL, but not both.

Use pfnFillTextBuffer, the function pointer element in the TEXT_SOURCE structure, to replenish the source text. The BreakText method must handle all pfnFillTextBuffer return values. If an error occurs, finish processing the text in the buffer before handling the error.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

End of client support

Windows 7

End of server support

Windows Server 2008 R2

Header

Indexsrv.h

See also

IWordBreaker