ruby_speech 3.0.0 → 3.0.1

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: 1e98208cd9f5203d85d2612483be8bfc76129aa07c355337a27031dc23170f2c
4
- data.tar.gz: 91eeff37a2b0554849485ecc1717ac8f501dc056b1f1e5c9f4617f0fa103637c
3
+ metadata.gz: 96deae2344c54438f2f612999f0b2492de80753501a53de1999f68f9eb83ab2a
4
+ data.tar.gz: 96f18cfbae078b156d40b9dcefd5b1a8e169899760116a08ea5e5b549e2c1353
5
5
  SHA512:
6
- metadata.gz: 428108a63ca40aaab78165237b4d1bfeb12f7c2097bdc567a234c111b609a5450bfff09ec0e257c91a97405645a0acd8a1c7d5a90754a857d57a2849d4670c48
7
- data.tar.gz: 158cf43762cf1fc1180edbf5f4acf28f263859d03801eb54b6a62fd05c1fdee9e1eee75b170aac6dee175a4b872a4adc27f8749e10b82779fd43d6348950bd8b
6
+ metadata.gz: 4525211ca8ef6c50358366a4c76d53322401bdfd3c1e378012e2bba56f029c62ddba9bbe01d78eaa3721268497a251d222bce35a045bde0f02c72ea6ff7fc10e
7
+ data.tar.gz: f68220d2a3b3ed14114beaffbdea5591ef0026c36a86e025d4de6c3871f1eaa797244226b917cd85057592601368427c96f2bd2ec72f42ccfefa485300c90c79
data/.travis.yml CHANGED
@@ -1,26 +1,33 @@
1
+ dist: xenial
1
2
  language: ruby
2
3
  rvm:
3
4
  - 2.1.10
4
5
  - 2.2.10
5
- - 2.3.7
6
- - 2.4.4
6
+ - 2.3.8
7
+ - 2.4.5
8
+ - 2.5.3
9
+ - 2.6.3
7
10
  - jruby-9.1.17.0
8
11
  - jruby-head
9
- - rbx-3
10
12
  - ruby-head
11
13
  jdk:
12
14
  - openjdk8 # for jruby
13
15
  matrix:
16
+ include:
17
+ - rvm: rbx-4
18
+ dist: trusty
19
+ name: Rubinius
14
20
  allow_failures:
15
- - rvm: rbx-3
21
+ - name: Rubinius
16
22
  - rvm: ruby-head
17
- sudo: false
18
23
  addons:
19
24
  apt:
20
25
  packages:
21
26
  - libpcre3
22
27
  - libpcre3-dev
23
- before_install:
24
- - gem install bundler
28
+ env:
29
+ global:
30
+ - JRUBY_OPTS='--debug'
31
+ before_install: rvm list
25
32
  notifications:
26
33
  irc: "irc.freenode.org#adhearsion"
data/CHANGELOG.md CHANGED
@@ -1,4 +1,6 @@
1
- # [develop](https://github.com/benlangfeld/ruby_speech)
1
+ # [3.0.1](https://github.com/benlangfeld/ruby_speech/compare/v3.0.0...v3.0.1) - [2022-02-15](https://rubygems.org/gems/ruby_speech/versions/3.0.1)
2
+ * Misc: Relax dependency limits to allow newer ActiveSupport versions and thus Ruby 3.0
3
+ * Bugfix: Misc performance improvements
2
4
 
3
5
  # [3.0.0](https://github.com/benlangfeld/ruby_speech/compare/v2.4.0...v3.0.0) - [2018-07-10](https://rubygems.org/gems/ruby_speech/versions/3.0.0)
4
6
  * Feature: Loosen and bump Nokogiri version to ~>1.8, >=1.8.3
