xberg 1.0.0.pre.rc.42 → 1.0.1
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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/ext/xberg_rb/native/Cargo.lock +54 -25
- data/ext/xberg_rb/native/Cargo.toml +5 -5
- data/ext/xberg_rb/src/lib.rs +98 -1
- data/lib/xberg/native.rb +1 -1
- data/lib/xberg/version.rb +2 -2
- data/lib/xberg.rb +1 -1
- data/lib/xberg_rb.so +0 -0
- data/sig/types.rbs +10 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3e42f004ec632c1b79662972b8326a86ad630232b3959f79cfec2fb12f5baf5a
|
|
4
|
+
data.tar.gz: 63cf4f30361a3ad1b88cbe8710bedb4afef421134173ab065457f4f129ddedf2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cdd62fee277dcad1ade38a4bd08127e9b1bbe5131dc05b4556ce16e04d4e04904bc612db1a30c40e427bf9d35babff96c86ca2d670ad7b108dfd6517e9ed0f38
|
|
7
|
+
data.tar.gz: 34d121faec6d409d71b402d8454d09054cf990390460320b404f04bcc13b9f6238f3172d50f5fb8ae65ecbdf2034413dc81de417a500df4a264e93004b7f70ec
|
data/README.md
CHANGED
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
</a>
|
|
81
81
|
</div>
|
|
82
82
|
|
|
83
|
-
Extract text, tables, images, metadata, and code intelligence from
|
|
83
|
+
Extract text, tables, images, metadata, and code intelligence from 98 file formats and 306 programming languages including PDF, Office documents, images, and audio/video transcripts where native transcription is available. Ruby bindings with idiomatic Ruby API and native performance.
|
|
84
84
|
|
|
85
85
|
## What This Package Provides
|
|
86
86
|
|
|
@@ -827,9 +827,9 @@ dependencies = [
|
|
|
827
827
|
|
|
828
828
|
[[package]]
|
|
829
829
|
name = "calamine"
|
|
830
|
-
version = "0.36.
|
|
830
|
+
version = "0.36.1"
|
|
831
831
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
832
|
-
checksum = "
|
|
832
|
+
checksum = "5fa68281b1a76b54a62156474adb06bb380a67e07dd60656e3217152b42183f3"
|
|
833
833
|
dependencies = [
|
|
834
834
|
"atoi_simd",
|
|
835
835
|
"byteorder",
|
|
@@ -1346,9 +1346,9 @@ dependencies = [
|
|
|
1346
1346
|
|
|
1347
1347
|
[[package]]
|
|
1348
1348
|
name = "crawlberg"
|
|
1349
|
-
version = "1.0.
|
|
1349
|
+
version = "1.0.10"
|
|
1350
1350
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1351
|
-
checksum = "
|
|
1351
|
+
checksum = "cab5814c0d5db694be37a31c5a322dc85027650cb0b09f88ad0b6188ebdfe181"
|
|
1352
1352
|
dependencies = [
|
|
1353
1353
|
"ahash 0.8.12",
|
|
1354
1354
|
"aho-corasick",
|
|
@@ -3406,9 +3406,9 @@ checksum = "47f142fe24a9c9944451e8349de0a56af5f3e7226dc46f3ed4d4ecc0b85af75e"
|
|
|
3406
3406
|
|
|
3407
3407
|
[[package]]
|
|
3408
3408
|
name = "jiff"
|
|
3409
|
-
version = "0.2.
|
|
3409
|
+
version = "0.2.35"
|
|
3410
3410
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3411
|
-
checksum = "
|
|
3411
|
+
checksum = "668b7183bd07af9a4885f5c35b0cc5c83c4607a913c16b7e17291832910d2dcc"
|
|
3412
3412
|
dependencies = [
|
|
3413
3413
|
"defmt",
|
|
3414
3414
|
"jiff-core",
|
|
@@ -3430,9 +3430,9 @@ dependencies = [
|
|
|
3430
3430
|
|
|
3431
3431
|
[[package]]
|
|
3432
3432
|
name = "jiff-static"
|
|
3433
|
-
version = "0.2.
|
|
3433
|
+
version = "0.2.35"
|
|
3434
3434
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3435
|
-
checksum = "
|
|
3435
|
+
checksum = "3a69dcb3a21cfb32ce1cd056169337ca284af0766dd766e7878819b251a49204"
|
|
3436
3436
|
dependencies = [
|
|
3437
3437
|
"jiff-core",
|
|
3438
3438
|
"proc-macro2",
|
|
@@ -3739,6 +3739,18 @@ dependencies = [
|
|
|
3739
3739
|
"libc",
|
|
3740
3740
|
]
|
|
3741
3741
|
|
|
3742
|
+
[[package]]
|
|
3743
|
+
name = "libz-sys"
|
|
3744
|
+
version = "1.1.29"
|
|
3745
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3746
|
+
checksum = "85bc9657773828b90eeb625adff10eeac83cc21bbfd8e23a03eaa8a33c9e28d9"
|
|
3747
|
+
dependencies = [
|
|
3748
|
+
"cc",
|
|
3749
|
+
"libc",
|
|
3750
|
+
"pkg-config",
|
|
3751
|
+
"vcpkg",
|
|
3752
|
+
]
|
|
3753
|
+
|
|
3742
3754
|
[[package]]
|
|
3743
3755
|
name = "link-section"
|
|
3744
3756
|
version = "0.19.1"
|
|
@@ -3765,9 +3777,9 @@ checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0"
|
|
|
3765
3777
|
|
|
3766
3778
|
[[package]]
|
|
3767
3779
|
name = "liter-llm"
|
|
3768
|
-
version = "1.11.
|
|
3780
|
+
version = "1.11.3"
|
|
3769
3781
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3770
|
-
checksum = "
|
|
3782
|
+
checksum = "e9c2f37e8337fa18108051c50b49360effb2d22d797b94d792f99861da092eee"
|
|
3771
3783
|
dependencies = [
|
|
3772
3784
|
"ahash 0.8.12",
|
|
3773
3785
|
"arc-swap",
|
|
@@ -4833,9 +4845,9 @@ dependencies = [
|
|
|
4833
4845
|
|
|
4834
4846
|
[[package]]
|
|
4835
4847
|
name = "pdf_oxide"
|
|
4836
|
-
version = "0.3.
|
|
4848
|
+
version = "0.3.76"
|
|
4837
4849
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
4838
|
-
checksum = "
|
|
4850
|
+
checksum = "a5ec03a138df06a1b063e5053bd957aab153ccfb5a59a326e285b57b3e1bd600"
|
|
4839
4851
|
dependencies = [
|
|
4840
4852
|
"aes 0.9.1",
|
|
4841
4853
|
"base64 0.22.1",
|
|
@@ -7837,9 +7849,9 @@ checksum = "009994f150cc0cd50ff54917d5bc8bffe8cad10ca10d81c34da2ec421ae61782"
|
|
|
7837
7849
|
|
|
7838
7850
|
[[package]]
|
|
7839
7851
|
name = "tree-sitter-language-pack"
|
|
7840
|
-
version = "1.13.
|
|
7852
|
+
version = "1.13.5"
|
|
7841
7853
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
7842
|
-
checksum = "
|
|
7854
|
+
checksum = "445e69b4cdfd2758eeed0badaacd9eb037459aeb4d8bda5f21fb45d8e6958cac"
|
|
7843
7855
|
dependencies = [
|
|
7844
7856
|
"ahash 0.8.12",
|
|
7845
7857
|
"cc",
|
|
@@ -8875,9 +8887,9 @@ dependencies = [
|
|
|
8875
8887
|
|
|
8876
8888
|
[[package]]
|
|
8877
8889
|
name = "xberg"
|
|
8878
|
-
version = "1.0.
|
|
8890
|
+
version = "1.0.1"
|
|
8879
8891
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
8880
|
-
checksum = "
|
|
8892
|
+
checksum = "8fb349741ea65ad8c5dcf178a413a0054fac4cd1e399a1d91abadc0688dbc81b"
|
|
8881
8893
|
dependencies = [
|
|
8882
8894
|
"aes-gcm",
|
|
8883
8895
|
"ahash 0.8.12",
|
|
@@ -8894,6 +8906,7 @@ dependencies = [
|
|
|
8894
8906
|
"cfb 0.14.0",
|
|
8895
8907
|
"chardetng",
|
|
8896
8908
|
"chrono",
|
|
8909
|
+
"codepage",
|
|
8897
8910
|
"comrak",
|
|
8898
8911
|
"crawlberg",
|
|
8899
8912
|
"dbase",
|
|
@@ -8992,6 +9005,7 @@ dependencies = [
|
|
|
8992
9005
|
"whatlang",
|
|
8993
9006
|
"xberg-gliner",
|
|
8994
9007
|
"xberg-libheif",
|
|
9008
|
+
"xberg-libwpd",
|
|
8995
9009
|
"xberg-paddle-ocr",
|
|
8996
9010
|
"xberg-tesseract",
|
|
8997
9011
|
"zeroize",
|
|
@@ -9000,9 +9014,9 @@ dependencies = [
|
|
|
9000
9014
|
|
|
9001
9015
|
[[package]]
|
|
9002
9016
|
name = "xberg-gliner"
|
|
9003
|
-
version = "1.0.
|
|
9017
|
+
version = "1.0.1"
|
|
9004
9018
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9005
|
-
checksum = "
|
|
9019
|
+
checksum = "eeef925ad620d65ef94bb359f4d7ce3bf960eeb3b141f31e6b432a54cc3306b2"
|
|
9006
9020
|
dependencies = [
|
|
9007
9021
|
"getrandom 0.2.17",
|
|
9008
9022
|
"getrandom 0.3.4",
|
|
@@ -9016,9 +9030,9 @@ dependencies = [
|
|
|
9016
9030
|
|
|
9017
9031
|
[[package]]
|
|
9018
9032
|
name = "xberg-libheif"
|
|
9019
|
-
version = "1.0.
|
|
9033
|
+
version = "1.0.1"
|
|
9020
9034
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9021
|
-
checksum = "
|
|
9035
|
+
checksum = "0e5c57720eceaf8669192e70c2b60e2970b589dd39d8d4315dd8e8c40ada5fb3"
|
|
9022
9036
|
dependencies = [
|
|
9023
9037
|
"cfg-if 1.0.4",
|
|
9024
9038
|
"enumn",
|
|
@@ -9027,11 +9041,26 @@ dependencies = [
|
|
|
9027
9041
|
"libheif-sys",
|
|
9028
9042
|
]
|
|
9029
9043
|
|
|
9044
|
+
[[package]]
|
|
9045
|
+
name = "xberg-libwpd"
|
|
9046
|
+
version = "1.0.1"
|
|
9047
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9048
|
+
checksum = "74a0611a3b4d80b95162381848878a928ce3d3abbf50ef043769b9c95edf29c5"
|
|
9049
|
+
dependencies = [
|
|
9050
|
+
"cc",
|
|
9051
|
+
"flate2",
|
|
9052
|
+
"libz-sys",
|
|
9053
|
+
"sha2 0.11.0",
|
|
9054
|
+
"tar",
|
|
9055
|
+
"thiserror 2.0.19",
|
|
9056
|
+
"tracing",
|
|
9057
|
+
]
|
|
9058
|
+
|
|
9030
9059
|
[[package]]
|
|
9031
9060
|
name = "xberg-paddle-ocr"
|
|
9032
|
-
version = "1.0.
|
|
9061
|
+
version = "1.0.1"
|
|
9033
9062
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9034
|
-
checksum = "
|
|
9063
|
+
checksum = "534f7bb90aee032ec2130d503a508e1e5f24ad3cbd305a26031645852cf9dfd2"
|
|
9035
9064
|
dependencies = [
|
|
9036
9065
|
"geo-clipper",
|
|
9037
9066
|
"geo-types",
|
|
@@ -9046,7 +9075,7 @@ dependencies = [
|
|
|
9046
9075
|
|
|
9047
9076
|
[[package]]
|
|
9048
9077
|
name = "xberg-rb"
|
|
9049
|
-
version = "1.0.
|
|
9078
|
+
version = "1.0.1"
|
|
9050
9079
|
dependencies = [
|
|
9051
9080
|
"async-trait",
|
|
9052
9081
|
"crawlberg",
|
|
@@ -9061,9 +9090,9 @@ dependencies = [
|
|
|
9061
9090
|
|
|
9062
9091
|
[[package]]
|
|
9063
9092
|
name = "xberg-tesseract"
|
|
9064
|
-
version = "1.0.
|
|
9093
|
+
version = "1.0.1"
|
|
9065
9094
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9066
|
-
checksum = "
|
|
9095
|
+
checksum = "0d839c598c71d536069372e7d726130c354f6aee7d1b10adf0490588f6abc79d"
|
|
9067
9096
|
dependencies = [
|
|
9068
9097
|
"cc",
|
|
9069
9098
|
"cmake",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "xberg-rb"
|
|
3
|
-
version = "1.0.
|
|
3
|
+
version = "1.0.1"
|
|
4
4
|
edition = "2024"
|
|
5
5
|
license = "MIT"
|
|
6
6
|
description = "High-performance document intelligence library"
|
|
@@ -56,7 +56,7 @@ xml = ["xberg/xml"]
|
|
|
56
56
|
|
|
57
57
|
[dependencies]
|
|
58
58
|
async-trait = "0.1"
|
|
59
|
-
crawlberg = { default-features = false, version = "1.0.
|
|
59
|
+
crawlberg = { default-features = false, version = "1.0.10" }
|
|
60
60
|
html-to-markdown-rs = { default-features = false, version = "3.9" }
|
|
61
61
|
magnus = "0.8"
|
|
62
62
|
rb-sys = ">=0.9, <0.9.128"
|
|
@@ -64,10 +64,10 @@ serde = { version = "1", features = ["derive"] }
|
|
|
64
64
|
serde_json = "1"
|
|
65
65
|
tokio = { version = "1", features = ["rt-multi-thread"] }
|
|
66
66
|
[target.'cfg(not(any(target_os = "windows", all(target_os = "macos", target_arch = "x86_64"))))'.dependencies]
|
|
67
|
-
xberg = { version = "1.0.
|
|
67
|
+
xberg = { version = "1.0.1", features = ["full", "pdf", "ocr", "paddle-ocr", "paddle-ocr-types", "layout-detection", "layout-types", "embeddings", "embedding-presets", "reranker", "reranker-presets", "sparse-embeddings", "sparse-embedding-presets", "late-interaction", "late-interaction-presets", "chunking", "keywords-yake", "keywords-rake", "language-detection", "html", "tree-sitter", "office", "email", "archives", "stopwords", "auto-rotate", "auto-rotate-types", "tokio-runtime", "api", "api-types", "mcp", "liter-llm", "quality", "svg", "transcription", "transcription-types", "classification", "captioning", "ner-onnx", "ner-llm", "diff", "markdown-footnotes", "redaction", "enrichment", "heuristics", "presets", "structured", "url-ingestion"] }
|
|
68
68
|
|
|
69
69
|
[target.'cfg(target_os = "windows")'.dependencies]
|
|
70
|
-
xberg = { version = "1.0.
|
|
70
|
+
xberg = { version = "1.0.1", features = ["windows-target"] }
|
|
71
71
|
|
|
72
72
|
[target.'cfg(all(target_os = "macos", target_arch = "x86_64"))'.dependencies]
|
|
73
|
-
xberg = { version = "1.0.
|
|
73
|
+
xberg = { version = "1.0.1", features = ["macos-intel-target"] }
|
data/ext/xberg_rb/src/lib.rs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// This file is auto-generated by alef. DO NOT EDIT.
|
|
2
|
-
// alef:hash:
|
|
2
|
+
// alef:hash:ba94fe4cec719c31f8ac484fcc2aba1d30db0f87dea8b1b6d0257417a4a260e2
|
|
3
3
|
// Re-generate with: alef generate
|
|
4
4
|
#![allow(dead_code, unused_imports, unused_variables)]
|
|
5
5
|
#![allow(
|
|
@@ -2787,6 +2787,7 @@ impl LateInteractionConfig {
|
|
|
2787
2787
|
#[serde(default)]
|
|
2788
2788
|
#[magnus::wrap(class = "Xberg::LayoutDetectionConfig")]
|
|
2789
2789
|
pub struct LayoutDetectionConfig {
|
|
2790
|
+
strategy: LayoutStrategy,
|
|
2790
2791
|
confidence_threshold: Option<f32>,
|
|
2791
2792
|
apply_heuristics: bool,
|
|
2792
2793
|
table_model: TableModel,
|
|
@@ -2836,6 +2837,10 @@ impl LayoutDetectionConfig {
|
|
|
2836
2837
|
let (kwargs_opt,) = args.optional;
|
|
2837
2838
|
let kwargs = kwargs_opt.unwrap_or_else(|| ruby.hash_new());
|
|
2838
2839
|
Ok(Self {
|
|
2840
|
+
strategy: kwargs
|
|
2841
|
+
.get(ruby.to_symbol("strategy"))
|
|
2842
|
+
.and_then(|v| LayoutStrategy::try_convert(v).ok())
|
|
2843
|
+
.unwrap_or_default(),
|
|
2839
2844
|
confidence_threshold: kwargs
|
|
2840
2845
|
.get(ruby.to_symbol("confidence_threshold"))
|
|
2841
2846
|
.and_then(|v| f32::try_convert(v).ok()),
|
|
@@ -2861,6 +2866,10 @@ impl LayoutDetectionConfig {
|
|
|
2861
2866
|
})
|
|
2862
2867
|
}
|
|
2863
2868
|
|
|
2869
|
+
fn strategy(&self) -> LayoutStrategy {
|
|
2870
|
+
self.strategy.clone()
|
|
2871
|
+
}
|
|
2872
|
+
|
|
2864
2873
|
fn confidence_threshold(&self) -> Option<f32> {
|
|
2865
2874
|
self.confidence_threshold
|
|
2866
2875
|
}
|
|
@@ -21015,6 +21024,8 @@ pub struct PdfMetadata {
|
|
|
21015
21024
|
page_count: Option<u32>,
|
|
21016
21025
|
scanned_confidence: Option<f32>,
|
|
21017
21026
|
scanned_pages: Option<Vec<u32>>,
|
|
21027
|
+
layout_gated_pages: Option<Vec<u32>>,
|
|
21028
|
+
layout_gate_reasons: Option<Vec<String>>,
|
|
21018
21029
|
}
|
|
21019
21030
|
|
|
21020
21031
|
unsafe impl IntoValueFromNative for PdfMetadata {}
|
|
@@ -21082,6 +21093,12 @@ impl PdfMetadata {
|
|
|
21082
21093
|
scanned_pages: kwargs
|
|
21083
21094
|
.get(ruby.to_symbol("scanned_pages"))
|
|
21084
21095
|
.and_then(|v| <Vec<u32>>::try_convert(v).ok()),
|
|
21096
|
+
layout_gated_pages: kwargs
|
|
21097
|
+
.get(ruby.to_symbol("layout_gated_pages"))
|
|
21098
|
+
.and_then(|v| <Vec<u32>>::try_convert(v).ok()),
|
|
21099
|
+
layout_gate_reasons: kwargs
|
|
21100
|
+
.get(ruby.to_symbol("layout_gate_reasons"))
|
|
21101
|
+
.and_then(|v| <Vec<String>>::try_convert(v).ok()),
|
|
21085
21102
|
})
|
|
21086
21103
|
}
|
|
21087
21104
|
|
|
@@ -21116,6 +21133,14 @@ impl PdfMetadata {
|
|
|
21116
21133
|
fn scanned_pages(&self) -> Option<Vec<u32>> {
|
|
21117
21134
|
self.scanned_pages.clone()
|
|
21118
21135
|
}
|
|
21136
|
+
|
|
21137
|
+
fn layout_gated_pages(&self) -> Option<Vec<u32>> {
|
|
21138
|
+
self.layout_gated_pages.clone()
|
|
21139
|
+
}
|
|
21140
|
+
|
|
21141
|
+
fn layout_gate_reasons(&self) -> Option<Vec<String>> {
|
|
21142
|
+
self.layout_gate_reasons.clone()
|
|
21143
|
+
}
|
|
21119
21144
|
}
|
|
21120
21145
|
|
|
21121
21146
|
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
|
@@ -23190,6 +23215,48 @@ impl magnus::TryConvert for TableOverlapPreference {
|
|
|
23190
23215
|
unsafe impl IntoValueFromNative for TableOverlapPreference {}
|
|
23191
23216
|
unsafe impl TryConvertOwned for TableOverlapPreference {}
|
|
23192
23217
|
|
|
23218
|
+
#[derive(Clone, Copy, PartialEq, Eq, Debug, serde::Serialize, serde::Deserialize)]
|
|
23219
|
+
#[serde(rename_all = "snake_case")]
|
|
23220
|
+
pub enum LayoutStrategy {
|
|
23221
|
+
Always,
|
|
23222
|
+
Auto,
|
|
23223
|
+
}
|
|
23224
|
+
|
|
23225
|
+
impl Default for LayoutStrategy {
|
|
23226
|
+
fn default() -> Self {
|
|
23227
|
+
Self::Always
|
|
23228
|
+
}
|
|
23229
|
+
}
|
|
23230
|
+
|
|
23231
|
+
impl magnus::IntoValue for LayoutStrategy {
|
|
23232
|
+
fn into_value_with(self, handle: &Ruby) -> magnus::Value {
|
|
23233
|
+
let sym = match self {
|
|
23234
|
+
LayoutStrategy::Always => "always",
|
|
23235
|
+
LayoutStrategy::Auto => "auto",
|
|
23236
|
+
};
|
|
23237
|
+
handle.to_symbol(sym).into_value_with(handle)
|
|
23238
|
+
}
|
|
23239
|
+
}
|
|
23240
|
+
|
|
23241
|
+
impl magnus::TryConvert for LayoutStrategy {
|
|
23242
|
+
fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
|
|
23243
|
+
let s: String = magnus::TryConvert::try_convert(val)?;
|
|
23244
|
+
// Accept the serde wire name (snake_case), the PascalCase Rust variant name,
|
|
23245
|
+
// and a lowercase fallback so fixtures written in any of those styles work.
|
|
23246
|
+
match s.as_str() {
|
|
23247
|
+
"always" | "Always" => Ok(LayoutStrategy::Always),
|
|
23248
|
+
"auto" | "Auto" => Ok(LayoutStrategy::Auto),
|
|
23249
|
+
other => Err(magnus::Error::new(
|
|
23250
|
+
unsafe { Ruby::get_unchecked() }.exception_arg_error(),
|
|
23251
|
+
format!("invalid LayoutStrategy value: {other}"),
|
|
23252
|
+
)),
|
|
23253
|
+
}
|
|
23254
|
+
}
|
|
23255
|
+
}
|
|
23256
|
+
|
|
23257
|
+
unsafe impl IntoValueFromNative for LayoutStrategy {}
|
|
23258
|
+
unsafe impl TryConvertOwned for LayoutStrategy {}
|
|
23259
|
+
|
|
23193
23260
|
#[derive(Clone, Copy, PartialEq, Eq, Debug, serde::Serialize, serde::Deserialize)]
|
|
23194
23261
|
#[serde(rename_all = "snake_case")]
|
|
23195
23262
|
pub enum CallMode {
|
|
@@ -31462,6 +31529,7 @@ impl From<xberg::LateInteractionConfig> for LateInteractionConfig {
|
|
|
31462
31529
|
impl From<LayoutDetectionConfig> for xberg::LayoutDetectionConfig {
|
|
31463
31530
|
fn from(val: LayoutDetectionConfig) -> Self {
|
|
31464
31531
|
Self {
|
|
31532
|
+
strategy: val.strategy.into(),
|
|
31465
31533
|
confidence_threshold: val.confidence_threshold,
|
|
31466
31534
|
apply_heuristics: val.apply_heuristics,
|
|
31467
31535
|
table_model: val.table_model.into(),
|
|
@@ -31477,6 +31545,7 @@ impl From<LayoutDetectionConfig> for xberg::LayoutDetectionConfig {
|
|
|
31477
31545
|
impl From<xberg::LayoutDetectionConfig> for LayoutDetectionConfig {
|
|
31478
31546
|
fn from(val: xberg::LayoutDetectionConfig) -> Self {
|
|
31479
31547
|
Self {
|
|
31548
|
+
strategy: val.strategy.into(),
|
|
31480
31549
|
confidence_threshold: val.confidence_threshold,
|
|
31481
31550
|
apply_heuristics: val.apply_heuristics,
|
|
31482
31551
|
table_model: val.table_model.into(),
|
|
@@ -35987,6 +36056,8 @@ impl From<PdfMetadata> for xberg::pdf::metadata::PdfMetadata {
|
|
|
35987
36056
|
page_count: val.page_count,
|
|
35988
36057
|
scanned_confidence: val.scanned_confidence,
|
|
35989
36058
|
scanned_pages: val.scanned_pages.map(|v| v.into_iter().collect()),
|
|
36059
|
+
layout_gated_pages: val.layout_gated_pages.map(|v| v.into_iter().collect()),
|
|
36060
|
+
layout_gate_reasons: val.layout_gate_reasons.map(|v| v.into_iter().collect()),
|
|
35990
36061
|
..Default::default()
|
|
35991
36062
|
}
|
|
35992
36063
|
}
|
|
@@ -36004,6 +36075,8 @@ impl From<xberg::pdf::metadata::PdfMetadata> for PdfMetadata {
|
|
|
36004
36075
|
page_count: val.page_count,
|
|
36005
36076
|
scanned_confidence: val.scanned_confidence,
|
|
36006
36077
|
scanned_pages: val.scanned_pages.map(|v| v.into_iter().collect()),
|
|
36078
|
+
layout_gated_pages: val.layout_gated_pages.map(|v| v.into_iter().collect()),
|
|
36079
|
+
layout_gate_reasons: val.layout_gate_reasons.map(|v| v.into_iter().collect()),
|
|
36007
36080
|
}
|
|
36008
36081
|
}
|
|
36009
36082
|
}
|
|
@@ -36667,6 +36740,24 @@ impl From<xberg::core::config::layout::TableOverlapPreference> for TableOverlapP
|
|
|
36667
36740
|
}
|
|
36668
36741
|
}
|
|
36669
36742
|
|
|
36743
|
+
impl From<LayoutStrategy> for xberg::LayoutStrategy {
|
|
36744
|
+
fn from(val: LayoutStrategy) -> Self {
|
|
36745
|
+
match val {
|
|
36746
|
+
LayoutStrategy::Always => Self::Always,
|
|
36747
|
+
LayoutStrategy::Auto => Self::Auto,
|
|
36748
|
+
}
|
|
36749
|
+
}
|
|
36750
|
+
}
|
|
36751
|
+
|
|
36752
|
+
impl From<xberg::LayoutStrategy> for LayoutStrategy {
|
|
36753
|
+
fn from(val: xberg::LayoutStrategy) -> Self {
|
|
36754
|
+
match val {
|
|
36755
|
+
xberg::LayoutStrategy::Always => Self::Always,
|
|
36756
|
+
xberg::LayoutStrategy::Auto => Self::Auto,
|
|
36757
|
+
}
|
|
36758
|
+
}
|
|
36759
|
+
}
|
|
36760
|
+
|
|
36670
36761
|
impl From<CallMode> for xberg::CallMode {
|
|
36671
36762
|
fn from(val: CallMode) -> Self {
|
|
36672
36763
|
match val {
|
|
@@ -39178,6 +39269,8 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
|
|
|
39178
39269
|
|
|
39179
39270
|
class.define_singleton_method("new", function!(LayoutDetectionConfig::new, -1))?;
|
|
39180
39271
|
|
|
39272
|
+
class.define_method("strategy", method!(LayoutDetectionConfig::strategy, 0))?;
|
|
39273
|
+
|
|
39181
39274
|
class.define_method(
|
|
39182
39275
|
"confidence_threshold",
|
|
39183
39276
|
method!(LayoutDetectionConfig::confidence_threshold, 0),
|
|
@@ -42190,6 +42283,10 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
|
|
|
42190
42283
|
|
|
42191
42284
|
class.define_method("scanned_pages", method!(PdfMetadata::scanned_pages, 0))?;
|
|
42192
42285
|
|
|
42286
|
+
class.define_method("layout_gated_pages", method!(PdfMetadata::layout_gated_pages, 0))?;
|
|
42287
|
+
|
|
42288
|
+
class.define_method("layout_gate_reasons", method!(PdfMetadata::layout_gate_reasons, 0))?;
|
|
42289
|
+
|
|
42193
42290
|
let class = module.define_class("ChunkClassificationEnrichmentConfig", ruby.class_object())?;
|
|
42194
42291
|
|
|
42195
42292
|
class.define_singleton_method("new", function!(ChunkClassificationEnrichmentConfig::new, -1))?;
|
data/lib/xberg/native.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# This file is auto-generated by alef — DO NOT EDIT.
|
|
2
|
-
# alef:hash:
|
|
2
|
+
# alef:hash:ba94fe4cec719c31f8ac484fcc2aba1d30db0f87dea8b1b6d0257417a4a260e2
|
|
3
3
|
# To regenerate: alef generate
|
|
4
4
|
# To verify freshness: alef verify --exit-code
|
|
5
5
|
# frozen_string_literal: true
|
data/lib/xberg/version.rb
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# This file is auto-generated by alef — DO NOT EDIT.
|
|
2
|
-
# alef:hash:
|
|
2
|
+
# alef:hash:ba94fe4cec719c31f8ac484fcc2aba1d30db0f87dea8b1b6d0257417a4a260e2
|
|
3
3
|
# To regenerate: alef generate
|
|
4
4
|
# To verify freshness: alef verify --exit-code
|
|
5
5
|
# frozen_string_literal: true
|
|
6
6
|
|
|
7
7
|
module Xberg
|
|
8
8
|
## The version string for this package.
|
|
9
|
-
VERSION = "1.0.
|
|
9
|
+
VERSION = "1.0.1"
|
|
10
10
|
end
|
data/lib/xberg.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# This file is auto-generated by alef — DO NOT EDIT.
|
|
2
|
-
# alef:hash:
|
|
2
|
+
# alef:hash:ba94fe4cec719c31f8ac484fcc2aba1d30db0f87dea8b1b6d0257417a4a260e2
|
|
3
3
|
# To regenerate: alef generate
|
|
4
4
|
# To verify freshness: alef verify --exit-code
|
|
5
5
|
# frozen_string_literal: true
|
data/lib/xberg_rb.so
CHANGED
|
Binary file
|
data/sig/types.rbs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# This file is auto-generated by alef — DO NOT EDIT.
|
|
2
|
-
# alef:hash:
|
|
2
|
+
# alef:hash:ba94fe4cec719c31f8ac484fcc2aba1d30db0f87dea8b1b6d0257417a4a260e2
|
|
3
3
|
# To regenerate: alef generate
|
|
4
4
|
# To verify freshness: alef verify --exit-code
|
|
5
5
|
|
|
@@ -302,6 +302,7 @@ def initialize: (?results: Array[ExtractedDocument], ?errors: Array[ExtractionEr
|
|
|
302
302
|
end
|
|
303
303
|
|
|
304
304
|
class LayoutDetectionConfig
|
|
305
|
+
attr_accessor strategy: LayoutStrategy?
|
|
305
306
|
attr_accessor confidence_threshold: Float?
|
|
306
307
|
attr_accessor apply_heuristics: bool?
|
|
307
308
|
attr_accessor table_model: TableModel?
|
|
@@ -309,7 +310,7 @@ def initialize: (?results: Array[ExtractedDocument], ?errors: Array[ExtractionEr
|
|
|
309
310
|
attr_accessor acceleration: AccelerationConfig?
|
|
310
311
|
attr_accessor enable_chart_understanding: bool?
|
|
311
312
|
|
|
312
|
-
def initialize: (?confidence_threshold: Float, ?apply_heuristics: bool, ?table_model: TableModel, ?table_overlap_preference: TableOverlapPreference, ?acceleration: AccelerationConfig, ?enable_chart_understanding: bool) -> void
|
|
313
|
+
def initialize: (?strategy: LayoutStrategy, ?confidence_threshold: Float, ?apply_heuristics: bool, ?table_model: TableModel, ?table_overlap_preference: TableOverlapPreference, ?acceleration: AccelerationConfig, ?enable_chart_understanding: bool) -> void
|
|
313
314
|
def self.default: () -> LayoutDetectionConfig
|
|
314
315
|
end
|
|
315
316
|
|
|
@@ -2257,8 +2258,10 @@ def initialize: (page_width: Integer, page_height: Integer, detections: Array[La
|
|
|
2257
2258
|
attr_accessor page_count: Integer?
|
|
2258
2259
|
attr_accessor scanned_confidence: Float?
|
|
2259
2260
|
attr_accessor scanned_pages: Array[Integer]?
|
|
2261
|
+
attr_accessor layout_gated_pages: Array[Integer]?
|
|
2262
|
+
attr_accessor layout_gate_reasons: Array[String]?
|
|
2260
2263
|
|
|
2261
|
-
def initialize: (?pdf_version: String, ?producer: String, ?is_encrypted: bool, ?width: Integer, ?height: Integer, ?page_count: Integer, ?scanned_confidence: Float, ?scanned_pages: Array[Integer]) -> void
|
|
2264
|
+
def initialize: (?pdf_version: String, ?producer: String, ?is_encrypted: bool, ?width: Integer, ?height: Integer, ?page_count: Integer, ?scanned_confidence: Float, ?scanned_pages: Array[Integer], ?layout_gated_pages: Array[Integer], ?layout_gate_reasons: Array[String]) -> void
|
|
2262
2265
|
end
|
|
2263
2266
|
|
|
2264
2267
|
class ChunkClassificationEnrichmentConfig
|
|
@@ -2466,6 +2469,10 @@ def initialize: (?heading_style: HeadingStyle, ?list_indent_type: ListIndentType
|
|
|
2466
2469
|
type value = :content | :native | :layout
|
|
2467
2470
|
end
|
|
2468
2471
|
|
|
2472
|
+
class LayoutStrategy
|
|
2473
|
+
type value = :always | :auto
|
|
2474
|
+
end
|
|
2475
|
+
|
|
2469
2476
|
class CallMode
|
|
2470
2477
|
type value = :text_only | :vision_only | :text_plus_vision
|
|
2471
2478
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: xberg
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Na'aman Hirschfeld <naaman@xberg.io>
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-07-
|
|
11
|
+
date: 2026-07-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rb_sys
|