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.

82 lines
1.7 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1991 - 1992.
  5. //
  6. // File: stemmer.hxx
  7. //
  8. // Contents: Fareast Stemmers
  9. //
  10. // Classes: CStemmer
  11. //
  12. // History: 01-July-1996 PatHal Created
  13. //
  14. //----------------------------------------------------------------------------
  15. #ifndef __STEMMER_HXX__
  16. #define __STEMMER_HXX__
  17. //+---------------------------------------------------------------------------
  18. //
  19. // Class: CStemmer
  20. //
  21. // Purpose: Stem words into inflected forms, e.g. suru to shinakereba, shita, seyo, sureba, etc.
  22. //
  23. //----------------------------------------------------------------------------
  24. class CStemmer : public IStemmer {
  25. public:
  26. //
  27. // From IUnknown
  28. //
  29. virtual SCODE STDMETHODCALLTYPE
  30. QueryInterface( REFIID riid, void **ppvObject );
  31. virtual ULONG STDMETHODCALLTYPE
  32. AddRef();
  33. virtual ULONG STDMETHODCALLTYPE
  34. Release();
  35. //
  36. // From IStemmer
  37. //
  38. virtual SCODE STDMETHODCALLTYPE
  39. Init( ULONG ulMaxTokenSize, BOOL *pfLicense );
  40. virtual SCODE STDMETHODCALLTYPE
  41. GetLicenseToUse( const WCHAR **ppwcsLicense );
  42. virtual SCODE STDMETHODCALLTYPE
  43. StemWord( WCHAR const *pwcInBuf, ULONG cwc, IStemSink *pStemSink );
  44. //
  45. // Local methods
  46. //
  47. CStemmer( LCID lcid );
  48. private:
  49. ~CStemmer();
  50. BOOL
  51. FoldInputString(
  52. IN CONST WCHAR *pwc,
  53. IN DWORD cwc);
  54. static BOOL CALLBACK
  55. EnumStemOffsetsCallback (
  56. IN CONST DWORD *pichOffsets,
  57. IN CONST DWORD cOffsets,
  58. IN OUT LPARAM lpData);
  59. long _cRefs;
  60. ULONG _ulMaxTokenSize;
  61. };
  62. #endif // __STEMMER_HXX__