opener-language-identifier 4.4.0 → 4.4.3

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
  SHA256:
3
- metadata.gz: eebf7674631ee01c80ae1285ab658133ee9da0e35a854aa8c1855f52e04cf27d
4
- data.tar.gz: 05f72d5366f9cfdfaf87d71004a977778284091d3ffc0318f725080126f9a6ce
3
+ metadata.gz: 253d20b891b0a3bc0778889ef762c44f4067e7965b5458b4e8d4117982e6afd8
4
+ data.tar.gz: 510fe58ee91fedf422f38eafa32acc45aa713948c0ef64aaa0b621bc71458596
5
5
  SHA512:
6
- metadata.gz: ab868922fd23754e4a4575372f02f39213a13ddd11fdbdcda8541dc4a63130efb6b2db62f74141915994e0422fe2eb9f03e9f00a0f046a340ae23ae7b50737eb
7
- data.tar.gz: 42d395b265355acf8b15b0d4cb60663c0d9a43dc686c8afb91eb2ae94b554914a0033b2306ce56cc5fd4acc824999526c99680e3f89eb3ba9da127ad6f7ad95a
6
+ metadata.gz: fd740b775cad26b7174293ec68a530c21d012003f6f4a15f82775087bb0daf269e39e7743e1f04bb0d70ca2ff9f23cf5583c27cecc8ab537c3550059b94bf0c6
7
+ data.tar.gz: 3a91415727e610a98df6263b7fd0ed2f62b7214bc360ce0186527525109a75121c9979693859d3ab86e75d50e76c199e87b62827500fcfb2d1b56154960f252e
@@ -27,12 +27,15 @@ module Opener
27
27
  war: :tl,
28
28
  zh: :'zh-cn',
29
29
  'zh-Hant': :'zh-cn',
30
+ 'zh-tw': :'zh-cn',
30
31
  }
31
32
 
32
33
  def initialize
33
34
  DetectLanguage.configure do |config|
34
35
  config.secure = true
35
36
  config.api_key = ENV['DETECT_LANGUAGE_TOKEN']
37
+ config.http_read_timeout = 300
38
+ config.http_open_timeout = 300
36
39
  raise 'no detectlanguage token specified' if config.api_key.nil?
37
40
  end
38
41
  end
@@ -62,9 +62,10 @@ Example:
62
62
  probs: false,
63
63
  )
64
64
 
65
- input = STDIN.tty? ? nil : STDIN.read
66
-
67
- puts identifier.run(input)
65
+ params = JSON.parse(ENV['PARAMS']).transform_keys!(&:to_sym) rescue {}
66
+ input = STDIN.tty? ? nil : STDIN.read
67
+ output = identifier.run input, params
68
+ puts output
68
69
  end
69
70
  end
70
71
  end
@@ -1,7 +1,5 @@
1
1
  module Opener
2
2
  class LanguageIdentifier
3
-
4
- VERSION = '4.4.0'
5
-
3
+ VERSION = '4.4.3'
6
4
  end
7
5
  end
@@ -58,10 +58,10 @@ module Opener
58
58
  # @return [Array]
59
59
  #
60
60
  def run input, params = {}
61
- output = @detector.detect input
62
- output = build_kaf input, output if options[:kaf]
63
-
64
- return output
61
+ lang = params[:language] # already provided, skip detection
62
+ lang ||= @detector.detect input
63
+ lang = build_kaf input, lang if options[:kaf]
64
+ lang
65
65
  end
66
66
 
67
67
  alias identify run
metadata CHANGED
@@ -1,30 +1,31 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opener-language-identifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.0
4
+ version: 4.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - development@olery.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-07 00:00:00.000000000 Z
11
+ date: 2022-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
+ name: newrelic_rpm
14
15
  requirement: !ruby/object:Gem::Requirement
15
16
  requirements:
16
17
  - - ">="
17
18
  - !ruby/object:Gem::Version
18
19
  version: '0'
19
- name: newrelic_rpm
20
- prerelease: false
21
20
  type: :runtime
21
+ prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
+ name: opener-daemons
28
29
  requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
31
  - - "~>"
@@ -33,9 +34,8 @@ dependencies:
33
34
  - - ">="
