sibylla 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d2a8c3c03e63ab8394626efec141e5d3ec11bfd0
4
+ data.tar.gz: 6d1314e0fa83614484471ee09ad44aa6ee55c092
5
+ SHA512:
6
+ metadata.gz: e4659bc302c7a067e14d7f88c061192f49c3025aa8c93aae870db01e762f466b30d91bd42da0b1a03dc56fce9d2bee6c17ef1f9f0eb32c2494e4f87b03c4b479
7
+ data.tar.gz: 08003f606363e411af99aebb37897ffcc029001b8127e511def87ca47156ddbb6ffa1ce67a2994aefee97616b8080758b2f2c93fbd87f34ba7cec75c3827c26f
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+ gem 'fest'
5
+ gem 'pocketsphinx-ruby'
6
+ gem 'coveralls', require: false
@@ -0,0 +1,71 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ sibylla (0.0.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ coveralls (0.8.3)
10
+ json (~> 1.8)
11
+ rest-client (>= 1.6.8, < 2)
12
+ simplecov (~> 0.10.0)
13
+ term-ansicolor (~> 1.3)
14
+ thor (~> 0.19.1)
15
+ diff-lcs (1.2.5)
16
+ docile (1.1.5)
17
+ domain_name (0.5.25)
18
+ unf (>= 0.0.5, < 1.0.0)
19
+ fest (1.4.15)
20
+ ffi (1.9.10)
21
+ http-cookie (1.0.2)
22
+ domain_name (~> 0.5)
23
+ json (1.8.3)
24
+ mime-types (2.6.2)
25
+ netrc (0.10.3)
26
+ pocketsphinx-ruby (0.3.0)
27
+ ffi (>= 1.9)
28
+ rake (10.4.2)
29
+ rest-client (1.8.0)
30
+ http-cookie (>= 1.0.2, < 2.0)
31
+ mime-types (>= 1.16, < 3.0)
32
+ netrc (~> 0.7)
33
+ rspec (3.3.0)
34
+ rspec-core (~> 3.3.0)
35
+ rspec-expectations (~> 3.3.0)
36
+ rspec-mocks (~> 3.3.0)
37
+ rspec-core (3.3.2)
38
+ rspec-support (~> 3.3.0)
39
+ rspec-expectations (3.3.1)
40
+ diff-lcs (>= 1.2.0, < 2.0)
41
+ rspec-support (~> 3.3.0)
42
+ rspec-mocks (3.3.2)
43
+ diff-lcs (>= 1.2.0, < 2.0)
44
+ rspec-support (~> 3.3.0)
45
+ rspec-support (3.3.0)
46
+ simplecov (0.10.0)
47
+ docile (~> 1.1.0)
48
+ json (~> 1.8)
49
+ simplecov-html (~> 0.10.0)
50
+ simplecov-html (0.10.0)
51
+ term-ansicolor (1.3.2)
52
+ tins (~> 1.0)
53
+ thor (0.19.1)
54
+ tins (1.6.0)
55
+ unf (0.1.4)
56
+ unf_ext
57
+ unf_ext (0.0.7.1)
58
+
59
+ PLATFORMS
60
+ ruby
61
+
62
+ DEPENDENCIES
63
+ coveralls
64
+ fest
65
+ pocketsphinx-ruby
66
+ rake (~> 10.4)
67
+ rspec (~> 3.3)
68
+ sibylla!
69
+
70
+ BUNDLED WITH
71
+ 1.10.6
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2014-2015 Alexsey Ermolaev
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,38 @@
1
+ ## SIBYLLA
2
+
3
+ Ruby voice assistant use [Festival](https://wiki.archlinux.org/index.php/Festival_%28%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9%29) and Pocketsphinx ...
4
+
5
+ ## Requirements
6
+
7
+ - *nix* or OS X (pgrep tools) ...
8
+ - [Festival](https://wiki.archlinux.org/index.php/Festival_%28%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9%29) and necessary languages ...
9
+ - [Pulseaudio](https://wiki.archlinux.org/index.php/PulseAudio_%28%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9%29)
10
+ - Sphinxbase
11
+ - Pocketsphinx
12
+
13
+ ## Install
14
+
15
+ ```.ruby
16
+ # Gemfile
17
+ gem 'sibylla'
18
+ ```
19
+ or
20
+ ```.ruby
21
+ $ gem install sibylla
22
+ ```
23
+
24
+ ## Used
25
+ ### Call methods
26
+ ```.ruby
27
+ require 'sibylla'
28
+
29
+ Sibylla::Speech.new('Пример') # => Say 'Пример'
30
+ Sibylla::Speech.new(['Пример', 'два']) # => Say 'Пример - два'
31
+
32
+ ## Configuration
33
+
34
+ Sibylla.configuration # show all params ... ~/.sibylla/.configuration.yml
35
+ Sibylla::Configuration.new(config = {}) # load default and merge params
36
+
37
+ ```
38
+ ## To be continued ...
@@ -0,0 +1,3 @@
1
+ ** 0.0.1 (Сб 17 окт 2015 20:47:02)
2
+ - done configuration ... work for festival and pocketsphinx ...
3
+ - done speech ... with fest ... say string or array ...
@@ -0,0 +1,42 @@
1
+ ---
2
+ festival_params:
3
+ {}
4
+ pocketsphinx_params:
5
+ keyphrase:
6
+ 'Сивилла'
7
+
8
+ # Sibylla::Root = $HOME/.sibylla/
9
+
10
+ hmm:
11
+ - "\"#{Sibylla::Root}/zero_ru.cd_cont_4000\""
12
+ lm:
13
+ - "\"#{Sibylla::Root}/dict/lmbase.lm.DMP\""
14
+
15
+ # no need if set hmm ...
16
+ #
17
+ # tmat:
18
+ # - "\"#{Sibylla::Root}/zero_ru.cd_cont_4000/transition_matrices\""
19
+ # fdict:
20
+ # - "\"#{Sibylla::Root}/zero_ru.cd_cont_4000/noisedict\""
21
+ # featparams:
22
+ # - "\"#{Sibylla::Root}/zero_ru.cd_cont_4000/feat.params\""
23
+ # mdef:
24
+ # - "\"#{Sibylla::Root}/zero_ru.cd_cont_4000/mdef\""
25
+ # mean:
26
+ # - "\"#{Sibylla::Root}/zero_ru.cd_cont_4000/means\""
27
+ # var:
28
+ # - "\"#{Sibylla::Root}/zero_ru.cd_cont_4000/variances\""
29
+ # sendump:
30
+ # - "\"#{Sibylla::Root}/zero_ru.cd_cont_4000/mixture_weights\""
31
+
32
+ # clear inputs ...
33
+ #
34
+ # logfn:
35
+ # '/dev/null'
36
+
37
+ dict:
38
+ - "\"#{Sibylla::Root}/dict/my.dic\""
39
+ vad_threshold:
40
+ 3
41
+ tasks:
42
+ - "\"#{Sibylla::Root}/config/cmds.yml\""
@@ -0,0 +1,22 @@
1
+ # coding: utf-8
2
+ # Ruby voice assistant
3
+ # author Alexsey Ermolaev afay.zangetsu@gmail.com
4
+
5
+ require 'fest'
6
+ require 'yaml'
7
+ require 'pocketsphinx-ruby'
8
+ Dir.glob(File.join('.', 'lib', '**', '*.rb'), &method(:require))
9
+
10
+ module Sibylla
11
+ Root = "#{Dir.home}/.sibylla"
12
+
13
+ class << self
14
+ def configuration
15
+ @configuration ||= Sibylla::Configuration.new
16
+ end
17
+
18
+ def greeting
19
+ Sibylla::Speech.new('Приветствую тебя, Я - Сивилла')
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,34 @@
1
+ module Sibylla
2
+ class Configuration
3
+ def initialize(config = {})
4
+ config =
5
+ YAML.load_file("#{Sibylla::Root}/configuration.yml").merge(config)
6
+ config.each do |key, value|
7
+ value_set(key, value)
8
+
9
+ define_singleton_method("#{key}=") do |val|
10
+ instance_variable_set("@#{key}", val)
11
+ end
12
+
13
+ define_singleton_method(key) do
14
+ instance_variable_get("@#{key}")
15
+ end
16
+ end
17
+ end
18
+
19
+ def value_set(key, value)
20
+ instance_variable_set(
21
+ "@#{key}",
22
+ if value.is_a?(Array)
23
+ eval(value.join('; '))
24
+ elsif value.is_a?(Hash)
25
+ value.each do |k, v|
26
+ value[k] = v.is_a?(Array) ? eval(v.join("; ")) : v
27
+ end
28
+ else
29
+ value
30
+ end
31
+ )
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,12 @@
1
+ module Sibylla
2
+ class Decoder
3
+ def initialize(file)
4
+ configuration = Pocketsphinx::Configuration.default
5
+ Sibylla.configuration.pocketsphinx_params.each do |key, value|
6
+ configuration[key] = value
7
+ end
8
+ decoder = Pocketsphinx::Decoder.new(configuration)
9
+ decoder.decode(file).hypothesis
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # coding: utf-8
2
+ module Sibylla
3
+ class Performer
4
+ def initialize(task)
5
+ unless task.nil?
6
+ eval(task.is_a?(Array) ? task.join('; ') : task)
7
+ else
8
+ Sibylla::Speech.new('Не п+онял команду')
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,4 @@
1
+ module Sibylla
2
+ class Recorder
3
+ end
4
+ end
@@ -0,0 +1,6 @@
1
+ module Sibylla
2
+ class Searcher
3
+ def initialize(query)
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,8 @@
1
+ module Sibylla
2
+ class Speech
3
+ def initialize(string)
4
+ fest = Fest.new(Sibylla.configuration.festival_params)
5
+ fest.say(string.is_a?(Array) ? string.join(" - ") : string)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,23 @@
1
+ Gem::Specification.new do |gem|
2
+ gem.name = 'sibylla'
3
+ gem.version = '0.0.1'
4
+ gem.authors = 'Alexsey Ermolaev'
5
+ gem.email = 'afay.zangetsu@gmail.com'
6
+ gem.homepage = 'https://github.com/AfsmNGhr/sibylla'
7
+ gem.description = 'Ruby voice assistant use festival and pocketsphinx'
8
+ gem.summary = 'Ruby voice assistant'
9
+ gem.license = 'MIT'
10
+
11
+ gem.add_development_dependency 'rake', '~> 10.4'
12
+ gem.add_development_dependency 'rspec', '~> 3.3'
13
+
14
+ gem.files = `git ls-files`.split("\n")
15
+ gem.require_paths = ['lib', 'config']
16
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
17
+
18
+ gem.extra_rdoc_files = ['License.org', 'README.md']
19
+ gem.requirements = ['*nix* or OS X (pgrep, amixer)',
20
+ 'Sphinxbase', 'Pocketsphinx',
21
+ 'Pulseaudio sound server',
22
+ 'Festival speech engine']
23
+ end
metadata ADDED
@@ -0,0 +1,93 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sibylla
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Alexsey Ermolaev
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-10-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '10.4'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '10.4'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.3'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.3'
41
+ description: Ruby voice assistant use festival and pocketsphinx
42
+ email: afay.zangetsu@gmail.com
43
+ executables: []
44
+ extensions: []
45
+ extra_rdoc_files:
46
+ - License.org
47
+ - README.md
48
+ files:
49
+ - Gemfile
50
+ - Gemfile.lock
51
+ - License.org
52
+ - README.md
53
+ - changelog.org
54
+ - example/configuration.yml
55
+ - lib/sibylla.rb
56
+ - lib/sibylla/configuration.rb
57
+ - lib/sibylla/decoder.rb
58
+ - lib/sibylla/performer.rb
59
+ - lib/sibylla/recorder.rb
60
+ - lib/sibylla/searcher.rb
61
+ - lib/sibylla/speech.rb
62
+ - sibylla.gemspec
63
+ homepage: https://github.com/AfsmNGhr/sibylla
64
+ licenses:
65
+ - MIT
66
+ metadata: {}
67
+ post_install_message:
68
+ rdoc_options: []
69
+ require_paths:
70
+ - lib
71
+ - config
72
+ required_ruby_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ requirements:
83
+ - "*nix* or OS X (pgrep, amixer)"
84
+ - Sphinxbase
85
+ - Pocketsphinx
86
+ - Pulseaudio sound server
87
+ - Festival speech engine
88
+ rubyforge_project:
89
+ rubygems_version: 2.5.0
90
+ signing_key:
91
+ specification_version: 4
92
+ summary: Ruby voice assistant
93
+ test_files: []