parsekit-bin 0.2.0 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7973f2a8c97f073189e80eca0d519c35d083a7b7f49fec5711c1244daf26a792
4
- data.tar.gz: 1d51beb427c9f2b2e9556c2c6ce6863573c58c517dad4395fd41102fb4c98a61
3
+ metadata.gz: 70bc69e30ef452bec4a199f7b4e5bffbf69da408d01b2d833ea9fa48397d5bb8
4
+ data.tar.gz: 10b999903a9230199ee768b014f375f248814d3f973e9932c46cc88fb0fd8bd5
5
5
  SHA512:
6
- metadata.gz: 50dfe8c91a81e5a48a064af1d6ff0f888d6862b82822e602d6ab2a1394fffd20b0509a82253dee9a8df98d1d35313c535254b0a7cce701ff17c1d9e5cb99e608
7
- data.tar.gz: 92f85aa149a75c7b469511ceffc5c341540a5bf311015ae2a5c846b52f8b56d6b4056c6bb2a6675c18c4421dd2e80e2c77061d718bdabc1ee540933dcea11c76
6
+ metadata.gz: ab832cf15983e91300be2dc8472d70885a00f6a8821f0ac49539c115b60f7475b61fdbbe85a751a0ad1700d9cf2e008807de4433840703f984e99ceb9669c59f
7
+ data.tar.gz: 88b24994e1968d196d50dfcc812c89d0e23b35454bc3e04fb72b27598f84d2ea7f3a94de160e81de42b5b75fed70a0594ed0664390790a5ff3c5c7d9ff22a1e8
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <img src="/docs/assets/parsekit-wide.png" alt="parsekit" height="80px">
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/parsekit-bin.svg)](https://badge.fury.io/rb/parsekit-bin)
3
+ [![Gem Version](https://badge.fury.io/rb/parsekit.svg)](https://badge.fury.io/rb/parsekit)
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](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-bin'
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-bin
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-bin -- --no-default-features
161
+ gem install parsekit -- --no-default-features
162
162
  ```
163
163
 
164
164
  **For development with system Tesseract:**
@@ -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.8", default-features = false, features = [] }
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.4" # Tesseract with optional bundling
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.36" # Excel parsing
21
+ calamine = "0.35" # Excel parsing
22
22
  docx-rs = "0.4" # Word document parsing
23
- quick-xml = "0.42" # XML parsing
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
@@ -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: &str = local_name_bytes.as_ref();
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 text_str = e.trim();
401
- if !text_str.is_empty() {
402
- text_parts.push(text_str.to_string());
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: &str = local_name_bytes.as_ref();
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.as_ref());
478
+ txt.push_str(&e.decode().unwrap_or_default());
477
479
  txt.push(' ');
478
480
  }
479
481
  Ok(Event::Eof) => break,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ParseKit
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.0.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parsekit-bin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Petersen