{"id":21072668,"url":"https://github.com/whiredplanck/darts-clone-rs","last_synced_at":"2026-01-31T10:32:50.559Z","repository":{"id":227987787,"uuid":"772871112","full_name":"WhiredPlanck/darts-clone-rs","owner":"WhiredPlanck","description":"A Rust binding of s-yata/darts-clone","archived":false,"fork":false,"pushed_at":"2025-12-12T02:52:12.000Z","size":50,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-13T09:50:18.568Z","etag":null,"topics":["binding","bindings","double-array-trie","rust","trie"],"latest_commit_sha":null,"homepage":"https://docs.rs/darts-clone-rs","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WhiredPlanck.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-16T05:24:38.000Z","updated_at":"2025-12-12T02:51:41.000Z","dependencies_parsed_at":"2024-11-19T18:58:44.673Z","dependency_job_id":"9bb9f78e-472d-4850-aa6b-b996cf22f63f","html_url":"https://github.com/WhiredPlanck/darts-clone-rs","commit_stats":null,"previous_names":["whiredplanck/darts-clone-rs"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/WhiredPlanck/darts-clone-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhiredPlanck%2Fdarts-clone-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhiredPlanck%2Fdarts-clone-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhiredPlanck%2Fdarts-clone-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhiredPlanck%2Fdarts-clone-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WhiredPlanck","download_url":"https://codeload.github.com/WhiredPlanck/darts-clone-rs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhiredPlanck%2Fdarts-clone-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28938590,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T10:18:23.202Z","status":"ssl_error","status_checked_at":"2026-01-31T10:18:22.693Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["binding","bindings","double-array-trie","rust","trie"],"created_at":"2024-11-19T18:58:36.497Z","updated_at":"2026-01-31T10:32:50.546Z","avatar_url":"https://github.com/WhiredPlanck.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# darts-clone-rs\n\nRust binding of [Darts-clone](https://github.com/s-yata/darts-clone) - a clone of Darts (Double-ARray Trie System)\n\n## Installation\n\n```toml\n[dependencies]\ndarts-clone-rs = \"0.2\"\n```\n\n## Example\n\n### Build trie\n\n```rust\nuse darts::DartsArrayTrie;\n\nlet dic = DartsArrayTrie::new();\nlet keys: Vec\u003cString\u003e = todo!() // get keys somehow\nlet values: Vec\u003cusize\u003e = todo!() // get values somehow\nlet lengths: Vec\u003ci32\u003e = todo!() // get lengths somehow\n\nlet result = dic.build(keys.len, \u0026keys, None /* Some(\u0026values) */, None /* Some(\u0026lengths) */, None);\nassert_eq!(Ok(()), result);\n```\n\n### Save and open\n\n```rust\nuse darts::DartsArrayTrie;\n\nlet dic = DartsArrayTrie::new();\n// build ...\nlet dic_copy = DartsArrayTrie::new();\nassert_eq!(Ok(), dic.save(\"path/to/dict\", \"wb\", 0));\nassert_eq!(Ok(), dic_copy.open(\"path/to/dict\", \"rb\", 0, 0));\n```\n\n### Search\n\n#### Exact match search\n```rust\nuse darts::DartsArrayTrie;\n\nlet dic = DartArrayTrie::new();\n// build ...\nlet value = dic.extra_match_search(key, 0, 0);\nassert_eq!(value, /* expected value */);\n\nlet result = dic.extra_match_search_pair(key, 0, 0);\nassert_eq!(result.value, /* expected value */);\nassert_eq!(result.length, /* expected length */);\n```\n\n#### Common prefix search\n```rust\nuse darts::DartsArrayTrie;\n\nconst MAX_RESULT_NUM: usize = 16;\nlet dic = DartsArrayTrie::new();\n// build ...\nlet results = dic.common_prefix_search(key, MAX_RESULT_NUM, 0, 0);\nassert_eq!(results, /* expected results */);\n```\n\n#### Common longest prefix search\n```rust\nuse darts::DartsArrayTrie;\n\nlet dic = DartArrayTrie::new();\n// build ...\nlet value = dic.common_longest_prefix_search(key, 0, 0);\nassert_eq!(value, /* expected value */);\n\nlet result = dic.common_longest_prefix_search_pair(key, 0, 0);\nassert_eq!(result.value, /* expected value */);\nassert_eq!(result.length, /* expected length */);\n```\n\n### Traverse\n\n```rust\nuse darts::DartsArrayTrie;\n\nlet dic = DartsArrayTrie::new();\n// build ...\nlet mut id = 0usize;\nlet mut key_pos = 0usize;\nfor i in 0..key.len() {\n    let result = dic.traverse(key, \u0026mut id, \u0026mut key_pos, i + 1);\n    assert_ne!(result, -2);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhiredplanck%2Fdarts-clone-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhiredplanck%2Fdarts-clone-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhiredplanck%2Fdarts-clone-rs/lists"}