{"id":20329516,"url":"https://github.com/raypereda/multisearch","last_synced_at":"2025-04-11T20:50:19.962Z","repository":{"id":69360410,"uuid":"2618391","full_name":"raypereda/multisearch","owner":"raypereda","description":"This is a command-line program for searching text for multiple words (or phrases) in a single pass. The runtime is O(n + m + z), where n is the length of the searched text, m is the total length of all the words we are looking for,  and z is the total number of occurrences of words we are looking for. ","archived":false,"fork":false,"pushed_at":"2017-07-15T07:33:31.000Z","size":9,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T16:51:30.224Z","etag":null,"topics":["aho-corasick-algorithm","java","search-in-text","searching-algorithms"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raypereda.png","metadata":{"files":{"readme":"README.TXT","changelog":"newsarticle1.txt","contributing":null,"funding":null,"license":null,"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":"2011-10-21T06:01:13.000Z","updated_at":"2019-12-27T10:20:18.000Z","dependencies_parsed_at":"2023-02-27T11:30:42.918Z","dependency_job_id":null,"html_url":"https://github.com/raypereda/multisearch","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/raypereda%2Fmultisearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raypereda%2Fmultisearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raypereda%2Fmultisearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raypereda%2Fmultisearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raypereda","download_url":"https://codeload.github.com/raypereda/multisearch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248480513,"owners_count":21110936,"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":["aho-corasick-algorithm","java","search-in-text","searching-algorithms"],"created_at":"2024-11-14T20:11:33.534Z","updated_at":"2025-04-11T20:50:19.953Z","avatar_url":"https://github.com/raypereda.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is a Java program for searching for a collection of words (or phrases) \nat the same time. This uses the Aho-Corasick algorithm.\nSee http://en.wikipedia.org/wiki/Aho-Corasick_algorithm\n\nRay Pereda\nraypereda (at) gmail\n\n$ java -jar multisearch.jar \nUsage: java -jar msearch.jar -p PATTERNFILENAME FILENAME1 FILENAME2 ...\nSearch for a list of fixed patterns in a list target files.\nExample: java -jar multisearch.jar -f patterns.txt newarticle1.txt newsarticle2.txt\n\nRequired:\n  must specify the patterns files with -f\n  must specify at least one target filename\n\n\nSuppose you have a list of phrases that identify things that you're interested in.\nPut those phrases one per in a file. Here's an example file:\n\n$ cat phrases-of-interests.txt \nchocolate\nlaptop\nbicycle\ncaveman\npaleo\nsimplify\ngenomics\n\nNow suppose you have a list of news articles that you want to scan for all possible\nmatches of phrases that are interesting. Here are two example news articles.\n\n$ cat newsarticle1.txt \nThis article is about the latest in bicycle races.\nIn here we will review the latest in eliptical gears.\n\n$ cat newsarticle2.txt \nThis article is about Otzi. A caveman that lived about 10,000 years ago.\npaleo-genomics leverage DNA to piece together Otzi's life.\n\nHere's an example of multisearching for all the phrases in one pass through\nthe news articles:\n\njava -jar multisearch.jar -p phrases-of-interests.txt newsarticle1.txt newsarticle2.txt \ntarget file: newsarticle1.txt\nlocation: [    36,     43] matched: bicycle\ntarget file: newsarticle2.txt\nlocation: [    30,     37] matched: caveman\nlocation: [    73,     78] matched: paleo\nlocation: [    79,     87] matched: genomics\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraypereda%2Fmultisearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraypereda%2Fmultisearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraypereda%2Fmultisearch/lists"}