You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.
Hello,
I can see the code to create the tree but there isn't an example about how to use it to search for a string.
This is very important of course to measure performance.
Cheers.
The text was updated successfully, but these errors were encountered:
class TreeNode implements Serializable, Cloneable {
int index; // the index of String list
int start; // the start of index of that string
int end; // the end of index of that string
int suffix_index = -1; // the index in the string of suffix
}
We don't store substring in TreeNode for saving memory but we store the index of string. If we have a list of string like: List S. We can get substring which is stored in the TreeNode t by S.get(t.index).substring(t.start, t.end).
You can easily implement a search or endsWith method by the information on the TreeNode.
I had wrote a method "void traverseTree(List S, TreeNode root, Map<Character, String> terminatorFileName, Set result)" which only output the leaf node of the suffix tree.
Which search method do you need, e.g. contains substring, endsWith...?
Feel free to ask if you have any questions.
Yes makes sense, I am not that good with Java but I am assuming you will have to first deserialize from the file output to the TreeNode object, would like to see some example code for that.
Yes I would like to see starstwith, endswith and contains implemented as a method.
That would be great!
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello,
I can see the code to create the tree but there isn't an example about how to use it to search for a string.
This is very important of course to measure performance.
Cheers.
The text was updated successfully, but these errors were encountered: