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 +4 -4
- data/google_translate_diff.gemspec +1 -1
- data/lib/google_translate_diff/cache.rb +1 -1
- data/lib/google_translate_diff/chunker.rb +1 -1
- data/lib/google_translate_diff/redis_cache_store.rb +1 -1
- data/lib/google_translate_diff/redis_rate_limiter.rb +1 -1
- data/lib/google_translate_diff/request.rb +1 -1
- data/lib/google_translate_diff/tokenizer.rb +4 -3
- data/lib/google_translate_diff/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ed822cbbfdfb7a4881c312f484a8cc33a904449
|
4
|
+
data.tar.gz: 3133778cb4507b19b4e55a624f2f0c02807bbbf8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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"
|
47
|
+
spec.add_dependency "ox" #, "< 2.5"
|
48
48
|
spec.add_dependency "dry-initializer"
|
49
49
|
spec.add_dependency "punkt-segmenter"
|
50
50
|
end
|
@@ -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
|
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.
|
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-
|
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: '
|
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: '
|
124
|
+
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: dry-initializer
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|