ocr-file 0.0.6 → 0.0.7
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 +2 -1
- data/lib/ocr-file/document.rb +7 -1
- data/lib/ocr-file/version.rb +1 -1
- 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: 8b87806d21622a72c6166c35fe4367f5b07135e5e7fab4e8be8b8941f75439dc
|
4
|
+
data.tar.gz: d342a91e9b23f8677784553327ba1cc1c00e1599415512b28226f8e9f6bc55b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ecadeeb21a358274bce4ed3d7fce66e53d31ff3abe940ff1b9d77893f12b73bfd41e9ac35324e3a98f004638f9d1906760ef962a3637fbaf48973faeec9a17cb
|
7
|
+
data.tar.gz: 5d4a149dd6d0da1feb723b08c327edab414b75f0b633cea53aaee00d43313d26b84659956957acec7550a822998b76a760b3888770a606d8b4a1f9bb14f807c2
|
data/README.md
CHANGED
@@ -50,9 +50,10 @@ You will need to install `tesseract` with your desired language on your system,
|
|
50
50
|
extract_pdf_images: true, # if false will screenshot each PDF page
|
51
51
|
temp_filename_prefix: 'image',
|
52
52
|
spelling_correction: true, # Will attempt to fix text at the end (not used for searchable pdf output)
|
53
|
+
keep_files: false,
|
53
54
|
# Console Output
|
54
55
|
verbose: true,
|
55
|
-
timing: true
|
56
|
+
timing: true
|
56
57
|
}
|
57
58
|
|
58
59
|
doc = OcrFile::Document.new(
|
data/lib/ocr-file/document.rb
CHANGED
@@ -30,9 +30,10 @@ module OcrFile
|
|
30
30
|
extract_pdf_images: true, # if false will screenshot each PDF page
|
31
31
|
temp_filename_prefix: 'image',
|
32
32
|
spelling_correction: true,
|
33
|
+
keep_files: false,
|
33
34
|
# Console Output
|
34
35
|
verbose: true,
|
35
|
-
timing: true
|
36
|
+
timing: true
|
36
37
|
}
|
37
38
|
|
38
39
|
attr_reader :original_file_path,
|
@@ -118,6 +119,7 @@ module OcrFile
|
|
118
119
|
end
|
119
120
|
|
120
121
|
def close
|
122
|
+
return if keep_files?
|
121
123
|
::OcrFile::FileHelpers.clear_folder(@temp_folder_path)
|
122
124
|
end
|
123
125
|
|
@@ -142,6 +144,10 @@ module OcrFile
|
|
142
144
|
end
|
143
145
|
end
|
144
146
|
|
147
|
+
def keep_files?
|
148
|
+
config['keep_files']
|
149
|
+
end
|
150
|
+
|
145
151
|
def create_temp_folder
|
146
152
|
date = Time.now.to_s.split(' ').first
|
147
153
|
|
data/lib/ocr-file/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ocr-file
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- trex22
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07-
|
11
|
+
date: 2022-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: console-style
|