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.

72 lines
1.5 KiB

  1. // Resolution of segmentation disputes using multiple segmentations from Bear and Inferno
  2. // Ahmad abdulKader: ahmadab
  3. // March 2001
  4. #ifndef __MULTISEGM_H__
  5. #define __MULTISEGM_H__
  6. #include <common.h>
  7. #include <limits.h>
  8. #include <string.h>
  9. #include "hwr_sys.h"
  10. #include "pegrec.h"
  11. #include "peg_util.h"
  12. #include "xrwdict.h"
  13. #include "xrword.h"
  14. #include "xrlv.h"
  15. #include "ws.h"
  16. #include "wordbrk.h"
  17. // language specific segmentation constants
  18. #include "segconst.h"
  19. #define WORST_INFERNO 0x100000 // worst inferno score (the worst cost of 256 segments)
  20. #define BEST_SEGMENTATION_SCORE 0xFFFF
  21. #define WORST_SEGMENTATION_SCORE 0
  22. // macro to return the wor_map last stroke
  23. #define WORD_LAST_STROKE(pWordMap) (pWordMap->cStroke > 0 ? pWordMap->piStroke[pWordMap->cStroke - 1] : -1)
  24. // a structure descibing an alignment point of seg_sets
  25. typedef struct tagANCHOR
  26. {
  27. int cByte;
  28. BYTE *pBits;
  29. int cAlign;
  30. int cStrk;
  31. }
  32. ANCHOR;
  33. // a structure describing instances of seg_sets whose segmentations contains
  34. // a certain number of words
  35. typedef struct tagSEG_TUPLE
  36. {
  37. int cSeg; // # of segmentations in the tuple
  38. unsigned char aWrd[MAX_SEG]; // array of segmentation word counts
  39. }
  40. SEG_TUPLE;
  41. #ifdef __cplusplus
  42. extern "C"
  43. {
  44. #endif
  45. extern SEG_TUPLE g_aSpecialTuples[];
  46. #ifdef __cplusplus
  47. }
  48. #endif
  49. WORDINFO *ResolveMultiWordBreaks ( XRC *pxrc,
  50. BEARXRC *pxrcBear,
  51. int *pcWord,
  52. LINE_SEGMENTATION **ppLineSegm
  53. );
  54. BOOL ComputeFinalAltLists (XRC *pxrc);
  55. #endif // __MULTISEGM_H__