Fixes #8 Added common regular expressions for builtin.yaml.#43
Fixes #8 Added common regular expressions for builtin.yaml.#43Aditi840 wants to merge 5 commits intoLangTrans:mainfrom
Conversation
|
There is a syntax error and only add regex to match language constructs. No generic regex like credit card number. |
|
@B-R-P I have made some changes to the file, will you please have a look at it |
builtin.yaml
Outdated
| Pattern: (?:\/[\w-]+)+\/? | ||
|
|
||
| credit-card numbers: '\b\d{4}-\d{4}-\d{4}-\d{4}\b' #credit-card numbers | ||
| Hashes (MD5, SHA-1, SHA-256): |
|
Format is not correct. |
|
@B-R-P This time, I added regexs to match language constructs only, using the above examples of the file, have a look at it. |
|
Hello @Aditi840 make sure your function is error free, for the tests to pass smoothly. It looks like you're encountering a TypeError and a SystemExit exception in your Python code. 1.This error is happening in the replace_variables function, specifically in this line : source_string = source_string.replace(f"<{variable_name}>", variable_value) It seems like variable_value is expected to be a string, but it's a dictionary. You should check where variable_value is being assigned and make sure it contains a string.
File "/home/runner/work/LangTrans/LangTrans/LangTrans.py", line 410, in extract |
|
Thank you. I will check it out |
| list: \\[(?:[^\\[\\]]*|(?R))*\\] # Match lists (assuming they're defined on a single line) | ||
|
|
||
| dict: {(?:[^{}]*|(?R))*} # Match dictionaries/objects (assuming they're defined on a single line) | ||
| expressions: |
There was a problem hiding this comment.
This causes the error in test.
can't use categories
There was a problem hiding this comment.
@B-R-P, If I remove the list and dict then will it be ok.
|
@B-R-P, I removed them, will you now run the test again. |
|
This line is incorrect. Why expression as main node of other regexs? |
|
|
||
| boolean: "true|false" # Match boolean values | ||
|
|
||
| null: "null" # Match null value |
|
Please try LangTrans first, then add relevant regular expressions |
|
@B-R-P, will do |
No description provided.