-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patharraydawg.h
executable file
·56 lines (44 loc) · 1.7 KB
/
arraydawg.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//
// arraydawg.h
// wwfmax
//
// Created by Bion Oren on 11/10/12.
// Copyright (c) 2012 Llama Software. All rights reserved.
//
#ifndef wwfmax_arraydawg_h
#define wwfmax_arraydawg_h
#include "tnode.h"
#define BIT_COUNT_FOR_CHILD_INDEX 17
// This program will create "5" binary-data files for use, and "1" text-data file for inspection.
#define TRADITIONAL_DAWG_DATA "Traditional_Dawg_For_Word-List.dat"
#define TRADITIONAL_DAWG_TEXT_DATA "Traditional_Dawg_Text_For_Word-List.txt"
#define DIRECT_GRAPH_DATA_PART_ONE "Part_One_Direct_Graph_For_Word-List.dat"
#define DIRECT_GRAPH_DATA_PART_TWO "Part_Two_Direct_Graph_For_Word-List.dat"
#define FINAL_NODES_DATA "Final_Nodes_For_Word-List.dat"
// Next and Child become indices.
struct arraydnode{
int Next;
int Child;
char Letter;
char EndOfWordFlag;
char Level;
};
typedef struct arraydnode ArrayDnode;
typedef ArrayDnode* ArrayDnodePtr;
struct arraydawg {
int NumberOfStrings;
ArrayDnodePtr DawgArray;
int First;
char MinStringLength;
char MaxStringLength;
};
typedef struct arraydawg ArrayDawg;
typedef ArrayDawg* ArrayDawgPtr;
void ConvertIntNodeToBinaryString(int TheNode, char *BinaryNode);
void ConvertChildListIntToBinaryString(int TheChildList, char *BinaryChildList);
void ConvertIntNodeToBinaryString(int TheNode, char *BinaryNode);
void ArrayDnodeInit(ArrayDnodePtr ThisArrayDnode, char Chap, int Nextt, int Childd, char EndingFlag, char Breadth);
void ArrayDnodeTnodeTranspose(ArrayDnodePtr ThisArrayDnode, TnodePtr ThisTnode);
int ArrayDnodeNumberOfChildrenPlusString(ArrayDnodePtr DoggieDog, int Index, char* FillThisString);
ArrayDawgPtr ArrayDawgInit(char **Dictionary, int *SegmentLenghts, int MaxStringLength);
#endif