{"id":15540246,"url":"https://github.com/rm-hull/boyer-moore-search","last_synced_at":"2025-10-25T19:15:48.135Z","repository":{"id":62434505,"uuid":"60117065","full_name":"rm-hull/boyer-moore-search","owner":"rm-hull","description":"Boyer-Moore string search library in Clojure","archived":false,"fork":false,"pushed_at":"2019-06-15T21:40:16.000Z","size":65,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-03T12:17:30.734Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.destructuring-bind.org/boyer-moore-search/","language":"Clojure","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/rm-hull.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-31T19:23:04.000Z","updated_at":"2024-05-29T16:46:30.000Z","dependencies_parsed_at":"2022-11-01T21:16:13.378Z","dependency_job_id":null,"html_url":"https://github.com/rm-hull/boyer-moore-search","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/rm-hull%2Fboyer-moore-search","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-hull%2Fboyer-moore-search/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-hull%2Fboyer-moore-search/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-hull%2Fboyer-moore-search/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rm-hull","download_url":"https://codeload.github.com/rm-hull/boyer-moore-search/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248369623,"owners_count":21092632,"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-02T12:13:20.793Z","updated_at":"2025-10-25T19:15:48.047Z","avatar_url":"https://github.com/rm-hull.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Boyer-Moore String Search\n[![Build Status](https://travis-ci.org/rm-hull/boyer-moore-search.svg?branch=master)](http://travis-ci.org/rm-hull/boyer-moore-search) \n[![Coverage Status](https://coveralls.io/repos/rm-hull/boyer-moore-search/badge.svg?branch=master)](https://coveralls.io/r/rm-hull/boyer-moore-search?branch=master) \n[![Dependencies Status](https://versions.deps.co/rm-hull/boyer-moore-search/status.svg)](https://versions.deps.co/rm-hull/boyer-moore-search) \n[![Downloads](https://versions.deps.co/rm-hull/boyer-moore-search/downloads.svg)](https://versions.deps.co/rm-hull/boyer-moore-search) \n[![Clojars Project](https://img.shields.io/clojars/v/rm-hull/boyer-moore-search.svg)](https://clojars.org/rm-hull/boyer-moore-search)\n[![Maintenance](https://img.shields.io/maintenance/yes/2019.svg?maxAge=2592000)]()\n\nAn implementation of the Boyer-Moore string search algorithm in Clojure.\nThe Wikipedia entry for this algorithm describes it thusly:\n\n\u003e The Boyer-Moore algorithm searches for occurrences of _P_ in _T_ by\n\u003e performing explicit character comparisons at different alignments.\n\u003e Instead of a brute-force search of all alignments (of which there are\n\u003e _m-n+1_), Boyer-Moore uses information gained by preprocessing _P_ to\n\u003e skip as many alignments as possible.\n\u003e\n\u003e Previous to the introduction of this algorithm, the usual way to search\n\u003e within text was to examine each character of the text for the first\n\u003e character of the pattern. Once that was found the subsequent characters\n\u003e of the text would be compared to the characters of the pattern. If no\n\u003e match occurred then the text would again be checked character by\n\u003e character in an effort to find a match. Thus almost every character in\n\u003e the text needs to be examined.\n\u003e\n\u003e The key insight in this algorithm is that if the end of the pattern is\n\u003e compared to the text, then jumps along the text can be made rather than\n\u003e checking every character of the text. The reason that this works is\n\u003e that in lining up the pattern against the text, the last character of\n\u003e the pattern is compared to the character in the text. If the characters\n\u003e do not match there is no need to continue searching backwards along the\n\u003e pattern. If the character in the text does not match any of the\n\u003e characters in the pattern, then the next character to check in the text\n\u003e is located n characters farther along the text, where n is the length\n\u003e of the pattern. If the character is in the pattern then a partial shift\n\u003e of the pattern along the text is done to line up along the matching\n\u003e character and the process is repeated. The movement along the text in\n\u003e jumps to make comparisons rather than checking every character in the\n\u003e text decreases the number of comparisons that have to be made, which is\n\u003e the key to the efficiency of the algorithm.\n\nThis clojure implementation is designed to work on strings, sequences, vectors,\nand `java.io.InputStream`. Ported from the original:\nhttps://github.com/rm-hull/cljs-dataview/blob/master/src/dataview/boyer_moore.cljs.\n\n### Pre-requisites\n\nYou will need [Leiningen](https://github.com/technomancy/leiningen) 2.8.1 or above installed.\n\n### Building\n\nTo build and install the library locally, run:\n\n    $ cd boyer-moore-search\n    $ lein test\n    $ lein install\n\n### Including in your project\n\nThere is a version hosted at [Clojars](https://clojars.org/rm-hull/boyer-moore-search).\nFor leiningen include a dependency:\n\n```clojure\n[rm-hull/boyer-moore-search \"0.1.0\"]\n```\n\nFor maven-based projects, add the following to your `pom.xml`:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003erm-hull\u003c/groupId\u003e\n  \u003cartifactId\u003eboyer-moore-search\u003c/artifactId\u003e\n  \u003cversion\u003e0.1.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Basic Usage\n\n\u003e TODO\n\n## References\n\n* https://en.wikipedia.org/wiki/Boyer%E2%80%93Moore_string_search_algorithm#Implementations\n\n## License\n\n### The MIT License (MIT)\n\nCopyright (c) 2016 Richard Hull\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frm-hull%2Fboyer-moore-search","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frm-hull%2Fboyer-moore-search","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frm-hull%2Fboyer-moore-search/lists"}