parsekit-bin 0.2.0-aarch64-linux → 0.2.0.1-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.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/ext/parsekit/Cargo.toml +4 -4
- data/ext/parsekit/src/parser.rs +8 -6
- data/lib/parsekit/parsekit.so +0 -0
- data/lib/parsekit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2bf6239f703df75df420aed1aec9acdb7d22b9fc98bf575f2375836444fb07ba
|
|
4
|
+
data.tar.gz: 2304e3bfdf91e300836883be4933cbdf0980ccc69c0488c13926c4035a171a43
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 640bbee023275973183d78c52b7ae3dda4334d1b568045beeaa6dee2f6f05bcdce3dac0f005fb810ece9f79ddc096abbfaf25b12c54dc58e1eef32602cb26b07
|
|
7
|
+
data.tar.gz: 00012caf0497df01d251bbf63645645df4441dc1e5360befca3ae2c94290d6da33912a46cbaa3e7a82eb40e723c36342d2f1d264a301ba56211345f597643ce5
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<img src="/docs/assets/parsekit-wide.png" alt="parsekit" height="80px">
|
|
2
2
|
|
|
3
|
-
[](https://badge.fury.io/rb/parsekit)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
|
|
6
6
|
Native Ruby bindings for the [parser-core](https://crates.io/crates/parser-core) Rust crate, providing high-performance document parsing and text extraction capabilities through Magnus. This gem wraps parser-core to extract text from PDFs, Office documents (DOCX, XLSX), images (with OCR), and more. Part of the ruby-nlp ecosystem.
|
|
@@ -19,7 +19,7 @@ Native Ruby bindings for the [parser-core](https://crates.io/crates/parser-core)
|
|
|
19
19
|
Add this line to your application's Gemfile:
|
|
20
20
|
|
|
21
21
|
```ruby
|
|
22
|
-
gem 'parsekit
|
|
22
|
+
gem 'parsekit'
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
And then execute:
|
|
@@ -29,7 +29,7 @@ And then execute:
|
|
|
29
29
|
Or install it yourself as:
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
|
-
gem install parsekit
|
|
32
|
+
gem install parsekit
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
### Requirements
|
|
@@ -158,7 +158,7 @@ By default, ParseKit bundles Tesseract for zero-dependency OCR support. Advanced
|
|
|
158
158
|
|
|
159
159
|
**Using system Tesseract during installation:**
|
|
160
160
|
```bash
|
|
161
|
-
gem install parsekit
|
|
161
|
+
gem install parsekit -- --no-default-features
|
|
162
162
|
```
|
|
163
163
|
|
|
164
164
|
**For development with system Tesseract:**
|
data/ext/parsekit/Cargo.toml
CHANGED
|
@@ -14,13 +14,13 @@ name = "parsekit"
|
|
|
14
14
|
magnus = { version = "0.8", features = ["rb-sys"] }
|
|
15
15
|
# Document parsing - testing embedded C libraries
|
|
16
16
|
# MuPDF builds from source and statically links
|
|
17
|
-
mupdf = { version = "0.
|
|
17
|
+
mupdf = { version = "0.7", default-features = false, features = [] }
|
|
18
18
|
# OCR - Using tesseract-rs for both system and bundled modes
|
|
19
|
-
tesseract-rs = "0.
|
|
19
|
+
tesseract-rs = "0.2" # Tesseract with optional bundling
|
|
20
20
|
image = "0.25" # Image processing library (match rusty-tesseract's version)
|
|
21
|
-
calamine = "0.
|
|
21
|
+
calamine = "0.35" # Excel parsing
|
|
22
22
|
docx-rs = "0.4" # Word document parsing
|
|
23
|
-
quick-xml = "0.
|
|
23
|
+
quick-xml = "0.40" # XML parsing
|
|
24
24
|
zip = "8.2" # ZIP archive handling for PPTX
|
|
25
25
|
serde_json = "1.0" # JSON parsing
|
|
26
26
|
regex = "1.10" # Text parsing
|
data/ext/parsekit/src/parser.rs
CHANGED
|
@@ -390,23 +390,25 @@ impl Parser {
|
|
|
390
390
|
// Look for text elements (a:t or t)
|
|
391
391
|
let name = e.name();
|
|
392
392
|
let local_name_bytes = name.local_name();
|
|
393
|
-
let local_name
|
|
393
|
+
let local_name = std::str::from_utf8(local_name_bytes.as_ref()).unwrap_or("");
|
|
394
394
|
if local_name == "t" {
|
|
395
395
|
in_text_element = true;
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
398
|
Ok(Event::Text(e)) => {
|
|
399
399
|
if in_text_element {
|
|
400
|
-
let
|
|
401
|
-
|
|
402
|
-
|
|
400
|
+
if let Ok(text) = e.decode() {
|
|
401
|
+
let text_str = text.trim();
|
|
402
|
+
if !text_str.is_empty() {
|
|
403
|
+
text_parts.push(text_str.to_string());
|
|
404
|
+
}
|
|
403
405
|
}
|
|
404
406
|
}
|
|
405
407
|
}
|
|
406
408
|
Ok(Event::End(ref e)) => {
|
|
407
409
|
let name = e.name();
|
|
408
410
|
let local_name_bytes = name.local_name();
|
|
409
|
-
let local_name
|
|
411
|
+
let local_name = std::str::from_utf8(local_name_bytes.as_ref()).unwrap_or("");
|
|
410
412
|
if local_name == "t" {
|
|
411
413
|
in_text_element = false;
|
|
412
414
|
}
|
|
@@ -473,7 +475,7 @@ impl Parser {
|
|
|
473
475
|
loop {
|
|
474
476
|
match reader.read_event_into(&mut buf) {
|
|
475
477
|
Ok(Event::Text(e)) => {
|
|
476
|
-
txt.push_str(e.
|
|
478
|
+
txt.push_str(&e.decode().unwrap_or_default());
|
|
477
479
|
txt.push(' ');
|
|
478
480
|
}
|
|
479
481
|
Ok(Event::Eof) => break,
|
data/lib/parsekit/parsekit.so
CHANGED
|
Binary file
|
data/lib/parsekit/version.rb
CHANGED