google_translate_diff 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bc4b2582b8e854e4fcb52e03a56d67cc17c81a80
4
- data.tar.gz: d2b05372dba01af35a3cea4c11e169ada41de9c5
3
+ metadata.gz: 2ed822cbbfdfb7a4881c312f484a8cc33a904449
4
+ data.tar.gz: 3133778cb4507b19b4e55a624f2f0c02807bbbf8
5
5
  SHA512:
6
- metadata.gz: d906d9899926ca75b60eafb5000d1b351cb00bddd416b3e6dbaf37d6a58885295a6f89655f9ad75bdfc60944749db6627de1211cc0728cd1cd9240b53e992179
7
- data.tar.gz: 3e56349941f80eb9e482ba29825c6a7571fd78a0c3c636f2ad88b80230bfcb9f837c5e839fb0a1fd2026c69ab0fe12a1e971d6f13d6cc4cd8763596872f30f8a
6
+ metadata.gz: 86f0a5659a72c951ef45395d372d4791b05409f87d97fac03f70486ef2489dfa14ed7d572cf9bca4520f0ce2ae42bac6ae0d4ff1476bcdc45618939ad047e65c
7
+ data.tar.gz: c9733103ae4137427f3018a8615557a360a52e98f4bb3236d9ead16d11e8551027792998da5c8094ee6949ca7cf2e4d585d65e57a61ae90fa72f787ece5bcb91
@@ -44,7 +44,7 @@ between revisions of long texts.
44
44
  spec.add_development_dependency "simplecov"
45
45
 
46
46
  spec.add_dependency "google-cloud-translate"
47
- spec.add_dependency "ox", "< 2.5"
47
+ spec.add_dependency "ox" #, "< 2.5"
48
48
  spec.add_dependency "dry-initializer"
49
49
  spec.add_dependency "punkt-segmenter"
50
50
  end
@@ -1,5 +1,5 @@
1
1
  class GoogleTranslateDiff::Cache
2
- extend Dry::Initializer::Mixin
2
+ extend Dry::Initializer
3
3
 
4
4
  param :from
5
5
  param :to
@@ -1,5 +1,5 @@
1
1
  class GoogleTranslateDiff::Chunker
2
- extend ::Dry::Initializer::Mixin
2
+ extend ::Dry::Initializer
3
3
 
4
4
  class Error < StandardError; end
5
5
 
@@ -1,5 +1,5 @@
1
1
  class GoogleTranslateDiff::RedisCacheStore
2
- extend Dry::Initializer::Mixin
2
+ extend Dry::Initializer
3
3
 
4
4
  param :connection_pool
5
5
 
@@ -1,5 +1,5 @@
1
1
  class GoogleTranslateDiff::RedisRateLimiter
2
- extend Dry::Initializer::Mixin
2
+ extend Dry::Initializer
3
3
 
4
4
  class RateLimitExceeded < StandardError; end
5
5
 
@@ -1,5 +1,5 @@
1
1
  class GoogleTranslateDiff::Request
2
- extend Dry::Initializer::Mixin
2
+ extend Dry::Initializer
3
3
  extend Forwardable
4
4
 
5
5
  param :values
@@ -64,16 +64,17 @@ class GoogleTranslateDiff::Tokenizer < ::Ox::Sax
64
64
  class << self
65
65
  def tokenize(value)
66
66
  return [] if value.nil?
67
+ tmp = Ox.default_options
68
+ Ox.default_options = HTML_OPTIONS
67
69
  tokenizer = new(value).tap do |h|
68
- # Ox.default_options = {
69
- # mode: :generic, effort: :tolerant, smart: true
70
- # }
71
70
  Ox.sax_parse(h, StringIO.new(value))
72
71
  h.cut_last_token
73
72
  end
73
+ Ox.default_options = tmp
74
74
  tokenizer.tokens
75
75
  end
76
76
  end
77
77
 
78
78
  SKIP = %i[script style].freeze
79
+ HTML_OPTIONS = { mode: :generic, effort: :tolerant, smart: true }.freeze
79
80
  end
@@ -1,3 +1,3 @@
1
1
  module GoogleTranslateDiff
2
- VERSION = "1.0.3".freeze
2
+ VERSION = "1.0.4".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google_translate_diff
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Sokolov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-30 00:00:00.000000000 Z
11
+ date: 2017-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -112,16 +112,16 @@ dependencies:
112
112
  name: ox
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "<"
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: '2.5'
117
+ version: '0'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - "<"
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: '2.5'
124
+ version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: dry-initializer
127
127
  requirement: !ruby/object:Gem::Requirement