34
35
  - !ruby/object:Gem::Version
35
36
  version: 2.5.6
36
- name: opener-daemons
37
- prerelease: false
38
37
  type: :runtime
38
+ prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - "~>"
@@ -45,112 +45,112 @@ dependencies:
45
45
  - !ruby/object:Gem::Version
46
46
  version: 2.5.6
47
47
  - !ruby/object:Gem::Dependency
48
+ name: opener-webservice
48
49
  requirement: !ruby/object:Gem::Requirement
49
50
  requirements:
50
51
  - - "~>"
51
52
  - !ruby/object:Gem::Version
52
53
  version: '2.1'
53
- name: opener-webservice
54
- prerelease: false
55
54
  type: :runtime
55
+ prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
60
  version: '2.1'
61
61
  - !ruby/object:Gem::Dependency
62
+ name: builder
62
63
  requirement: !ruby/object:Gem::Requirement
63
64
  requirements:
64
65
  - - ">="
65
66
  - !ruby/object:Gem::Version
66
67
  version: '0'
67
- name: builder
68
- prerelease: false
69
68
  type: :runtime
69
+ prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - ">="
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
75
  - !ruby/object:Gem::Dependency
76
+ name: nokogiri
76
77
  requirement: !ruby/object:Gem::Requirement
77
78
  requirements:
78
79
  - - ">="
79
80
  - !ruby/object:Gem::Version
80
81
  version: '0'
81
- name: nokogiri
82
- prerelease: false
83
82
  type: :runtime
83
+ prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - ">="
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  - !ruby/object:Gem::Dependency
90
+ name: slop
90
91
  requirement: !ruby/object:Gem::Requirement
91
92
  requirements:
92
93
  - - "~>"
93
94
  - !ruby/object:Gem::Version
94
95
  version: '3.5'
95
- name: slop
96
- prerelease: false
97
96
  type: :runtime
97
+ prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
102
  version: '3.5'
103
103
  - !ruby/object:Gem::Dependency
104
+ name: detect_language
104
105
  requirement: !ruby/object:Gem::Requirement
105
106
  requirements:
106
107
  - - ">="
107
108
  - !ruby/object:Gem::Version
108
109
  version: '0'
109
- name: detect_language
110
- prerelease: false
111
110
  type: :runtime
111
+ prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - ">="
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
117
  - !ruby/object:Gem::Dependency
118
+ name: rspec
118
119
  requirement: !ruby/object:Gem::Requirement
119
120
  requirements:
120
121
  - - "~>"
121
122
  - !ruby/object:Gem::Version
122
123
  version: '3.0'
123
- name: rspec
124
- prerelease: false
125
124
  type: :development
125
+ prerelease: false
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  requirements:
128
128
  - - "~>"
129
129
  - !ruby/object:Gem::Version
130
130
  version: '3.0'
131
131
  - !ruby/object:Gem::Dependency
132
+ name: rake
132
133
  requirement: !ruby/object:Gem::Requirement
133
134
  requirements:
134
135
  - - ">="
135
136
  - !ruby/object:Gem::Version
136
137
  version: '0'
137
- name: rake
138
- prerelease: false
139
138
  type: :development
139
+ prerelease: false
140
140
  version_requirements: !ruby/object:Gem::Requirement
141
141
  requirements:
142
142
  - - ">="
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0'
145
145
  - !ruby/object:Gem::Dependency
146
+ name: cliver
146
147
  requirement: !ruby/object:Gem::Requirement
147
148
  requirements:
148
149
  - - ">="
149
150
  - !ruby/object:Gem::Version
150
151
  version: '0'
151
- name: cliver
152
- prerelease: false
153
152
  type: :development
153
+ prerelease: false
154
154
  version_requirements: !ruby/object:Gem::Requirement
155
155
  requirements:
156
156
  - - ">="
@@ -318,8 +318,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
318
318
  - !ruby/object:Gem::Version
319
319
  version: '0'
320
320
  requirements: []
321
- rubyforge_project:
322
- rubygems_version: 2.7.9
321
+ rubygems_version: 3.0.9
323
322
  signing_key:
324
323
  specification_version: 4
325
324
  summary: Language identifier for human readable text.