jev-semgrep
grep by meaning, and across languages.
Jun Uehara’s tool scores every line against a meaning instead of matching a pattern, and meanings combine with AND, OR and NOT. Because Jev reads language, a Japanese query finds English lines and the other way round.
# semgrep — grep by meaning [日本語版はこちら](README.ja.md) Background and design notes (Japanese): [Jevのキラーアプリ、「意味で探す grep」を作った](https://zenn.dev/uehaj/articles/jev-semgrep-grep-by-meaning) on Zenn. A grep that finds lines by **what they mean**, not by regular expressions. Matching is done by **Jev**, the System One model from [TypeSafe AI](https://typesafe.ai/). Jev does not generate text. It answers typed questions with probabilities, so for every line semgrep asks "does this line match the meaning *network failure*?", gets a probability back, and applies a threshold. ```sh ./semgrep -n -e "customer is angry or frustrated" tickets.txt ``` - Zero dependencies. One file, Node.js 20.12+ and `fetch`. - Fast. 30 lines go into one request, requests run 8 at a time. A 210-line file finishes in under a second. - Meanings combine with AND / OR / NOT. - **Language-agnostic.** The meaning and the text can each be in any language. A Japanese meaning finds French, Russian, Chinese and Korean lines alike. No translation step, same speed, same cost. ## Search across languages The meaning and the text do not have to share a language. Jev compares concepts, not words, so one query finds matching lines in every language the file contains. An **English** meaning finds **Japanese** lines. None of the hits contain "angry" or "frustrated", and two of them are in Japanese: ```sh $ ./semgrep -n -e "customer is angry or frustrated" tests/corpus.txt 14:ユーザー山田さんからの問い合わせ: 返金してほしい、商品が壊れていた 16:ユーザー佐藤さんからの問い合わせ: 注文した覚えのない請求が来ています。至急確認してください 18:I want my money back. The item arrived broken and customer service ignored me. 21:Your product ruined my weekend. Never buying from you again. 23:This is the third time I'm writing. Nobody has replied to my previous emails. ``` A **Japanese** meaning find