Commit 9d51861
Release v0.1.4: Add hardcoded patterns from json_repair Python library
This release integrates battle-tested cleanup patterns ported from the
Python json_repair library into JsonRemedy's Layer 3 processing pipeline.
## New Features
### Hardcoded Patterns Module (lib/json_remedy/layer3/hardcoded_patterns.ex)
- Smart quotes normalization: Converts ""curly"", «guillemets», ‹angles› to standard quotes
- Doubled quotes repair: Fixes ""value"" → "value" while preserving empty strings
- Number format normalization: Removes thousands separators (1,234,567 → 1234567)
- Unicode/hex escape sequences: Converts \uXXXX and \xXX (opt-in via config)
### Feature Flags
- :enable_hardcoded_patterns (default: true) - Master switch for all patterns
- :enable_escape_normalization (default: false) - Opt-in for escape sequences
### Examples & Documentation
- New examples/hardcoded_patterns_examples.exs with 8 comprehensive examples
- README.md updated with dedicated hardcoded patterns section
- Full attribution to source library: https://github.com/mangiucugna/json_repair
## Testing & Quality
- 47 new tests (100% pass rate)
- Total test suite: 499 tests, 0 failures
- Dialyzer: 0 type warnings
- Credo: 0 issues in new code
- Full UTF-8 international character support
## Technical Details
- Context-aware processing preserves commas in string values
- Smart quotes use Unicode byte sequences to avoid syntax conflicts
- Regex-based optimizations with minimal overhead
- Clean integration as Layer 3 pre-processing step
## Files Changed
Modified:
- .gitignore (added json_repair_python/)
- CHANGELOG.md (comprehensive v0.1.4 entry)
- README.md (version + hardcoded patterns section)
- lib/json_remedy/layer3/syntax_normalization.ex (integration)
- mix.exs (version 0.1.4)
New:
- lib/json_remedy/layer3/hardcoded_patterns.ex (250 lines)
- test/unit/layer3_hardcoded_patterns_test.exs (310 lines, 47 tests)
- examples/hardcoded_patterns_examples.exs (318 lines, 8 examples)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent f4fef83 commit 9d51861
File tree
8 files changed
+1048
-7
lines changed- examples
- lib/json_remedy/layer3
- test/unit
8 files changed
+1048
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
10 | 48 | | |
11 | 49 | | |
12 | 50 | | |
| |||
117 | 155 | | |
118 | 156 | | |
119 | 157 | | |
120 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
121 | 162 | | |
122 | 163 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
82 | 93 | | |
83 | 94 | | |
84 | 95 | | |
| |||
128 | 139 | | |
129 | 140 | | |
130 | 141 | | |
131 | | - | |
| 142 | + | |
132 | 143 | | |
133 | 144 | | |
134 | 145 | | |
| |||
228 | 239 | | |
229 | 240 | | |
230 | 241 | | |
231 | | - | |
| 242 | + | |
232 | 243 | | |
233 | 244 | | |
234 | 245 | | |
235 | 246 | | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
236 | 259 | | |
237 | 260 | | |
238 | 261 | | |
| |||
0 commit comments