Skip to content

support dictionary variables in match_dict #82

@sam-writer

Description

@sam-writer

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions