opener-language-identifier 4.4.1 → 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: 677b72460e849ea75c868ccc3720ecc51949ada502dd24ddb8dbb9a6d0d86059
4
- data.tar.gz: 732a58fb7a5f35d172fc72faebb4a9fd59b3327a140365f71047166781d000d9
3
+ metadata.gz: 253d20b891b0a3bc0778889ef762c44f4067e7965b5458b4e8d4117982e6afd8
4
+ data.tar.gz: 510fe58ee91fedf422f38eafa32acc45aa713948c0ef64aaa0b621bc71458596
5
5
  SHA512:
6
- metadata.gz: e54b3a901fdaaa44fb5772c1227dc9b381a8f335bb9a1e1f10ef8470308d5a84623d56873fa11c13ca8ff32273678a10e509292efb211057884bc487db2fb9da
7
- data.tar.gz: 5719ece6c399d8831fd6020ee865386c1767f5afccaa9bd39bc54f938ff9e1f22e25d40faca45028bbfe436c20b89d0fbd6ac3ac2acaafa748023bff2d5cb87c
6
+ metadata.gz: fd740b775cad26b7174293ec68a530c21d012003f6f4a15f82775087bb0daf269e39e7743e1f04bb0d70ca2ff9f23cf5583c27cecc8ab537c3550059b94bf0c6
7
+ data.tar.gz: 3a91415727e610a98df6263b7fd0ed2f62b7214bc360ce0186527525109a75121c9979693859d3ab86e75d50e76c199e87b62827500fcfb2d1b56154960f252e
@@ -27,6 +27,7 @@ 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
@@ -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.1'
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
@@ -5,7 +5,7 @@ Gem::Specification.new do |gem|
5
5
  gem.version = Opener::LanguageIdentifier::VERSION
6
6
  gem.authors = ['development@olery.com']
7
7
  gem.summary = 'Language identifier for human readable text.'
8
- gem.description = gem.summary + " "
8
+ gem.description = gem.summary
9
9
  gem.homepage = "http://opener-project.github.com/"
10
10
  gem.required_ruby_version = '>= 1.9.2'
11
11
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opener-language-identifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.1
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-11-20 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
14
  name: newrelic_rpm
@@ -156,7 +156,7 @@ dependencies:
156
156
  - - ">="
157
157
  - !ruby/object:Gem::Version
158
158
  version: '0'
159
- description: 'Language identifier for human readable text. '
159
+ description: Language identifier for human readable text.
160
160
  email:
161
161
  executables:
162
162
  - language-identifier
@@ -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.6.2
321
+ rubygems_version: 3.0.9
323
322
  signing_key:
324
323
  specification_version: 4
325
324
  summary: Language identifier for human readable text.