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.

40 lines
737 B

  1. #ifndef Bigram_H
  2. #define Bigram_H
  3. #include "List.h"
  4. typedef struct _Placement {
  5. union {
  6. IListItem link;
  7. struct _Placement *next;
  8. };
  9. int i;
  10. int j;
  11. } Placement;
  12. typedef List PlacementList;
  13. typedef struct _PlacementOptions {
  14. union {
  15. IListItem link;
  16. struct _PlacementOptions *next;
  17. };
  18. int value;
  19. Placement *places;
  20. } PlacementOptions;
  21. typedef List PlacementOptionsList;
  22. typedef struct {
  23. int prev;
  24. PlacementList list;
  25. } PlaceMap[65536];
  26. #define MALLOC(TYPE) (TYPE*)malloc(sizeof(TYPE))
  27. #define BIGRAM(p) ((uint)(((*b)&0xff)*256 + ((*(b+1))&0xff)))
  28. extern PlacementOptionsList *bigram_places(char *text,char *line);
  29. extern void PlacementOptionsList_free(PlacementOptionsList *list);
  30. #endif