Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
2.2 KiB

  1. // ITSTEM.H: (from Tripoli) IStemmer, IStemSink
  2. // (from InfoTech) IStemmerConfig
  3. // (from Tripoli and InfoTech) Supporting definitions.
  4. #ifndef __ITSTEM_H__
  5. #define __ITSTEM_H__
  6. #include <comdef.h>
  7. #ifndef __IStemSink_FWD_DEFINED__
  8. #define __IStemSink_FWD_DEFINED__
  9. typedef interface IStemSink IStemSink;
  10. #endif /* __IStemSink_FWD_DEFINED__ */
  11. #ifndef __IStemmer_FWD_DEFINED__
  12. #define __IStemmer_FWD_DEFINED__
  13. typedef interface IStemmer IStemmer;
  14. #endif /* __IStemmer_FWD_DEFINED__ */
  15. #ifndef __IStemmerConfig_FWD_DEFINED__
  16. #define __IStemmerConfig_FWD_DEFINED__
  17. typedef interface IStemmerConfig IStemmerConfig;
  18. #endif /* __IStemmerConfig_FWD_DEFINED__ */
  19. DECLARE_INTERFACE_(IStemmer, IUnknown)
  20. {
  21. STDMETHOD(Init)(ULONG ulMaxTokenSize, BOOL *pfLicense) PURE;
  22. STDMETHOD(GetLicenseToUse)(WCHAR const **ppwcsLicense) PURE;
  23. STDMETHOD(StemWord)(WCHAR const *pwcInBuf, ULONG cwc,
  24. IStemSink *pStemSink) PURE;
  25. };
  26. typedef IStemmer *PISTEM;
  27. DECLARE_INTERFACE_(IStemSink, IUnknown)
  28. {
  29. STDMETHOD(PutAltWord)(WCHAR const *pwcInBuf, ULONG cwc) PURE;
  30. STDMETHOD(PutWord)(WCHAR const *pwcInBuf, ULONG cwc) PURE;
  31. };
  32. typedef IStemSink *PISTEMSNK;
  33. DECLARE_INTERFACE_(IStemmerConfig, IUnknown)
  34. {
  35. // Sets/gets locale info that will affect the stemming
  36. // behavior of IStemmer::StemWord.
  37. // Returns S_OK if locale described by params is supported
  38. // by the breaker object; E_INVALIDARG otherwise.
  39. STDMETHOD(SetLocaleInfo)(DWORD dwCodePageID, LCID lcid) PURE;
  40. STDMETHOD(GetLocaleInfo)(DWORD *pdwCodePageID, LCID *plcid) PURE;
  41. // Sets/gets info that controls certain aspects of stemming.
  42. // This method currently accepts only the following set of flags
  43. // in grfStemFlags:
  44. // In the future, additional information may be passed in through
  45. // dwReserved.
  46. STDMETHOD(SetControlInfo)(DWORD grfStemFlags, DWORD dwReserved) PURE;
  47. STDMETHOD(GetControlInfo)(DWORD *pgrfStemFlags, DWORD *pdwReserved) PURE;
  48. // Will load external stemmer data, such as word part lists, etc.
  49. // The format of the data in the stream is entirely
  50. // implementation-specific.
  51. STDMETHOD(LoadExternalStemmerData)(IStream *pStream,
  52. DWORD dwExtDataType) PURE;
  53. };
  54. typedef IStemmerConfig *PISTEMC;
  55. #endif // __ITSTEM_H__