data/README.md CHANGED
@@ -1,8 +1,7 @@
1
- [![Gem Version](https://badge.fury.io/rb/ruby_speech.png)](https://rubygems.org/gems/ruby_speech)
2
- [![Build Status](https://secure.travis-ci.org/adhearsion/ruby_speech.png?branch=develop)](http://travis-ci.org/adhearsion/ruby_speech)
3
- [![Dependency Status](https://gemnasium.com/adhearsion/ruby_speech.png?travis)](https://gemnasium.com/adhearsion/ruby_speech)
4
- [![Code Climate](https://codeclimate.com/github/adhearsion/ruby_speech.png)](https://codeclimate.com/github/adhearsion/ruby_speech)
5
- [![Coverage Status](https://coveralls.io/repos/adhearsion/ruby_speech/badge.png?branch=develop)](https://coveralls.io/r/adhearsion/ruby_speech)
1
+ [![Gem Version](https://badge.fury.io/rb/ruby_speech.svg)](https://rubygems.org/gems/ruby_speech)
2
+ [![Build Status](https://secure.travis-ci.org/adhearsion/ruby_speech.svg?branch=develop)](http://travis-ci.org/adhearsion/ruby_speech)
3
+ [![Code Climate](https://codeclimate.com/github/adhearsion/ruby_speech.svg)](https://codeclimate.com/github/adhearsion/ruby_speech)
4
+ [![Coverage Status](https://coveralls.io/repos/adhearsion/ruby_speech/badge.svg?branch=develop)](https://coveralls.io/r/adhearsion/ruby_speech)
6
5
 
7
6
  # RubySpeech
8
7
  RubySpeech is a library for constructing and parsing Text to Speech (TTS) and Automatic Speech Recognition (ASR) documents such as [SSML](http://www.w3.org/TR/speech-synthesis), [GRXML](http://www.w3.org/TR/speech-grammar/) and [NLSML](http://www.w3.org/TR/nl-spec/). Such documents can be constructed to be processed by TTS and ASR engines, parsed as the result from such, or used in the implementation of such engines.
@@ -6,6 +6,7 @@ import org.jruby.RubyModule;
6
6
  import org.jruby.RubyObject;
7
7
  import org.jruby.anno.JRubyClass;
8
8
  import org.jruby.anno.JRubyMethod;
9
+ import org.jruby.runtime.Block;
9
10
  import org.jruby.runtime.ObjectAllocator;
10
11
  import org.jruby.runtime.ThreadContext;
11
12
  import org.jruby.runtime.Visibility;
@@ -43,22 +44,26 @@ public class RubySpeechGRXMLMatcher extends RubyObject {
43
44
  }
44
45
  return callMethod(context, "match_for_buffer", buffer);
45
46
  } else if (m.hitEnd()) {
46
- RubyModule potential_match = runtime.getClassFromPath("RubySpeech::GRXML::PotentialMatch");
47
- return potential_match.callMethod(context, "new");
47
+ return getGRXMLType(runtime, "PotentialMatch").newInstance(context, Block.NULL_BLOCK);
48
48
  }
49
- RubyModule nomatch = runtime.getClassFromPath("RubySpeech::GRXML::NoMatch");
50
- return nomatch.callMethod(context, "new");
49
+ return getGRXMLType(runtime, "NoMatch").newInstance(context, Block.NULL_BLOCK);
51
50
  }
52
51
 
53
- public Boolean is_max_match(String buffer)
54
- {
55
- String search_set = "0123456789#*ABCD";
56
- for (int i = 0; i < 16; i++) {
57
- String new_buffer = buffer + search_set.charAt(i);
58
- Matcher m = p.matcher(new_buffer);
59
- if (m.matches()) return false;
52
+ private boolean is_max_match(String buffer) {
53
+ final int len = buffer.length();
54
+ StringBuilder new_buffer = new StringBuilder(len + 1);
55
+ new_buffer.append(buffer).append('\0');
56
+ final String search_set = "0123456789#*ABCD";
57
+ for (int i = 0; i < search_set.length(); i++) {
58
+ new_buffer.setCharAt(len, search_set.charAt(i));
59
+ if (p.matcher(new_buffer).matches()) return false;
60
60
  }
61
61
  return true;
62
62
  }
63
63
 
64
+ private static RubyClass getGRXMLType(final Ruby runtime, final String name) {
65
+ RubyModule grxml = (RubyModule) runtime.getModule("RubySpeech").getConstantAt("GRXML");
66
+ return (RubyClass) grxml.getConstantAt(name);
67
+ }
68
+
64
69
  }
@@ -90,7 +90,7 @@ module RubySpeech
90
90
  # ```
91
91
  #
92
92
  def match(buffer)
93
- find_match buffer.dup
93
+ find_match buffer
94
94
  end
95
95
 
96
96
  private
@@ -1,3 +1,3 @@
1
1
  module RubySpeech
2
- VERSION = "3.0.0"
2
+ VERSION = "3.0.1"
3
3
  end
data/ruby_speech.gemspec CHANGED
@@ -13,8 +13,6 @@ Gem::Specification.new do |s|
13
13
 
14
14
  s.license = 'MIT'
15
15
 
16
- s.rubyforge_project = "ruby_speech"
17
-
18
16
  s.files = `git ls-files`.split("\n")
19
17
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
20
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
@@ -28,7 +26,7 @@ Gem::Specification.new do |s|
28
26
  end
29
27
 
30
28
  s.add_runtime_dependency %q<nokogiri>, ["~> 1.8", ">= 1.8.3"]
31
- s.add_runtime_dependency %q<activesupport>, [">= 3.0.7", "< 5.0.0"]
29
+ s.add_runtime_dependency %q<activesupport>, [">= 3.0.7"]
32
30
 
33
31
  s.add_development_dependency %q<bundler>, [">= 1.0.0"]
34
32
  s.add_development_dependency %q<rspec>, ["~> 3.0"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_speech
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Langfeld
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-10 00:00:00.000000000 Z
11
+ date: 2022-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -37,9 +37,6 @@ dependencies:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
39
  version: 3.0.7
40
- - - "<"
41
- - !ruby/object:Gem::Version
42
- version: 5.0.0
43
40
  type: :runtime
44
41
  prerelease: false
45
42
  version_requirements: !ruby/object:Gem::Requirement
@@ -47,9 +44,6 @@ dependencies:
47
44
  - - ">="
48
45
  - !ruby/object:Gem::Version
49
46
  version: 3.0.7
50
- - - "<"
51
- - !ruby/object:Gem::Version
52
- version: 5.0.0
53
47
  - !ruby/object:Gem::Dependency
54
48
  name: bundler
55
49
  requirement: !ruby/object:Gem::Requirement
@@ -351,8 +345,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
351
345
  - !ruby/object:Gem::Version
352
346
  version: '0'
353
347
  requirements: []
354
- rubyforge_project: ruby_speech
355
- rubygems_version: 2.7.3
348
+ rubygems_version: 3.2.31
356
349
  signing_key:
357
350
  specification_version: 4
358
351
  summary: A Ruby library for TTS & ASR document preparation