#ifndef __TUI_MNEMONIC_H__
#define __TUI_MNEMONIC_H__

#include "stdint.h"
#ifndef NULL
#define NULL ((void*)0)
#endif

#define ALPHABET_SIZE					26
#define MNEMONIC_LIST_TOTAL_SIZE		2048
#define MNEMONIC_LIST_NODE_SIZE			1350 //TreeSize - 2: 226, 3: 1322
#define MNEMONIC_WORD_MAX_SIZE			8
#define MNEMONIC_WORD_TREE_SIZE			2
#define MNEMONIC_RECOMMEND_COUNT		3

typedef struct TREENODE {
	uint8_t data;
	int32_t mnemonicIndex;
	struct TREENODE *childNode[ALPHABET_SIZE];
} TreeNode;

uint32_t createMnemonicTree();
TreeNode* getNewNode(uint8_t data);
uint32_t insertNode(uint8_t* key, uint32_t mnemonicIndex);
int32_t getMnemonicIndex(uint8_t* key);
uint32_t getRecommendWordList(uint8_t* key, uint8_t* recommendList[]);
int mnemonicCheck(const uint8_t *mnemonic);

#endif