{"id":13440125,"url":"https://github.com/BurntSushi/fst","last_synced_at":"2025-03-20T09:32:02.081Z","repository":{"id":43022495,"uuid":"41943138","full_name":"BurntSushi/fst","owner":"BurntSushi","description":"Represent large sets and maps compactly with finite state transducers.","archived":false,"fork":false,"pushed_at":"2024-09-25T20:46:04.000Z","size":2100,"stargazers_count":1838,"open_issues_count":40,"forks_count":130,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-03-18T17:14:05.823Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BurntSushi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"COPYING","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},"funding":{"github":["BurntSushi"]}},"created_at":"2015-09-05T00:25:46.000Z","updated_at":"2025-03-17T17:00:57.000Z","dependencies_parsed_at":"2024-10-27T23:46:21.941Z","dependency_job_id":"08a64f61-40c1-40d2-b5b8-cfc70fb27342","html_url":"https://github.com/BurntSushi/fst","commit_stats":{"total_commits":263,"total_committers":26,"mean_commits":"10.115384615384615","dds":0.155893536121673,"last_synced_commit":"5907b4739793b3d5d7061eaa3f85274e09769d6a"},"previous_names":[],"tags_count":65,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BurntSushi%2Ffst","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BurntSushi%2Ffst/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BurntSushi%2Ffst/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BurntSushi%2Ffst/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BurntSushi","download_url":"https://codeload.github.com/BurntSushi/fst/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244585846,"owners_count":20476824,"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","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":[],"created_at":"2024-07-31T03:01:20.003Z","updated_at":"2025-03-20T09:32:02.073Z","avatar_url":"https://github.com/BurntSushi.png","language":"Rust","readme":"fst\n===\nThis crate provides a fast implementation of ordered sets and maps using finite\nstate machines. In particular, it makes use of finite state transducers to map\nkeys to values as the machine is executed. Using finite state machines as data\nstructures enables us to store keys in a compact format that is also easily\nsearchable. For example, this crate leverages memory maps to make range queries\nvery fast.\n\nCheck out my blog post\n[Index 1,600,000,000 Keys with Automata and\nRust](https://blog.burntsushi.net/transducers/)\nfor extensive background, examples and experiments.\n\n[![Build status](https://github.com/BurntSushi/fst/workflows/ci/badge.svg)](https://github.com/BurntSushi/fst/actions)\n[![](https://meritbadge.herokuapp.com/fst)](https://crates.io/crates/fst)\n\nDual-licensed under MIT or the [UNLICENSE](https://unlicense.org/).\n\n\n### Documentation\n\nhttps://docs.rs/fst\n\nThe\n[`regex-automata`](https://docs.rs/regex-automata)\ncrate provides implementations of the `fst::Automata` trait when its\n`transducer` feature is enabled. This permits using DFAs compiled by\n`regex-automata` to search finite state transducers produced by this crate.\n\n\n### Installation\n\nSimply add a corresponding entry to your `Cargo.toml` dependency list:\n\n```toml,ignore\n[dependencies]\nfst = \"0.4\"\n```\n\n\n### Example\n\nThis example demonstrates building a set in memory and executing a fuzzy query\nagainst it. You'll need `fst = \"0.4\"` with the `levenshtein` feature enabled in\nyour `Cargo.toml`.\n\n```rust\nuse fst::{IntoStreamer, Set};\nuse fst::automaton::Levenshtein;\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n  // A convenient way to create sets in memory.\n  let keys = vec![\"fa\", \"fo\", \"fob\", \"focus\", \"foo\", \"food\", \"foul\"];\n  let set = Set::from_iter(keys)?;\n\n  // Build our fuzzy query.\n  let lev = Levenshtein::new(\"foo\", 1)?;\n\n  // Apply our fuzzy query to the set we built.\n  let stream = set.search(lev).into_stream();\n\n  let keys = stream.into_strs()?;\n  assert_eq!(keys, vec![\"fo\", \"fob\", \"foo\", \"food\"]);\n  Ok(())\n}\n```\n\nCheck out the documentation for a lot more examples!\n\n\n### Cargo features\n\n* `levenshtein` - **Disabled** by default. This adds the `Levenshtein`\n  automaton to the `automaton` sub-module. This includes an additional\n  dependency on `utf8-ranges`.\n","funding_links":["https://github.com/sponsors/BurntSushi"],"categories":["Libraries","Rust","库 Libraries","库"],"sub_categories":["Text search","文本搜索 Text search","文本搜索"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBurntSushi%2Ffst","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBurntSushi%2Ffst","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBurntSushi%2Ffst/lists"}