8000 Add `--with-locations` flag to `wimbd search` by epwalsh · Pull Request #14 · allenai/wimbd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add --with-locations flag to wimbd search #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 10, 2024
Merged

Conversation

epwalsh
Copy link
Member
@epwalsh epwalsh commented Jun 10, 2024

For including the location of each match in the output.
Closes #13.

For example:

cargo run -- search test_fixtures/c4-sample.00000-of-00001.json.gz -p '\bCascara' --with-locations --json

will output:

{"count":5,"matches":{"test_fixtures/c4-sample.00000-of-00001.json.gz":[{"line_num":24,"submatches":[{"end_col":7,"start_col":0},{"end_col":16,"start_col":9},{"end_col":279,"start_col":272},{"end_col":330,"start_col":323},{"end_col":339,"start_col":332}],"text":"Cascara (Cascara sagrada) by Eagle Peak Herbals: This North American shrub is a well known laxative and colon cleanser that has been widely used by physicians as well as native peoples. Many commercial preparations intended to treat constipation contain the cured bark of Cascara sagrada. Famous for \"next morning results.\nCascara (Cascara sagrada), certified organic grain alcohol, and distilled water."}]},"pattern":"\\bCascara"}

epwalsh added 2 commits June 10, 2024 15:31
For including the location of each match in the output.
Closes #13.
@epwalsh epwalsh requested a review from yanaiela June 10, 2024 22:37
@yanaiela yanaiela merged commit 41f5e3c into main Jun 10, 2024
8 checks passed
@yanaiela yanaiela deleted the epwalsh/match-locations branch June 10, 2024 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Save documents where matched texts are from from wimbd search
2 participants
0