buerokratt / Training-Module

MIT License
2 stars 21 forks source link

REST service to add example to a new regex #334

Open Kristjan259 opened 11 months ago

Kristjan259 commented 11 months ago

AS AN Architect I WANT TO have a REST service to add new examples into regexes SO THAT there wouldn't be any duplicate services for it

Acceptance Criteria

Examples

Sample input to /data/regex/asukoht_nlu.yml

Example of request body:

{ 
    "regex": "asukoht", 
    "example": "tartu"
}

The /data/regex/asukoht_nlu.yml before adding:

version: "3.0"
nlu:
- regex: asukoht
  examples: |
    - abja[- ]paluoja
    - antsla
    - elva
    - haapsalu

The /data/regex/asukoht_nlu.yml after adding:

version: "3.0"
nlu:
- regex: asukoht
  examples: |
    - abja[- ]paluoja
    - antsla
    - elva
    - haapsalu
    - tartu
ExiRain commented 11 months ago

Pull Request.

ValterAro commented 9 months ago

Seems to work as intended!