{"id":15984999,"url":"https://github.com/divineomega/fuzzy-events","last_synced_at":"2025-04-04T20:49:04.356Z","repository":{"id":56969644,"uuid":"246414298","full_name":"DivineOmega/fuzzy-events","owner":"DivineOmega","description":"Perform actions based on a fuzzy string matches","archived":false,"fork":false,"pushed_at":"2020-03-23T23:50:51.000Z","size":21,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-10T05:28:58.485Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DivineOmega.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}},"created_at":"2020-03-10T21:42:01.000Z","updated_at":"2020-03-23T23:50:53.000Z","dependencies_parsed_at":"2022-08-21T06:40:13.720Z","dependency_job_id":null,"html_url":"https://github.com/DivineOmega/fuzzy-events","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivineOmega%2Ffuzzy-events","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivineOmega%2Ffuzzy-events/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivineOmega%2Ffuzzy-events/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivineOmega%2Ffuzzy-events/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DivineOmega","download_url":"https://codeload.github.com/DivineOmega/fuzzy-events/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249617,"owners_count":20908211,"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-10-08T02:11:52.672Z","updated_at":"2025-04-04T20:49:04.335Z","avatar_url":"https://github.com/DivineOmega.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fuzzy Events\n\n[![Build Status](https://travis-ci.com/DivineOmega/fuzzy-events.svg?branch=master)](https://travis-ci.com/DivineOmega/fuzzy-events)\n\nFuzzy events is a PHP package that allows you to perform actions based on a \nfuzzy string matches.\n\n## Installation\n\nInstall using the following Composer command.\n\n```bash\ncomposer require divineomega/fuzzy-events\n```\n\n### Usage\n\nSee the following usage example.\n\n```php\nclass Greeting implements FuzzyListenerInterface\n{\n\n    public function handle(string $query)\n    {\n        return 'Hello there!';\n    }\n}\n```\n\n```php\n$listeners = [\n    Greeting::class =\u003e [\n        'Hello',\n        'Hi',\n        'Hey',\n        'Greetings',\n        'Howdy',\n        'Hello there',\n        'Hi there',\n    ],\n];\n\n$confidenceThreshold = 75;\n\n$dispatcher = new FuzzyDispatcher($listeners, $confidenceThreshold);\n\n$response = $dispatcher-\u003efire('Greetingz!');\n\n// $response = 'Hello there!'\n\ntry {\n    $dispatcher-\u003efire('Goodbye!');\n} catch (ConfidenceTooLowException $e) {\n    // No matches within specified confidence threshold!\n}\n\n$confidences = $dispatcher-\u003egetConfidences('Hi!');\n\n// $confidences = [\n//    Greeting::class =\u003e 80\n// ]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivineomega%2Ffuzzy-events","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdivineomega%2Ffuzzy-events","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivineomega%2Ffuzzy-events/lists"}