diff options
Diffstat (limited to 'src/conventionalrp/core/parser.py')
| -rw-r--r-- | src/conventionalrp/core/parser.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/conventionalrp/core/parser.py b/src/conventionalrp/core/parser.py index 266506b..d5b91da 100644 --- a/src/conventionalrp/core/parser.py +++ b/src/conventionalrp/core/parser.py @@ -2,18 +2,19 @@ import json import re from pathlib import Path + class Parser: def __init__(self): self.rules = [] - def load_rules(self, rules_path : str): + def load_rules(self, rules_path: str): """Load parsing rules.""" if not Path(rules_path).exists(): raise FileNotFoundError(f"No such file or directory: {rules_path} ") with open(rules_path, "r", encoding="utf-8") as f: file_content = f.read() - + rules = json.loads(file_content) # validation rule format @@ -53,4 +54,4 @@ class Parser: else: parsed_data.append({"content": line.strip(), "type": "unknown"}) - return parsed_data
\ No newline at end of file + return parsed_data |
