{"id":26800598,"url":"https://github.com/ktsu-dev/fuzzysearch","last_synced_at":"2026-05-23T01:07:05.808Z","repository":{"id":257060718,"uuid":"781756934","full_name":"ktsu-dev/FuzzySearch","owner":"ktsu-dev","description":null,"archived":false,"fork":false,"pushed_at":"2026-01-30T02:50:49.000Z","size":471,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-30T17:55:55.593Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ktsu-dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":"COPYRIGHT.md","agents":null,"dco":null,"cla":null}},"created_at":"2024-04-04T01:16:07.000Z","updated_at":"2026-01-30T02:48:20.000Z","dependencies_parsed_at":"2025-01-22T00:19:24.419Z","dependency_job_id":"b744d89b-8ee5-4a0c-8930-e85046f38e23","html_url":"https://github.com/ktsu-dev/FuzzySearch","commit_stats":null,"previous_names":["ktsu-dev/fuzzysearch"],"tags_count":104,"template":false,"template_full_name":null,"purl":"pkg:github/ktsu-dev/FuzzySearch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktsu-dev%2FFuzzySearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktsu-dev%2FFuzzySearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktsu-dev%2FFuzzySearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktsu-dev%2FFuzzySearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ktsu-dev","download_url":"https://codeload.github.com/ktsu-dev/FuzzySearch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktsu-dev%2FFuzzySearch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29136032,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T21:59:57.939Z","status":"ssl_error","status_checked_at":"2026-02-05T21:59:57.628Z","response_time":65,"last_error":"SSL_read: 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":[],"created_at":"2025-03-29T20:17:58.015Z","updated_at":"2026-02-05T22:07:06.418Z","avatar_url":"https://github.com/ktsu-dev.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ktsu.FuzzySearch\n\n\u003e A lightweight .NET library that provides fuzzy string matching capabilities, allowing for approximate string matching with intelligent scoring.\n\n[![License](https://img.shields.io/github/license/ktsu-dev/FuzzySearch.svg?label=License\u0026logo=nuget)](LICENSE.md)\n[![NuGet Version](https://img.shields.io/nuget/v/ktsu.FuzzySearch?label=Stable\u0026logo=nuget)](https://nuget.org/packages/ktsu.FuzzySearch)\n[![NuGet Version](https://img.shields.io/nuget/vpre/ktsu.FuzzySearch?label=Latest\u0026logo=nuget)](https://nuget.org/packages/ktsu.FuzzySearch)\n[![NuGet Downloads](https://img.shields.io/nuget/dt/ktsu.FuzzySearch?label=Downloads\u0026logo=nuget)](https://nuget.org/packages/ktsu.FuzzySearch)\n[![GitHub commit activity](https://img.shields.io/github/commit-activity/m/ktsu-dev/FuzzySearch?label=Commits\u0026logo=github)](https://github.com/ktsu-dev/FuzzySearch/commits/main)\n[![GitHub contributors](https://img.shields.io/github/contributors/ktsu-dev/FuzzySearch?label=Contributors\u0026logo=github)](https://github.com/ktsu-dev/FuzzySearch/graphs/contributors)\n[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/ktsu-dev/FuzzySearch/dotnet.yml?label=Build\u0026logo=github)](https://github.com/ktsu-dev/FuzzySearch/actions)\n\n## Introduction\n\nFuzzySearch is a .NET library that provides fuzzy string matching capabilities with intelligent scoring. It's perfect for implementing search-as-you-type features, command palettes, or any application requiring flexible string matching. This library offers both basic contains-style matching and more sophisticated algorithms that can rank multiple potential matches by relevance.\n\n## Features\n\n- **Fuzzy String Matching**: Match strings even when they contain typos or missing characters\n- **Intelligent Scoring**: Rank matches by quality with a smart scoring algorithm\n- **Case Insensitivity**: Optional case-insensitive matching\n- **Filtering Collections**: Filter lists of strings and rank results\n- **Customizable Parameters**: Adjust matching behavior to suit different needs\n- **Lightweight**: Minimal dependencies, focused on performance\n- **Well-tested**: Comprehensive test suite ensuring reliability\n\n## Installation\n\n### Package Manager Console\n\n```powershell\nInstall-Package ktsu.FuzzySearch\n```\n\n### .NET CLI\n\n```bash\ndotnet add package ktsu.FuzzySearch\n```\n\n### Package Reference\n\n```xml\n\u003cPackageReference Include=\"ktsu.FuzzySearch\" Version=\"x.y.z\" /\u003e\n```\n\n## Usage Examples\n\n### Basic Matching\n\nThe simplest way to check if a string contains characters from a pattern in sequence:\n\n```csharp\nusing ktsu.FuzzySearch;\n\nclass Program\n{\n    static void Main()\n    {\n        string text = \"Hello World\";\n        string pattern = \"hlo\";\n        \n        bool isMatch = Fuzzy.Contains(text, pattern); // Returns true\n    }\n}\n```\n\n### Matching with Scoring\n\nTo get both a match result and a score that indicates the quality of the match:\n\n```csharp\nusing ktsu.FuzzySearch;\n\nclass Program\n{\n    static void Main()\n    {\n        string text = \"Hello World\";\n        string pattern = \"hlo\";\n        \n        var result = Fuzzy.Match(text, pattern);\n        \n        Console.WriteLine($\"Is match: {result.IsMatch}\");          // True\n        Console.WriteLine($\"Score: {result.Score}\");               // A value between 0-1\n        Console.WriteLine($\"Character indices: {result.Indices}\"); // Indices of matched characters\n    }\n}\n```\n\n### Filtering a Collection\n\nFilter a list of strings and sort them by match quality:\n\n```csharp\nusing ktsu.FuzzySearch;\n\nclass Program\n{\n    static void Main()\n    {\n        var items = new List\u003cstring\u003e\n        {\n            \"AppDataStorage\",\n            \"Application Settings\",\n            \"Data Store\",\n            \"File System\",\n            \"Storage Provider\"\n        };\n        \n        string pattern = \"appstor\";\n        \n        // Filter and rank by match quality\n        var results = Fuzzy.Filter(items, pattern);\n        \n        foreach (var result in results)\n        {\n            Console.WriteLine($\"{result.Item} (Score: {result.Score})\");\n        }\n        \n        // Output might be:\n        // AppDataStorage (Score: 0.89)\n        // Application Settings (Score: 0.65)\n        // Storage Provider (Score: 0.52)\n    }\n}\n```\n\n### Advanced Options\n\nCustomize the matching behavior with options:\n\n```csharp\nusing ktsu.FuzzySearch;\n\nclass Program\n{\n    static void Main()\n    {\n        var options = new FuzzyOptions\n        {\n            CaseSensitive = true,              // Default is false\n            ScoreThreshold = 0.4,              // Minimum score to consider a match\n            BonusConsecutiveChars = 1.5,       // Bonus for consecutive matched characters\n            BonusStartOfWord = 2.0,            // Bonus for matches at word boundaries\n            PenaltyUnmatched = 0.1,            // Penalty for unmatched characters\n            MaxPatternLength = 64              // Maximum pattern length to consider\n        };\n        \n        string text = \"FileSystemWatcher\";\n        string pattern = \"FSW\";\n        \n        var result = Fuzzy.Match(text, pattern, options);\n        Console.WriteLine($\"Score with custom options: {result.Score}\");\n    }\n}\n```\n\n### Object Collections\n\nFilter and match against object collections by providing a selector function:\n\n```csharp\nusing ktsu.FuzzySearch;\n\nclass Program\n{\n    class FileItem\n    {\n        public string Name { get; set; }\n        public string Path { get; set; }\n        public long Size { get; set; }\n    }\n    \n    static void Main()\n    {\n        var files = new List\u003cFileItem\u003e\n        {\n            new FileItem { Name = \"Document.pdf\", Path = \"/documents/\", Size = 1024 },\n            new FileItem { Name = \"Presentation.pptx\", Path = \"/presentations/\", Size = 2048 },\n            new FileItem { Name = \"Spreadsheet.xlsx\", Path = \"/spreadsheets/\", Size = 512 }\n        };\n        \n        string pattern = \"doc\";\n        \n        // Filter objects using a selector function\n        var results = Fuzzy.Filter(files, pattern, item =\u003e item.Name);\n        \n        foreach (var result in results)\n        {\n            Console.WriteLine($\"{result.Item.Name} (Score: {result.Score})\");\n        }\n    }\n}\n```\n\n## API Reference\n\n### `Fuzzy` Static Class\n\nThe main class providing fuzzy matching functionality.\n\n#### Methods\n\n| Name | Parameters | Return Type | Description |\n|------|------------|-------------|-------------|\n| `Contains` | `string text, string pattern, bool caseSensitive = false` | `bool` | Checks if the text contains the pattern in sequence |\n| `Match` | `string text, string pattern, FuzzyOptions options = null` | `FuzzyResult` | Matches text against pattern with scoring |\n| `Filter` | `IEnumerable\u003cstring\u003e items, string pattern, FuzzyOptions options = null` | `IEnumerable\u003cFuzzyItem\u003cstring\u003e\u003e` | Filters and ranks a collection of strings |\n| `Filter\u003cT\u003e` | `IEnumerable\u003cT\u003e items, string pattern, Func\u003cT, string\u003e selector, FuzzyOptions options = null` | `IEnumerable\u003cFuzzyItem\u003cT\u003e\u003e` | Filters and ranks a collection of objects using a selector function |\n\n### `FuzzyResult` Class\n\nRepresents the result of a fuzzy match operation.\n\n#### Properties\n\n| Name | Type | Description |\n|------|------|-------------|\n| `IsMatch` | `bool` | Indicates if the pattern matches the text |\n| `Score` | `double` | A value between 0 and 1 indicating match quality (1 is perfect) |\n| `Indices` | `int[]` | The indices in the text where pattern characters were matched |\n\n### `FuzzyOptions` Class\n\nConfiguration options for fuzzy matching.\n\n#### Properties\n\n| Name | Type | Default | Description |\n|------|------|---------|-------------|\n| `CaseSensitive` | `bool` | `false` | Whether matching should be case-sensitive |\n| `ScoreThreshold` | `double` | `0.3` | Minimum score required to consider a match valid |\n| `BonusConsecutiveChars` | `double` | `1.0` | Score bonus for consecutive matched characters |\n| `BonusStartOfWord` | `double` | `1.5` | Score bonus for matches at word boundaries |\n| `PenaltyUnmatched` | `double` | `0.1` | Score reduction for unmatched characters |\n\n## Contributing\n\nContributions are welcome! Here's how you can help:\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\nPlease make sure to update tests as appropriate and adhere to the existing coding style.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fktsu-dev%2Ffuzzysearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fktsu-dev%2Ffuzzysearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fktsu-dev%2Ffuzzysearch/lists"}