Word bank/tree
Posted: Wed Mar 09, 2011 11:56 am
is there any way to organize words.. (well i must call them tokens)
in a tree?
for example if i want to find a scene node wich as the name "scenenode1023" i have to iterate and check strings until i find the scene node with this name
Does exist any opensource (possibly zlib) implementation of a tree that allows to organize words and tokens for a linear and fast find?
for example check first character . "s"
actually the tree has only 20 words stored
15 of them start with the "s" character.
5 of them start with the "a" character.
then next characters are checked because all the words stored has the same characters
"ceneNode"
after that it looks for the number character "1" and it finds that there is only one word remaining so now it can stop search or just control the remaining characters "023" for reduce user errors.
after that the scene node is returned. (i think i must use template and dynamic_casting sometimes)
I think that every script language and compiler/parser have something similiar implemented. I want to do the same for my game
in a tree?
for example if i want to find a scene node wich as the name "scenenode1023" i have to iterate and check strings until i find the scene node with this name
Does exist any opensource (possibly zlib) implementation of a tree that allows to organize words and tokens for a linear and fast find?
for example check first character . "s"
actually the tree has only 20 words stored
15 of them start with the "s" character.
5 of them start with the "a" character.
then next characters are checked because all the words stored has the same characters
"ceneNode"
after that it looks for the number character "1" and it finds that there is only one word remaining so now it can stop search or just control the remaining characters "023" for reduce user errors.
after that the scene node is returned. (i think i must use template and dynamic_casting sometimes)
I think that every script language and compiler/parser have something similiar implemented. I want to do the same for my game