|
9 | 9 |
|
10 | 10 | A comprehensive, production-ready JSON repair library for Elixir that intelligently fixes malformed JSON strings from any source—LLMs, legacy systems, data pipelines, streaming APIs, and human input. |
11 | 11 |
|
12 | | -**JsonRemedy** uses a sophisticated 5-layer repair pipeline where each layer employs the most appropriate technique: regex for content cleaning, state machines for structural repairs, character-by-character parsing for syntax normalization, and battle-tested parsers for validation. The result is a robust system that handles virtually any JSON malformation while preserving valid content. |
| 12 | +**JsonRemedy** uses a sophisticated 5-layer repair pipeline where each layer employs the most appropriate technique: content cleaning, state machines for structural repairs, character-by-character parsing for syntax normalization, and battle-tested parsers for validation. The result is a robust system that handles virtually any JSON malformation while preserving valid content. |
13 | 13 |
|
14 | 14 | ## The Problem |
15 | 15 |
|
@@ -432,7 +432,7 @@ JsonRemedy's strength comes from its pragmatic, layered approach where each laye |
432 | 432 | defmodule JsonRemedy.LayeredRepair do |
433 | 433 | def repair(input) do |
434 | 434 | input |
435 | | - |> Layer1.content_cleaning() # Regex: Remove wrappers, comments, normalize encoding |
| 435 | + |> Layer1.content_cleaning() # Cleaning: Remove wrappers, comments, normalize encoding |
436 | 436 | |> Layer2.structural_repair() # State machine: Fix delimiters, nesting, structure |
437 | 437 | |> Layer3.syntax_normalization() # Char parsing: Fix quotes, booleans, commas |
438 | 438 | |> Layer4.validation_attempt() # Jason.decode: Fast path for clean JSON |
|
442 | 442 | ``` |
443 | 443 |
|
444 | 444 | ### 🧹 **Layer 1: Content Cleaning** |
445 | | -**Technique**: Regex and string operations (perfect for this job) |
| 445 | +**Technique**: String operations |
446 | 446 | - Removes code fences, comments, wrapper text |
447 | | -- Normalizes encoding and whitespace |
| 447 | +- Normalizes encoding and whitespace |
448 | 448 | - Extracts JSON from prose and HTML |
449 | 449 | - Handles streaming artifacts |
450 | 450 |
|
|
0 commit comments