{"id":34269531,"url":"https://github.com/abahgat/suffixtree","last_synced_at":"2025-12-16T18:54:40.699Z","repository":{"id":56519379,"uuid":"3462887","full_name":"abahgat/suffixtree","owner":"abahgat","description":"A Java implementation of a Generalized Suffix Tree using Ukkonen's algorithm","archived":false,"fork":false,"pushed_at":"2020-11-02T21:14:17.000Z","size":53,"stargazers_count":112,"open_issues_count":1,"forks_count":60,"subscribers_count":7,"default_branch":"master","last_synced_at":"2023-11-07T19:24:39.297Z","etag":null,"topics":["gst","java","suffix-tree","tree","ukkonen"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abahgat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-02-16T19:05:48.000Z","updated_at":"2023-08-16T04:46:36.000Z","dependencies_parsed_at":"2022-08-15T20:11:02.020Z","dependency_job_id":null,"html_url":"https://github.com/abahgat/suffixtree","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/abahgat/suffixtree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abahgat%2Fsuffixtree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abahgat%2Fsuffixtree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abahgat%2Fsuffixtree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abahgat%2Fsuffixtree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abahgat","download_url":"https://codeload.github.com/abahgat/suffixtree/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abahgat%2Fsuffixtree/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27769735,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-16T02:00:10.477Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gst","java","suffix-tree","tree","ukkonen"],"created_at":"2025-12-16T18:54:40.094Z","updated_at":"2025-12-16T18:54:40.690Z","avatar_url":"https://github.com/abahgat.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Generalized Suffix Tree\n[![Build Status](https://travis-ci.org/abahgat/suffixtree.png?branch=master)](https://travis-ci.org/abahgat/suffixtree)\n\nA Generalized Suffix Tree, based on Ukkonen's paper \"On-line construction of suffix trees\"\nhttp://www.cs.helsinki.fi/u/ukkonen/SuffixT1withFigs.pdf\n\nAllows for fast storage and fast(er) retrieval by creating a tree-based index out of a set of strings.\nUnlike common suffix trees, which are generally used to build an index out of one (very) long string, a *Generalized Suffix Tree* can be used to build an index over many strings.\n\nIts main operations are `put` and `search`:\n\n* `put` adds the given key to the index, allowing for later retrieval of the given value.\n* `search` can be used to retrieve the set of all the values that were put in the index with keys that contain a given input.\n\nIn particular, after `put(K, V)`, `search(H)` will return a set containing `V` for any string `H` that is substring of `K`.\n\nThe overall complexity of the retrieval operation (`search`) is *O(m)* where *m* is the length of the string to search within the index.\n\n## Differences from the original suffix tree\n\nAlthough the implementation is based on the original design by Ukkonen, there are a few aspects where it differs significantly.\n\nThe tree is composed of a set of nodes and labeled edges. The labels on the edges can have any length as long as it's greater than 0.\nThe only constraint is that no two edges going out from the same node start with the same character.\n\nBecause of this, a given _(startNode, stringSuffix)_ pair can denote a unique path within the tree, and it is the path (if any) that can be composed by sequentially traversing all the edges _(e1, e2, …)_ starting from _startNode_ such that _(e1.label + e2.label + …)_ is equal to the _stringSuffix_.\nSee the `GeneralizedSuffixTree#search` method for details.\n\nThe union of all the edge labels from the root to a given leaf node denotes the set of the strings explicitly contained within the GST.\nIn addition to those Strings, there are a set of different strings that are implicitly contained within the GST, and it is composed of the strings built by concatenating _e1.label + e2.label + ... + $end_, where _e1, e2, …_ is a proper path and _$end_ is prefix of any of the labels of the edges starting from the last node of the path.\n\nThis kind of \"implicit path\" is important in the testAndSplit method.\n\n## License\n\nThis Generalized Suffix Tree is released under the Apache License 2.0\n\n   Copyright 2012 Alessandro Bahgat Shehata\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabahgat%2Fsuffixtree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabahgat%2Fsuffixtree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabahgat%2Fsuffixtree/lists"}