Commit 901f666
Add document concatenation script and Makefile targets
Script Features (src/download/concatenate_documents.py):
- Concatenates documents from a directory in reproducible alphabetical order
- Includes table of contents with all file paths
- Adds headers with filename, path, and size for each document
- Handles multiple encodings (UTF-8, UTF-8-sig, latin-1)
- Supports filtering by file extension
- Supports recursive directory search
- Customizable separators between documents
- Optional headers and summary sections
Makefile Targets:
- make concat-docs INPUT_DIR=dir OUTPUT_FILE=file
Generic concatenation with required parameters
Optional: EXTENSIONS=".txt .md" RECURSIVE=true
- make concat-extracted
Concatenates D4D YAML files from data/extracted_by_column/
Creates one file per project column (AI_READI, CHORUS, CM4AI, VOICE)
Output: data/concatenated/{column}_d4d.txt
- make concat-downloads
Concatenates raw downloads from downloads_by_column/
Creates one file per project column
Output: data/concatenated/{column}_raw.txt
Documentation:
- Added comprehensive "Document Concatenation" section to CLAUDE.md
- Documented all command options and use cases
- Updated help menu in Makefile
Use Cases:
- Combine all downloaded dataset documentation for a project
- Create single input documents for LLM processing
- Merge documentation fragments into complete documents
- Aggregate logs or reports from multiple files
Tested with data/extracted_by_column/:
- AI_READI: 6 files → 18K
- CHORUS: 2 files → 4.0K
- CM4AI: 4 files → 6.4K
- VOICE: 4 files → 19K
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent b3a2bd4 commit 901f666
File tree
4 files changed
+401
-0
lines changed- src/download
4 files changed
+401
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
228 | 273 | | |
229 | 274 | | |
230 | 275 | | |
| |||
235 | 280 | | |
236 | 281 | | |
237 | 282 | | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
238 | 286 | | |
239 | 287 | | |
240 | 288 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 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 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
0 commit comments