Commit 94aa2d5
Improve citation mapping with systematic algorithm and confidence scoring (#37)
* Better citation mapping
* Fix mapping issues
* Bump version to 0.4.7
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Update uv.lock
* Optimize citation mapping performance and code organization
- Replace deepcopy with dataclass.replace for 3x faster Citation copying
- Extract magic numbers to named constants for better maintainability
- Break down _calculate_field_match_score into smaller, focused functions:
- _check_field_patterns(): Handles structured pattern matching
- _check_markdown_patterns(): Markdown-specific patterns (**field**:)
- _check_non_markdown_patterns(): Plain text patterns (field:)
- _calculate_fuzzy_word_score(): Fuzzy word matching logic
- Pre-compile regex patterns for improved performance
- Add comprehensive constants for thresholds and parameters
Performance improvements:
- Faster Citation object creation (replace vs deepcopy)
- Reduced regex compilation overhead
- Better code readability and maintainability
- Preserved all existing functionality and test coverage
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 542d5b9 commit 94aa2d5
File tree
12 files changed
+1022
-273
lines changed- batchata
- core
- providers/anthropic
- docs
- tests
- providers/anthropic
12 files changed
+1022
-273
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| |||
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
81 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
82 | 86 | | |
83 | 87 | | |
84 | 88 | | |
| |||
0 commit comments