{"id":24088175,"url":"https://github.com/time4tea/glossary","last_synced_at":"2025-02-27T05:22:19.432Z","repository":{"id":23419845,"uuid":"26782542","full_name":"time4tea/glossary","owner":"time4tea","description":null,"archived":false,"fork":false,"pushed_at":"2017-06-22T21:07:30.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-10T03:58:28.699Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/time4tea.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":"2014-11-17T23:33:59.000Z","updated_at":"2020-05-18T14:57:02.000Z","dependencies_parsed_at":"2022-08-18T23:02:21.533Z","dependency_job_id":null,"html_url":"https://github.com/time4tea/glossary","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/time4tea%2Fglossary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/time4tea%2Fglossary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/time4tea%2Fglossary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/time4tea%2Fglossary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/time4tea","download_url":"https://codeload.github.com/time4tea/glossary/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240982609,"owners_count":19888538,"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":"2025-01-10T03:58:52.785Z","updated_at":"2025-02-27T05:22:19.414Z","avatar_url":"https://github.com/time4tea.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[![Build Status](https://travis-ci.org/time4tea/glossary.svg?branch=master)](https://travis-ci.org/time4tea/glossary)\n\n# Find items in a glossary in some text\n\nExample\n-------\n\nYour glossary contains the items:\n\n* computer\n* person\n* electricity company\n\nYou would like to mark up the text:\n\nIs it a computer or a person at the other end. Phoning the electricity company you would never know\n\n```javascript\n\nvar glossary = new Glossary();\n\nglossary.add(\"computer\");\nglossary.add(\"person\");\nglossary.add(\"electricity company\");\n\nvar text = \"Is it a computer or a person at the other end. Phoning the electricity company you would never know\";\nvar result = glossary.prepare().gloss(text);\n\nvar glossarised = \"\";\nresult.accept({\n  gloss: function (text) {\n    glossarised += \"[\" + text + \"]\"\n  },\n  text: function (text) {\n    glossarised += text;\n  }\n});\n\nconsole.log(glossarised);\n```\n\nGives the output\n\n```\nIs it a [computer] or a [person] at the other end. Phoning the [electricity company] you would never know\n```\n\n\n## So what, that's a tiny file! - not very exciting\n\nThe implementation, based on the Aho-Corasick text searching algorithm, should support reasonably large glossaries,\nand run in a short amount of time for large texts.\n\nSee examples/microsoft.js for a more realistic example (on my laptop):\n\n```\nLoading 2451 definitions \nText length 268,647\nParse in 320 ms\nFound entries 1797, Text nodes 1709\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftime4tea%2Fglossary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftime4tea%2Fglossary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftime4tea%2Fglossary/lists"}