Skip to content

optional parameter support#212

Draft
CajunAvenger wants to merge 2 commits into
mainfrom
optional-params
Draft

optional parameter support#212
CajunAvenger wants to merge 2 commits into
mainfrom
optional-params

Conversation

@CajunAvenger
Copy link
Copy Markdown
Collaborator

While mse theoretically had support for optional keyword parameters, the placeholder text would still be rendered, eg "token<s>", so instead we used the inelegant match "toke<*s>". This PR instead adds a step to text_filter to remove placeholders with a standard overwritten name, drafted as <atom-kwpph>hidden</atom-kwpph>

This does mostly function, "Type token<plural>" and "Connive<plural><optional_number>" both work correctly. But there are two weird interactions:

  • If there is any plaintext—including just a space—after the optional param, it becomes mandatory. "a<plural>b" matches "asb" but not "ab". This prevents updating into "become<plural> plotted".
  • If there are any parameters separated from the optional by plaintext, it becomes mandatory. This prevents updating into "mill<plural> <one_word> card<plural>"

this is not returning keyword in expand_keywords(), so i think it's a hiccup in the matching, rather than some quirk in expand_keywords that returns no reminder text, and the script step that removes the empty placeholder def isn't involved. The only time optional is actually referenced is adding a ? to that part of the regex, so I wouldn't think it's some bug with optional placeholders. My instinct is that it's something happening in the filtering happening at possible_matches, but i can't follow it well enough to tell where

this is probably still an acceptable update with those examples left on the old method, but wanna make sure @G-e-n-e-v-e-n-s-i-S gets a chance to check the quirks before doing that.

@G-e-n-e-v-e-n-s-i-S
Copy link
Copy Markdown
Collaborator

I'm sorry this is another days long detour into figuring out how the keyword parsing works that I can't afford.

@CajunAvenger
Copy link
Copy Markdown
Collaborator Author

you got it

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.

2 participants