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

support dictionary variables in match_dict #82

Open
sam-writer opened this issue Sep 22, 2020 · 0 comments
Open

support dictionary variables in match_dict #82

sam-writer opened this issue Sep 22, 2020 · 0 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@sam-writer
Copy link
Contributor

Honestly not sure if this is a great idea... We'd want to duplicate the match len(dict.items()) times, one for each entry. An example usage would be:

(resources/variables/lookups.json)

{
  "opposites": {
    "bad": "good",
    "small": {"IN": ["big", "long", "large"]}
  }
}

and in the match_dict:

resources/match_dicts/opposite_matches.json

...
  "not-opposite" : {
    "PATTERNS": [
      {
        "TEXT": "$LOOKUP:opposites.key"
      }
    ],
    "SUGGESTIONS": [
      [
        {
          "TEXT": "$LOOKUP:opposites.value"
        }
      ]
    ] 
  }

This would generate len(opposites.items()) entries in the match dict, copying the other properties like hooks and description.

Do we like this syntax? Other thoughts?

@sam-writer sam-writer added enhancement New feature or request question Further information is requested labels Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant