Hi,
I am trying to program a T9 clone for
the PocketPC.
It will work a little different than T9.
Instead of pointing to one of the nine buttons
you'll have to stroke in direction of the symbols(1..9). That way you don;t have to raise your pen.
I cant describe it, you'll have to see it.
It works great! I can allready type 25 words a minute. But i have a problem:
I have a rather strange tree in memory.
Each node consist of 9 pointer to other nodes and
a pointer to a list of char*s.
Imagine i have the word "KAI";
my tree traversal will be:
1 : curNode = StartNode;
2 : curNode = curNode.n5 (cause "K" is on the 5th key)
3 : curNode = curNode.n2 (cause "A" is on the 2nd key)
4 : curNode = curNode.n4 (cause "i" is on the 4nd key)
5 : curWord = curNode.word;
6 : repeat until curWord.next = nil
7 : addWordToUserInterFace(curWord.word);
Thus:
Node {
n1 *node;
n2 *node;
...
n9 *node;
words *word;
}
This all works great! When loaded the program
works as a charm.
But the problem:
I have a wordlist in ascii and i create in memory
the tree. But it takes almost 60 seconds to
build the tree (20000 words in dictionary)!
That's unacceptable ofcourse.
I know that it is possible to
flush this tree to disk. But i don;t know how:
I myself think that i have to inherit from
CObject, but i don;t know how.
Can someone help me?
Greetz,
Kaiton
<img src="http://web.icq.com/whitepages/page_me/1,,,00.html?to=163639225&from;=wendi&fromemail;=kai@mail.com&body;=dddsd" width="1" height="0">
I am trying to program a T9 clone for
the PocketPC.
It will work a little different than T9.
Instead of pointing to one of the nine buttons
you'll have to stroke in direction of the symbols(1..9). That way you don;t have to raise your pen.
I cant describe it, you'll have to see it.
It works great! I can allready type 25 words a minute. But i have a problem:
I have a rather strange tree in memory.
Each node consist of 9 pointer to other nodes and
a pointer to a list of char*s.
Imagine i have the word "KAI";
my tree traversal will be:
1 : curNode = StartNode;
2 : curNode = curNode.n5 (cause "K" is on the 5th key)
3 : curNode = curNode.n2 (cause "A" is on the 2nd key)
4 : curNode = curNode.n4 (cause "i" is on the 4nd key)
5 : curWord = curNode.word;
6 : repeat until curWord.next = nil
7 : addWordToUserInterFace(curWord.word);
Thus:
Node {
n1 *node;
n2 *node;
...
n9 *node;
words *word;
}
This all works great! When loaded the program
works as a charm.
But the problem:
I have a wordlist in ascii and i create in memory
the tree. But it takes almost 60 seconds to
build the tree (20000 words in dictionary)!
That's unacceptable ofcourse.
I know that it is possible to
flush this tree to disk. But i don;t know how:
I myself think that i have to inherit from
CObject, but i don;t know how.
Can someone help me?
Greetz,
Kaiton
<img src="http://web.icq.com/whitepages/page_me/1,,,00.html?to=163639225&from;=wendi&fromemail;=kai@mail.com&body;=dddsd" width="1" height="0">