Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add support for having "is" in the key for memories, allowing us to save memories with names like "why is it going down". In order to support this, I've had to refactor the handler to change the order of the operations performed by the handler.
The reason that is necessary is because the current logic makes it so you can never retrieve a key that contains "is". For example, if we had a memory named "a is b", we would try to retrieve it with
.rem a is b
. But this will be interpreted as a request to create a new memory "a" with the value "b". To make it possible to have "is" in the key, we need to first check if the entire phrase matches an existing key. If it doesn't, we can then attempt to interpret it as a request to store a new key.I also changed the handling of "?", allowing keys containing "?" to be remembered. The current logic will only use the text before the first "?", so if you tried to remember a key named "hello?" it would always instead search for a memory named "hello". This PR changes the logic to instead use the text up to the last "?". This means that searching for "hello?" will still look for a memory named "hello". But you can search for keys that contain a "?" by adding an extra "?" at the end, i.e. you'd do
.rem hello??
to retrieve the key "hello?".