kreuzberg 4.3.5-aarch64-linux

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/.rspec +3 -0
  4. data/.rubocop.yaml +1 -0
  5. data/.rubocop.yml +543 -0
  6. data/Gemfile +8 -0
  7. data/Gemfile.lock +260 -0
  8. data/README.md +399 -0
  9. data/Rakefile +34 -0
  10. data/Steepfile +51 -0
  11. data/examples/async_patterns.rb +283 -0
  12. data/extconf.rb +60 -0
  13. data/kreuzberg.gemspec +253 -0
  14. data/lib/kreuzberg/api_proxy.rb +125 -0
  15. data/lib/kreuzberg/cache_api.rb +67 -0
  16. data/lib/kreuzberg/cli.rb +57 -0
  17. data/lib/kreuzberg/cli_proxy.rb +118 -0
  18. data/lib/kreuzberg/config.rb +1241 -0
  19. data/lib/kreuzberg/djot_content.rb +225 -0
  20. data/lib/kreuzberg/document_structure.rb +204 -0
  21. data/lib/kreuzberg/error_context.rb +136 -0
  22. data/lib/kreuzberg/errors.rb +116 -0
  23. data/lib/kreuzberg/extraction_api.rb +329 -0
  24. data/lib/kreuzberg/mcp_proxy.rb +176 -0
  25. data/lib/kreuzberg/ocr_backend_protocol.rb +40 -0
  26. data/lib/kreuzberg/post_processor_protocol.rb +15 -0
  27. data/lib/kreuzberg/result.rb +712 -0
  28. data/lib/kreuzberg/setup_lib_path.rb +99 -0
  29. data/lib/kreuzberg/types.rb +414 -0
  30. data/lib/kreuzberg/validator_protocol.rb +16 -0
  31. data/lib/kreuzberg/version.rb +5 -0
  32. data/lib/kreuzberg.rb +102 -0
  33. data/lib/kreuzberg_rb.so +0 -0
  34. data/lib/libpdfium.so +0 -0
  35. data/sig/kreuzberg/internal.rbs +184 -0
  36. data/sig/kreuzberg.rbs +1337 -0
  37. data/spec/binding/async_operations_spec.rb +473 -0
  38. data/spec/binding/batch_operations_spec.rb +677 -0
  39. data/spec/binding/batch_spec.rb +360 -0
  40. data/spec/binding/cache_spec.rb +227 -0
  41. data/spec/binding/cli_proxy_spec.rb +85 -0
  42. data/spec/binding/cli_spec.rb +55 -0
  43. data/spec/binding/config_result_spec.rb +377 -0
  44. data/spec/binding/config_spec.rb +419 -0
  45. data/spec/binding/config_validation_spec.rb +377 -0
  46. data/spec/binding/embeddings_spec.rb +816 -0
  47. data/spec/binding/error_handling_spec.rb +399 -0
  48. data/spec/binding/error_recovery_spec.rb +488 -0
  49. data/spec/binding/errors_spec.rb +66 -0
  50. data/spec/binding/font_config_spec.rb +220 -0
  51. data/spec/binding/images_spec.rb +732 -0
  52. data/spec/binding/keywords_extraction_spec.rb +600 -0
  53. data/spec/binding/metadata_types_spec.rb +1253 -0
  54. data/spec/binding/pages_extraction_spec.rb +550 -0
  55. data/spec/binding/plugins/ocr_backend_spec.rb +307 -0
  56. data/spec/binding/plugins/postprocessor_spec.rb +269 -0
  57. data/spec/binding/plugins/validator_spec.rb +273 -0
  58. data/spec/binding/tables_spec.rb +650 -0
  59. data/spec/fixtures/config.toml +38 -0
  60. data/spec/fixtures/config.yaml +41 -0
  61. data/spec/fixtures/invalid_config.toml +3 -0
  62. data/spec/serialization_spec.rb +134 -0
  63. data/spec/smoke/package_spec.rb +177 -0
  64. data/spec/spec_helper.rb +40 -0
  65. data/spec/unit/config/chunking_config_spec.rb +213 -0
  66. data/spec/unit/config/embedding_config_spec.rb +343 -0
  67. data/spec/unit/config/extraction_config_spec.rb +434 -0
  68. data/spec/unit/config/font_config_spec.rb +285 -0
  69. data/spec/unit/config/hierarchy_config_spec.rb +314 -0
  70. data/spec/unit/config/image_extraction_config_spec.rb +209 -0
  71. data/spec/unit/config/image_preprocessing_config_spec.rb +230 -0
  72. data/spec/unit/config/keyword_config_spec.rb +229 -0
  73. data/spec/unit/config/language_detection_config_spec.rb +258 -0
  74. data/spec/unit/config/ocr_config_spec.rb +171 -0
  75. data/spec/unit/config/output_format_spec.rb +380 -0
  76. data/spec/unit/config/page_config_spec.rb +221 -0
  77. data/spec/unit/config/pdf_config_spec.rb +267 -0
  78. data/spec/unit/config/postprocessor_config_spec.rb +290 -0
  79. data/spec/unit/config/tesseract_config_spec.rb +181 -0
  80. data/spec/unit/config/token_reduction_config_spec.rb +251 -0
  81. data/test/metadata_types_test.rb +959 -0
  82. metadata +292 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 4e7a8855affaf95c9e76424a8389a5c8b398022ee7fbfe0cd5f81acd42b4441f
