|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkr.ac.kaist.swrc.jhannanum.plugin.MajorPlugin.MorphAnalyzer.ChartMorphAnalyzer.Simti
public class Simti
SIMTI(SIMple Trie Index) library.
Nested Class Summary | |
---|---|
class |
Simti.HEADI
The header for SIMTI structure. |
class |
Simti.ST_FREE
The structure for the free node list. |
class |
Simti.ST_NF
The node for SIMTI structure. |
class |
Simti.ST_NODE
Data node for SIMTI structure. |
Field Summary | |
---|---|
Simti.HEADI |
head
The head of SIMTI structure. |
Simti.ST_NF[] |
nf
The array of ST_NF which the actual data is stored in. |
int |
search_end
The end index for search_idx[]. |
int[] |
search_idx
The list of indices that have been found. |
char[] |
search_word
The word to search in the SIMTI structure. |
static int |
ST_MAX_WORD
The maximum length of a word. |
static int |
ST_NF_DEFAULT
The maximum number of the ST_NF nodes. |
Constructor Summary | |
---|---|
Simti()
Constructor. |
Method Summary | |
---|---|
int |
alloc(int size)
It allocates the available nodes and returns the first index of the list. |
int |
binary_search(int idx,
char size,
char key)
Performs binary search. |
int |
delete(char[] word)
Deletes the specified word in the SIMTI structure. |
int |
fetch(char[] word)
It searches the word in the SIMTI structure, and returns the information for the word. |
int |
firstkey(char[] word)
It finds a word by traversing the first key from the head until it founds a node with the information. |
int |
free(int idx,
int size)
Frees the nodes from the specified index. |
void |
init()
Initializes the SIMTI structure. |
int |
insert(char[] word,
int I)
Inserts the word to the SIMTI structure with the specified information. |
int |
kcomp(Simti.ST_NODE a,
Simti.ST_NODE b)
Compares the keys of the specified two nodes. |
int |
lookup(char[] word,
int[] I_buffer)
Searches the specified word in the SIMTI structure, and stores the information found. |
int |
nextkey(char[] word)
It finds a word by traversing the children, siblings, and parent of the last node of the previous search. |
private void |
node_copy(Simti.ST_NODE n1,
Simti.ST_NODE n2)
Copies a node. |
int |
replace(char[] word,
short I)
Replaces the information for the specified word. |
int |
search(char[] word)
Searches the specified word in the SIMTI structure. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ST_NF_DEFAULT
public static final int ST_MAX_WORD
public int search_end
public char[] search_word
public int[] search_idx
public Simti.HEADI head
public Simti.ST_NF[] nf
Constructor Detail |
---|
public Simti()
Method Detail |
---|
public int alloc(int size)
size
- - the number of nodes that should be allocated
public int fetch(char[] word)
word
- - search word
public int binary_search(int idx, char size, char key)
idx
- - index from the middle itemsize
- - size of the listkey
- - key to find
public int delete(char[] word)
word
- - word to delete
public int firstkey(char[] word)
word
- - the character array to store the word found
public int free(int idx, int size)
idx
- - the first index of the nodes to deletesize
- - the number of nodes to delete
public void init()
public int insert(char[] word, int I)
word
- - word to insertI
- - information to insert on the word
public int kcomp(Simti.ST_NODE a, Simti.ST_NODE b)
a
- - the first node to compareb
- - the second node to compare
public int lookup(char[] word, int[] I_buffer)
word
- - word to searchI_buffer
- - array to store the information found
public int nextkey(char[] word)
word
- - found word
private void node_copy(Simti.ST_NODE n1, Simti.ST_NODE n2)
n1
- - destination node to copyn2
- - source node to copypublic int replace(char[] word, short I)
word
- - the word to change its informationI
- - new information for the word
public int search(char[] word)
word
- - word to search
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |