parsekit-bin 0.1.2.1 → 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 +4 -4
- data/README.md +4 -4
- data/ext/parsekit/Cargo.toml +5 -5
- data/ext/parsekit/src/parser.rs +1 -1
- data/lib/parsekit/version.rb +1 -1
- data/lib/parsekit.rb +8 -2
- metadata +8 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 70bc69e30ef452bec4a199f7b4e5bffbf69da408d01b2d833ea9fa48397d5bb8
|
|
4
|
+
data.tar.gz: 10b999903a9230199ee768b014f375f248814d3f973e9932c46cc88fb0fd8bd5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
[](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,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.
|
|
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.
|
|
24
|
-
zip = "
|
|
23
|
+
quick-xml = "0.40" # 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
|
data/ext/parsekit/src/parser.rs
CHANGED
|
@@ -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
|
}
|
data/lib/parsekit/version.rb
CHANGED
data/lib/parsekit.rb
CHANGED
|
@@ -2,9 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
require_relative "parsekit/version"
|
|
4
4
|
|
|
5
|
-
# Load the
|
|
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
|
-
|
|
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.
|
|
4
|
+
version: 0.2.0.1
|
|
5
5
|
platform: ruby
|
|
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
|
|
@@ -124,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
124
130
|
- !ruby/object:Gem::Version
|
|
125
131
|
version: '0'
|
|
126
132
|
requirements: []
|
|
127
|
-
rubygems_version: 4.0.
|
|
133
|
+
rubygems_version: 4.0.20
|
|
128
134
|
specification_version: 4
|
|
129
135
|
summary: Ruby document parsing toolkit with PDF and OCR support
|
|
130
136
|
test_files: []
|