4
+ data.tar.gz: 827920bb1c20a6885dd27c6f96a2144771309b97cde2c31b7c907eb279132584
5
+ SHA512:
6
+ metadata.gz: 6047eb8aa9fd0937981cd300410fa8fd64b4d78938af56c5c66adcb4ef550662d4a407b1b6f5921fff9754cf9af648efb19b623d11110241c6de0d7d266a7890
7
+ data.tar.gz: 9f98e886089fe5994359f5e46185dbb90cb2fc2b4469a3fd0c9b3722fa20fdca75348efcef4bdcdf4c8e9f1d0072728470a84d6af795f68468afbb70b5f85865
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ tmp/
2
+ lib/*.bundle
3
+ lib/*.dylib
4
+ lib/*.so
5
+ lib/*.dll
6
+ lib/*.dylib
7
+ lib/*.so
8
+ lib/*.dll
9
+
10
+ # Vendor directory for local development (symlink to ../../crates/kreuzberg)
11
+ # In CI, this is replaced by the actual vendored crate files
12
+ # Exception: vendor/rb-sys is patched and committed
13
+ !vendor/rb-sys/
14
+ vendor/
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --require spec_helper
2
+ --format documentation
3
+ --color
data/.rubocop.yaml ADDED
@@ -0,0 +1 @@
1
+ inherit_from: .rubocop.yml
data/.rubocop.yml ADDED
@@ -0,0 +1,543 @@
1
+
2
+ plugins:
3
+ - rubocop-performance
4
+ - rubocop-rspec
5
+
6
+ AllCops:
7
+ TargetRubyVersion: 3.2
8
+ NewCops: enable
9
+ SuggestExtensions: false
10
+ Exclude:
11
+ - 'vendor/**/*'
12
+ - 'tmp/**/*'
13
+ - 'lib/**/*.bundle'
14
+ - 'ext/**/*'
15
+
16
+ Style/StringLiterals:
17
+ Enabled: true
18
+ EnforcedStyle: single_quotes
19
+
20
+ Style/StringLiteralsInInterpolation:
21
+ Enabled: true
22
+ EnforcedStyle: single_quotes
23
+
24
+ Style/FrozenStringLiteralComment:
25
+ Enabled: true
26
+ EnforcedStyle: always
27
+
28
+ Style/Documentation:
29
+ Enabled: false
30
+
31
+ Layout/LineLength:
32
+ Max: 120
33
+ AllowedPatterns:
34
+ - '\A\s*#'
35
+ Exclude:
36
+ - 'spec/**/*'
37
+
38
+ Metrics/BlockLength:
39
+ Enabled: true
40
+ Max: 350
41
+ CountComments: false
42
+ CountAsOne: []
43
+
44
+ Metrics/MethodLength:
45
+ Max: 18
46
+ Exclude:
47
+ - 'spec/**/*'
48
+ - 'examples/**/*'
49
+
50
+ Metrics/AbcSize:
51
+ Max: 20
52
+ Exclude:
53
+ - 'spec/**/*'
54
+ - 'examples/**/*'
55
+ - 'lib/kreuzberg/config.rb'
56
+
57
+ Naming/FileName:
58
+ Enabled: true
59
+ Exclude:
60
+ - 'Gemfile'
61
+ - 'Rakefile'
62
+
63
+ RSpec/SpecFilePathFormat:
64
+ Enabled: false
65
+ RSpec/SpecFilePathSuffix:
66
+ Enabled: false
67
+
68
+ RSpec/PendingWithoutReason:
69
+ Enabled: false
70
+
71
+ RSpec/LeakyConstantDeclaration:
72
+ Enabled: false
73
+
74
+ RSpec/UnspecifiedException:
75
+ Enabled: false
76
+
77
+ Lint/ConstantDefinitionInBlock:
78
+ Enabled: false
79
+ Exclude:
80
+ - 'spec/**/*'
81
+
82
+ RSpec/InstanceVariable:
83
+ Enabled: false
84
+
85
+ Gemspec/DevelopmentDependencies:
86
+ Enabled: false
87
+
88
+ Metrics/ParameterLists:
89
+ Max: 14
90
+ Exclude:
91
+ - 'lib/kreuzberg/config.rb'
92
+
93
+ Metrics/CyclomaticComplexity:
94
+ Max: 7
95
+ Exclude:
96
+ - 'lib/kreuzberg/config.rb'
97
+
98
+ Metrics/PerceivedComplexity:
99
+ Max: 12
100
+ Exclude:
101
+ - 'lib/kreuzberg/config.rb'
102
+
103
+ Metrics/ClassLength:
104
+ Exclude:
105
+ - 'lib/kreuzberg/config.rb'
106
+
107
+ RSpec/RepeatedExampleGroupBody:
108
+ Enabled: false
109
+
110
+ RSpec/DescribeClass:
111
+ Enabled: false
112
+
113
+ RSpec/PredicateMatcher:
114
+ Enabled: false
115
+
116
+ Gemspec/AddRuntimeDependency:
117
+ Enabled: true
118
+
119
+ Gemspec/AttributeAssignment:
120
+ Enabled: true
121
+
122
+ Gemspec/DeprecatedAttributeAssignment:
123
+ Enabled: true
124
+
125
+ Gemspec/RequireMFA:
126
+ Enabled: false
127
+
128
+ Layout/EmptyLinesAfterModuleInclusion:
129
+ Enabled: true
130
+
131
+ Layout/LineContinuationLeadingSpace:
132
+ Enabled: true
133
+
134
+ Layout/LineContinuationSpacing:
135
+ Enabled: true
136
+
137
+ Layout/LineEndStringConcatenationIndentation:
138
+ Enabled: true
139
+
140
+ Layout/SpaceBeforeBrackets:
141
+ Enabled: true
142
+
143
+ Lint/AmbiguousAssignment:
144
+ Enabled: true
145
+
146
+ Lint/AmbiguousOperatorPrecedence:
147
+ Enabled: true
148
+
149
+ Lint/AmbiguousRange:
150
+ Enabled: true
151
+
152
+ Lint/ArrayLiteralInRegexp:
153
+ Enabled: true
154
+
155
+ Lint/ConstantOverwrittenInRescue:
156
+ Enabled: true
157
+
158
+ Lint/ConstantReassignment:
159
+ Enabled: true
160
+
161
+ Lint/CopDirectiveSyntax:
162
+ Enabled: true
163
+
164
+ Lint/DeprecatedConstants:
165
+ Enabled: true
166
+
167
+ Lint/DuplicateBranch:
168
+ Enabled: true
169
+
170
+ Lint/DuplicateMagicComment:
171
+ Enabled: true
172
+
173
+ Lint/DuplicateMatchPattern:
174
+ Enabled: true
175
+
176
+ Lint/DuplicateRegexpCharacterClassElement:
177
+ Enabled: true
178
+
179
+ Lint/DuplicateSetElement:
180
+ Enabled: true
181
+
182
+ Lint/EmptyBlock:
183
+ Enabled: true
184
+
185
+ Lint/EmptyClass:
186
+ Enabled: true
187
+
188
+ Lint/EmptyInPattern:
189
+ Enabled: true
190
+
191
+ Lint/HashNewWithKeywordArgumentsAsDefault:
192
+ Enabled: true
193
+
194
+ Lint/IncompatibleIoSelectWithFiberScheduler:
195
+ Enabled: true
196
+
197
+ Lint/ItWithoutArgumentsInBlock:
198
+ Enabled: true
199
+
200
+ Lint/LambdaWithoutLiteralBlock:
201
+ Enabled: true
202
+
203
+ Lint/LiteralAssignmentInCondition:
204
+ Enabled: true
205
+
206
+ Lint/MixedCaseRange:
207
+ Enabled: true
208
+
209
+ Lint/NoReturnInBeginEndBlocks:
210
+ Enabled: true
211
+
212
+ Lint/NonAtomicFileOperation:
213
+ Enabled: true
214
+
215
+ Lint/NumberedParameterAssignment:
216
+ Enabled: true
217
+
218
+ Lint/NumericOperationWithConstantResult:
219
+ Enabled: true
220
+
221
+ Lint/OrAssignmentToConstant:
222
+ Enabled: true
223
+
224
+ Lint/RedundantDirGlobSort:
225
+ Enabled: true
226
+
227
+ Lint/RedundantRegexpQuantifiers:
228
+ Enabled: true
229
+
230
+ Lint/RedundantTypeConversion:
231
+ Enabled: true
232
+
233
+ Lint/RefinementImportMethods:
234
+ Enabled: true
235
+
236
+ Lint/RequireRangeParentheses:
237
+ Enabled: true
238
+
239
+ Lint/RequireRelativeSelfPath:
240
+ Enabled: true
241
+
242
+ Lint/SharedMutableDefault:
243
+ Enabled: true
244
+
245
+ Lint/SuppressedExceptionInNumberConversion:
246
+ Enabled: true
247
+
248
+ Lint/SymbolConversion:
249
+ Enabled: true
250
+
251
+ Lint/ToEnumArguments:
252
+ Enabled: true
253
+
254
+ Lint/TripleQuotes:
255
+ Enabled: true
256
+
257
+ Lint/UnescapedBracketInRegexp:
258
+ Enabled: true
259
+
260
+ Lint/UnexpectedBlockArity:
261
+ Enabled: true
262
+
263
+ Lint/UnmodifiedReduceAccumulator:
264
+ Enabled: true
265
+
266
+ Lint/UselessConstantScoping:
267
+ Enabled: true
268
+
269
+ Lint/UselessDefaultValueArgument:
270
+ Enabled: true
271
+
272
+ Lint/UselessDefined:
273
+ Enabled: true
274
+
275
+ Lint/UselessNumericOperation:
276
+ Enabled: true
277
+
278
+ Lint/UselessOr:
279
+ Enabled: true
280
+
281
+ Lint/UselessRescue:
282
+ Enabled: true
283
+
284
+ Lint/UselessRuby2Keywords:
285
+ Enabled: true
286
+
287
+ Metrics/CollectionLiteralLength:
288
+ Enabled: true
289
+
290
+ Naming/BlockForwarding:
291
+ Enabled: true
292
+
293
+ Naming/PredicateMethod:
294
+ Enabled: true
295
+
296
+ Security/CompoundHash:
297
+ Enabled: true
298
+
299
+ Security/IoMethods:
300
+ Enabled: true
301
+
302
+ Style/AmbiguousEndlessMethodDefinition:
303
+ Enabled: true
304
+
305
+ Style/ArgumentsForwarding:
306
+ Enabled: true
307
+
308
+ Style/ArrayIntersect:
309
+ Enabled: true
310
+
311
+ Style/ArrayIntersectWithSingleElement:
312
+ Enabled: true
313
+
314
+ Style/BitwisePredicate:
315
+ Enabled: true
316
+
317
+ Style/CollectionCompact:
318
+ Enabled: true
319
+
320
+ Style/CollectionQuerying:
321
+ Enabled: true
322
+
323
+ Style/CombinableDefined:
324
+ Enabled: true
325
+
326
+ Style/ComparableBetween:
327
+ Enabled: true
328
+
329
+ Style/ComparableClamp:
330
+ Enabled: true
331
+
332
+ Style/ConcatArrayLiterals:
333
+ Enabled: true
334
+
335
+ Style/DataInheritance:
336
+ Enabled: true
337
+
338
+ Style/DigChain:
339
+ Enabled: true
340
+
341
+ Style/DirEmpty:
342
+ Enabled: true
343
+
344
+ Style/DocumentDynamicEvalDefinition:
345
+ Enabled: true
346
+
347
+ Style/EmptyHeredoc:
348
+ Enabled: true
349
+
350
+ Style/EmptyStringInsideInterpolation:
351
+ Enabled: true
352
+
353
+ Style/EndlessMethod:
354
+ Enabled: true
355
+
356
+ Style/EnvHome:
357
+ Enabled: true
358
+
359
+ Style/ExactRegexpMatch:
360
+ Enabled: true
361
+
362
+ Style/FetchEnvVar:
363
+ Enabled: true
364
+
365
+ Style/FileEmpty:
366
+ Enabled: true
367
+
368
+ Style/FileNull:
369
+ Enabled: true
370
+
371
+ Style/FileRead:
372
+ Enabled: true
373
+
374
+ Style/FileTouch:
375
+ Enabled: true
376
+
377
+ Style/FileWrite:
378
+ Enabled: true
379
+
380
+ Style/HashConversion:
381
+ Enabled: true
382
+
383
+ Style/HashExcept:
384
+ Enabled: true
385
+
386
+ Style/HashFetchChain:
387
+ Enabled: true
388
+
389
+ Style/HashSlice:
390
+ Enabled: true
391
+
392
+ Style/IfWithBooleanLiteralBranches:
393
+ Enabled: true
394
+
395
+ Style/InPatternThen:
396
+ Enabled: true
397
+
398
+ Style/ItAssignment:
399
+ Enabled: true
400
+
401
+ Style/ItBlockParameter:
402
+ Enabled: true
403
+
404
+ Style/KeywordArgumentsMerging:
405
+ Enabled: true
406
+
407
+ Style/MagicCommentFormat:
408
+ Enabled: true
409
+
410
+ Style/MapCompactWithConditionalBlock:
411
+ Enabled: true
412
+
413
+ Style/MapIntoArray:
414
+ Enabled: true
415
+
416
+ Style/MapToHash:
417
+ Enabled: true
418
+
419
+ Style/MapToSet:
420
+ Enabled: true
421
+
422
+ Style/MinMaxComparison:
423
+ Enabled: true
424
+
425
+ Style/MultilineInPatternThen:
426
+ Enabled: true
427
+
428
+ Style/NegatedIfElseCondition:
429
+ Enabled: true
430
+
431
+ Style/NestedFileDirname:
432
+ Enabled: true
433
+
434
+ Style/NilLambda:
435
+ Enabled: true
436
+
437
+ Style/NumberedParameters:
438
+ Enabled: true
439
+
440
+ Style/NumberedParametersLimit:
441
+ Enabled: true
442
+
443
+ Style/ObjectThen:
444
+ Enabled: true
445
+
446
+ Style/OpenStructUse:
447
+ Enabled: true
448
+
449
+ Style/OperatorMethodCall:
450
+ Enabled: true
451
+
452
+ Style/QuotedSymbols:
453
+ Enabled: true
454
+
455
+ Style/RedundantArgument:
456
+ Enabled: true
457
+
458
+ Style/RedundantArrayConstructor:
459
+ Enabled: true
460
+
461
+ Style/RedundantArrayFlatten:
462
+ Enabled: true
463
+
464
+ Style/RedundantConstantBase:
465
+ Enabled: true
466
+
467
+ Style/RedundantCurrentDirectoryInPath:
468
+ Enabled: true
469
+
470
+ Style/RedundantDoubleSplatHashBraces:
471
+ Enabled: true
472
+
473
+ Style/RedundantEach:
474
+ Enabled: true
475
+
476
+ Style/RedundantFilterChain:
477
+ Enabled: true
478
+
479
+ Style/RedundantFormat:
480
+ Enabled: true
481
+
482
+ Style/RedundantHeredocDelimiterQuotes:
483
+ Enabled: true
484
+
485
+ Style/RedundantInitialize:
486
+ Enabled: true
487
+
488
+ Style/RedundantInterpolationUnfreeze:
489
+ Enabled: true
490
+
491
+ Style/RedundantLineContinuation:
492
+ Enabled: true
493
+
494
+ Style/RedundantRegexpArgument:
495
+ Enabled: true
496
+
497
+ Style/RedundantRegexpConstructor:
498
+ Enabled: true
499
+
500
+ Style/RedundantSelfAssignmentBranch:
501
+ Enabled: true
502
+
503
+ Style/RedundantStringEscape:
504
+ Enabled: true
505
+
506
+ Style/ReturnNilInPredicateMethodDefinition:
507
+ Enabled: true
508
+
509
+ Style/SafeNavigationChainLength:
510
+ Enabled: true
511
+
512
+ Style/SelectByRegexp:
513
+ Enabled: true
514
+
515
+ Style/SendWithLiteralMethodName:
516
+ Enabled: true
517
+
518
+ Style/SingleLineDoEndBlock:
519
+ Enabled: true
520
+
521
+ Style/StringChars:
522
+ Enabled: true
523
+
524
+ Style/SuperArguments:
525
+ Enabled: true
526
+
527
+ Style/SuperWithArgsParentheses:
528
+ Enabled: true
529
+
530
+ Style/SwapValues:
531
+ Enabled: true
532
+
533
+ Style/YAMLFileRead:
534
+ Enabled: true
535
+
536
+ RSpec/ExampleLength:
537
+ Max: 50
538
+
539
+ RSpec/MultipleExpectations:
540
+ Max: 25
541
+
542
+ RSpec/NestedGroups:
543
+ Max: 6
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gemspec
6
+
7
+ gem 'pry', '~> 0.14', group: :development
8
+ gem 'pry-byebug', '~> 3.10', group: :development, platforms: %i[ruby mri]