-
Notifications
You must be signed in to change notification settings - Fork 29
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
Fixes #8 Added common regular expressions for builtin.yaml. #43
base: main
Are you sure you want to change the base?
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
|
||
credit-card numbers: '\b\d{4}-\d{4}-\d{4}-\d{4}\b' #credit-card numbers | ||
Hashes (MD5, SHA-1, SHA-256): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong format
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This causes the error in test.
can't use categories
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed
Please try LangTrans first, then add relevant regular expressions |
@B-R-P, will do |
No description provided.