{"id":21740538,"url":"https://github.com/writecrow/highlighter","last_synced_at":"2025-04-13T03:41:47.008Z","repository":{"id":57082476,"uuid":"172844063","full_name":"writecrow/highlighter","owner":"writecrow","description":"Highlights words/phrases per specified parameters","archived":false,"fork":false,"pushed_at":"2025-02-13T15:19:16.000Z","size":41,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-11T14:10:31.308Z","etag":null,"topics":["highlight","natural-language-processing","php-library"],"latest_commit_sha":null,"homepage":"https://highlighter.markfullmer.com/","language":"PHP","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/writecrow.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":"2019-02-27T04:38:43.000Z","updated_at":"2025-02-13T15:19:09.000Z","dependencies_parsed_at":"2025-02-13T15:37:29.473Z","dependency_job_id":null,"html_url":"https://github.com/writecrow/highlighter","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writecrow%2Fhighlighter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writecrow%2Fhighlighter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writecrow%2Fhighlighter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writecrow%2Fhighlighter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/writecrow","download_url":"https://codeload.github.com/writecrow/highlighter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248660932,"owners_count":21141371,"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":["highlight","natural-language-processing","php-library"],"created_at":"2024-11-26T06:13:54.957Z","updated_at":"2025-04-13T03:41:46.984Z","avatar_url":"https://github.com/writecrow.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Excerpt Highlighter\n\nA PHP library for creating a highlighted excerpt a provided list of tokens in a provided text string.\n\n## Basic usage in an application\nThe included `index.php` file contains a generation form demo.\n\nMake your code aware of the Highlighter class via your favorite method\n(e.g., `use writecrow\\Highlighter\\HighlightExcerpt;`)\n\n```php\nprint HighlightExcerpt::highlight('Round the rugged rock,' ['the']);\n// Will print 'Round \u003cmark\u003ethe\u003c/mark\u003e rugged rock'\n\nprint HighlightExcerpt::highlight('Round the rugged rock,' ['the', 'rock']);\n// Will print 'Round \u003cmark\u003ethe\u003c/mark\u003e rugged \u003cmark\u003erock\u003c/mark\u003e'\n\nprint HighlightExcerpt::highlight('Round the rugged rock,' ['ro', '\"round\"']);\n// Will print 'Round the rugged rock', since `ro` is present, \n// but only a word partial,\n// and `round` is present, but double-quotes indicate case-sensitivity\n// so `round` != `Round`\n\n```\n\n## Advanced behaviors\nThe excerpt highlighter will:\n- Default to case-insensitive highlighting for a word (e.g., `'the'`)\n- Become case-sensitive if the token is wrapped in double quotes (e.g. `'\"The\"'`)\n- Not highlight partial word matched (e.g., `'the'` will not highlight `therefore`)\n- Given multiple tokens passed to be highlighted, will create shorter, concatenated excerpts from the text which overall try to honor the length parameter specified (see below)\n- Produce excerpts that start/end on word boundaries\n\n\n### Length\nPass a 3rd parameter, an integer, to the function to specify the desired length of the excerpt.\n\n```php\nprint HighlightExcerpt::highlight('Round the rugged rock,' ['the'], 300);\n// Would limit the excerpt to 300 characters\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwritecrow%2Fhighlighter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwritecrow%2Fhighlighter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwritecrow%2Fhighlighter/lists"}