25 lines
654 B
Python
25 lines
654 B
Python
|
|
from __future__ import annotations
|
||
|
|
from dataclasses import dataclass, field
|
||
|
|
|
||
|
|
|
||
|
|
@dataclass
|
||
|
|
class ChunkerConfig:
|
||
|
|
max_chars: int = 1200
|
||
|
|
min_chars: int = 80
|
||
|
|
target_chars: int = 800
|
||
|
|
context_depth: int = 3
|
||
|
|
skip_headings: set[str] = field(default_factory=lambda: {
|
||
|
|
"indice",
|
||
|
|
"sommario",
|
||
|
|
"bibliografia",
|
||
|
|
"ringraziamenti",
|
||
|
|
"abbreviazioni",
|
||
|
|
})
|
||
|
|
skip_pre_heading: bool = True
|
||
|
|
merge_short: bool = True
|
||
|
|
atomic_types: set[str] = field(default_factory=lambda: {
|
||
|
|
"table", "code", "list", "math", "html",
|
||
|
|
})
|
||
|
|
fail_on_broken_fence: bool = True
|
||
|
|
fail_on_content_loss: bool = False
|