parsekit-bin 0.1.2-x86_64-linux → 0.2.0-x86_64-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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 69a24c82104c0c2666fe0b8efc32efd31ecf1a9c14ec9f428176c36e36b144e2
4
- data.tar.gz: 0c72a460ddb050b3f8ef3ddef81323bb5ddcd64bfe5b83ea7f2b5489319e6394
3
+ metadata.gz: 074bdac0c52226852cbc5771830851d85f3f812abe703e94b3f8babb97587840
4
+ data.tar.gz: 38b638d1cdbfae3b09dbaf5a105171dcb575d444133bb94e5829affc4d83b66b
5
5
  SHA512:
6
- metadata.gz: 122103c50beb01a232aba35d1a4a2bbc90c48d30bf01334a573bbf5d5f97122404176a9d809e8e79e38b60590916765d2b88f6bdbade816365f4589d98e10a58
7
- data.tar.gz: 6e099842b8612c467d774cf5f60126db1159c6e6f370027aa7529a68517ded425bbfebc8b96929cbeffad9c644655295fcbcb164d31e6ade696a057b5a733823
6
+ metadata.gz: 54b590b41ae482f1408c4203b3130f93b29b0e6167e3279ccc8db6f9d0679e519e84bb7d79fadeb4bde5f0a74892bf6cf45834b64a59fbf60d1b2bc33f1c93de
7
+ data.tar.gz: fa7b38b35c781b52f4c82aef8c39833f89304fd61b5c7898e09d28fe11d236ad576b35b91a11846b6941e6583d5f53420edf85f4451403ad1e5d8330e6f2299c
@@ -14,14 +14,14 @@ 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.5", default-features = false, features = [] }
17
+ mupdf = { version = "0.8", default-features = false, features = [] }
18
18
  # OCR - Using tesseract-rs for both system and bundled modes
19
- tesseract-rs = "0.1" # Tesseract with optional bundling
19
+ tesseract-rs = "0.4" # Tesseract with optional bundling
20
20
  image = "0.25" # Image processing library (match rusty-tesseract's version)
21
- calamine = "0.31" # Excel parsing
21
+ calamine = "0.36" # Excel parsing
22
22
  docx-rs = "0.4" # Word document parsing
23
- quick-xml = "0.38" # XML parsing
24
- zip = "5.0" # ZIP archive handling for PPTX
23
+ quick-xml = "0.42" # XML parsing
24
+ zip = "8.2" # ZIP archive handling for PPTX
25
25
  serde_json = "1.0" # JSON parsing
26
26
  regex = "1.10" # Text parsing
27
27
  encoding_rs = "0.8" # Encoding detection
@@ -242,7 +242,7 @@ impl Parser {
242
242
  // Continue on page errors rather than failing entirely
243
243
  if let Ok(page) = doc.load_page(page_num) {
244
244
  // Extract text from the page
245
- if let Ok(text) = page.to_text() {
245
+ if let Ok(text) = page.to_text_page(mupdf::TextPageFlags::empty()).and_then(|tp| tp.to_text()) {
246
246
  all_text.push_str(&text);
247
247
  all_text.push('\n');
248
248
  }
@@ -390,25 +390,23 @@ 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 = std::str::from_utf8(local_name_bytes.as_ref()).unwrap_or("");
393
+ let local_name: &str = local_name_bytes.as_ref();
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
- 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
- }
400
+ let text_str = e.trim();
401
+ if !text_str.is_empty() {
402
+ text_parts.push(text_str.to_string());
405
403
  }
406
404
  }
407
405
  }
408
406
  Ok(Event::End(ref e)) => {
409
407
  let name = e.name();
410
408
  let local_name_bytes = name.local_name();
411
- let local_name = std::str::from_utf8(local_name_bytes.as_ref()).unwrap_or("");
409
+ let local_name: &str = local_name_bytes.as_ref();
412
410
  if local_name == "t" {
413
411
  in_text_element = false;
414
412
  }
@@ -475,7 +473,7 @@ impl Parser {
475
473
  loop {
476
474
  match reader.read_event_into(&mut buf) {
477
475
  Ok(Event::Text(e)) => {
478
- txt.push_str(&e.decode().unwrap_or_default());
476
+ txt.push_str(e.as_ref());
479
477
  txt.push(' ');
480
478
  }
481
479
  Ok(Event::Eof) => break,
Binary file
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ParseKit
4
- VERSION = "0.1.2"
4
+ VERSION = "0.2.0"
5
5
  end
data/lib/parsekit.rb CHANGED
@@ -2,9 +2,15 @@
2
2
 
3
3
  require_relative "parsekit/version"
4
4
 
5
- # Load the native extension
5
+ # Load the compiled Rust extension. Precompiled (platform) gems install it into a
6
+ # Ruby-ABI-versioned subdir (lib/parsekit/<major.minor>/parsekit.{so,bundle}) so a
7
+ # single fat gem can carry a binary per Ruby version; source/dev builds place it flat
8
+ # at lib/parsekit/parsekit.{so,bundle}. Try the versioned path first, fall back to the
9
+ # flat one. Resolution goes through $LOAD_PATH (`require`, never `require_relative`)
10
+ # because RubyGems installs native extensions outside the gem's lib/ dir.
6
11
  begin
7
- require_relative "parsekit/parsekit"
12
+ RUBY_VERSION =~ /(\d+\.\d+)/
13
+ require "parsekit/#{Regexp.last_match(1)}/parsekit"
8
14
  rescue LoadError
9
15
  require "parsekit/parsekit"
10
16
  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.1.2
4
+ version: 0.2.0
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Chris Petersen
@@ -16,6 +16,9 @@ dependencies:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
18
  version: '0.9'
19
+ - - ">="
20
+ - !ruby/object:Gem::Version
21
+ version: 0.9.129
19
22
  type: :runtime
20
23
  prerelease: false
21
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -23,6 +26,9 @@ dependencies:
23
26
  - - "~>"
24
27
  - !ruby/object:Gem::Version
25
28
  version: '0.9'
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: 0.9.129
26
32
  - !ruby/object:Gem::Dependency
27
33
  name: rake
28
34
  requirement: !ruby/object:Gem::Requirement
@@ -117,17 +123,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
117
123
  requirements:
118
124
  - - ">="
119
125
  - !ruby/object:Gem::Version
120
- version: '3.4'
126
+ version: '4.0'
121
127
  - - "<"
122
128
  - !ruby/object:Gem::Version
123
- version: 3.5.dev
129
+ version: 4.1.dev
124
130
  required_rubygems_version: !ruby/object:Gem::Requirement
125
131
  requirements:
126
132
  - - ">="
127
133
  - !ruby/object:Gem::Version
128
134
  version: '0'
129
135
  requirements: []
130
- rubygems_version: 3.6.9
136
+ rubygems_version: 4.0.20
131
137
  specification_version: 4
132
138
  summary: Ruby document parsing toolkit with PDF and OCR support
133
139
  test_files: []