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.

73 lines
2.1 KiB

  1. //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  2. //
  3. // Copyright (c) 2001 Microsoft Corporation. All rights reserved.
  4. //
  5. // Module:
  6. // volcano/dll/brknet.c
  7. //
  8. // Description:
  9. // Functions to implement the functionality of the break Neural net that
  10. // modifies the lattice structure to correct segmentation errors.
  11. //
  12. // Author:
  13. // ahmadab 11/05/01
  14. //
  15. //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  16. #include "common.h"
  17. #include "volcanop.h"
  18. #include "lattice.h"
  19. #include "runnet.h"
  20. #ifndef __BRKNET_H__
  21. #define __BRKNET_H__
  22. // maximum number of brk net features
  23. #define MAX_BRK_NET_FEAT 32
  24. // Magic key the identifies the NN bin file
  25. #define BRKNET_FILE_TYPE 0xFEFEABD0
  26. // Version information for file.
  27. #define BRKNET_MIN_FILE_VERSION 0 // First version of code that can read this file
  28. #define BRKNET_OLD_FILE_VERSION 0 // Oldest file version this code can read.
  29. #define BRKNET_CUR_FILE_VERSION 0 // Current version of code.
  30. // the threshold above which the output of the break net is regarded as a breaking point
  31. #define BREAKING_THRESHOLD (90 * SOFT_MAX_UNITY / 100)
  32. //#define BREAKING_THRESHOLD (SOFT_MAX_UNITY / 2)
  33. // local data structure used by the BRKNET
  34. // a lattice element list structure
  35. typedef struct tagELEMLIST
  36. {
  37. int cElem;
  38. LATTICE_PATH_ELEMENT *pElem;
  39. }
  40. ELEMLIST;
  41. // structure representing a break point
  42. typedef struct tagBRKPT
  43. {
  44. ELEMLIST Starting;
  45. ELEMLIST Ending;
  46. ELEMLIST Crossing;
  47. }
  48. BRKPT;
  49. // NN data block resource type
  50. int UpdateLattice (LATTICE *pLat);
  51. BOOL LoadBrkNetFromResource (HINSTANCE hInst, int nResID, int nType);
  52. BOOL LoadBrkNetFromFile(wchar_t *pwszRecogDir, LOAD_INFO *pLoadInfo);
  53. void BrkNetUnloadfile (LOAD_INFO *pLoadInfo);
  54. // private functions, prototyped here because the training program will use them
  55. BRKPT *CreateBrkPtList (LATTICE *pLat);
  56. int FeaturizeBrkPt (LATTICE *pLat, BRKPT *pBrk, int *pFeat);
  57. void FreeBreaks (int cStrk, BRKPT *pBrk);
  58. BOOL InsertListElement (ELEMLIST *pList, int iStrk, int iAlt, LATTICE_ELEMENT *pLatElem);
  59. void FreeElemList (ELEMLIST *pList);
  60. void ReverseElementList (ELEMLIST *pElemList);
  61. #endif