Skip to content
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

add action to tokenize input #47

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

lytex
Copy link

@lytex lytex commented Jan 21, 2023

The idea is to tokenize the input in live grep to allow for fuzzy-like search. For example a b c is turned into:

b.*c.*a|c.*b.*a|c.*a.*b|a.*c.*b|b.*a.*c|a.*b.*c

The prompt is split by spaces to build a regular expression with al the permutations of that token.

This is a draft, the code is working but I have a couple of things I want to finish:

  1. Remove duplicate permutations
  2. Interpret two spaces or more as a literal space

Any suggestions are welcome!

@lytex
Copy link
Author

lytex commented Mar 15, 2023

Removal of duplicate permutations implemented

@lytex lytex marked this pull request as ready for review July 15, 2023 16:27
@lytex
Copy link
Author

lytex commented Jul 15, 2023

Now two or more whitespaces get treated as an literal space.

A nice thing to have would be to revert back to pre-tokenized string when you apply the action on an already tokenized string.
The process of generating all the permutations does not preserve the order of the tokens, though, in this PR I won't be looking into that.

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.

1 participant