diarize-ruby 0.3.8 → 0.3.9

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
  SHA1:
3
- metadata.gz: a0ca7dc41b19eb2fe4496e20cb87f260ebf52141
4
- data.tar.gz: 85d3e9cda2554f69737ffb11fee7ff0b5e9b54e9
3
+ metadata.gz: 81c40e31baa740bf18b34d2de82bab3ae7897461
4
+ data.tar.gz: 3e987f962651badd8fc8a79d73a718d4660fe532
5
5
  SHA512:
6
- metadata.gz: 219f481f7243ac904a35af383530b0308ddb0476afae76efcd954ac444112f9509080beabbd6797ff3e33266f48e75cce22af25385cf9170572d35c73d9feb61
7
- data.tar.gz: 844543077abb226237e1e6ccdb28a3564a977360361686a820b00e190dd243f0545f8ee8313f25effaf192a4622e543482da561d78ade9567d331ad633515397
6
+ metadata.gz: c96801c0aa7dbf3409853fd519c18ce68ee291cb294f509ec642059152ac0d8cfc81936afe1b4c21d3ff4440b83e37c09594e36dddbe521e251697715653839f
7
+ data.tar.gz: a554a9ffc2de0f8f48aa198b7e11d3db639c49efbd941cad920f10453dc2c875ddd776a24c98685a14a3cac24f5890944efb947e1c143c1a8c81e63fada33587
@@ -1,3 +1,7 @@
1
+ ## [v0.3.9] - 2016-11-29
2
+
3
+ - Segment instances return speaker_id
4
+
1
5
  ## [v0.3.8] - 2016-11-29
2
6
 
3
7
  - Speaker#load_model to return Java object instead of Rjb wrapper
@@ -2,15 +2,15 @@ module Diarize
2
2
  class Segment
3
3
  include ToRdf
4
4
 
5
- attr_reader :start, :duration, :gender, :bandwidth
5
+ attr_reader :start, :duration, :speaker_gender, :bandwidth, :speaker_id
6
6
 
7
- def initialize(audio, start, duration, gender, bandwidth, speaker_id)
7
+ def initialize(audio, start, duration, speaker_gender, bandwidth, speaker_id)
8
8
  @audio = audio
9
9
  @start = start
10
10
  @duration = duration
11
11
  @bandwidth = bandwidth
12
12
  @speaker_id = speaker_id
13
- @speaker_gender = gender
13
+ @speaker_gender = speaker_gender
14
14
  end
15
15
 
16
16
  def speaker
@@ -18,7 +18,7 @@ module Diarize
18
18
  end
19
19
 
20
20
  def namespaces
21
- super.merge 'ws' => 'http://wsarchive.prototype0.net/ontology/'
21
+ super.merge({'ws' => 'http://wsarchive.prototype0.net/ontology/'})
22
22
  end
23
23
 
24
24
  def uri
@@ -160,7 +160,7 @@ module Diarize
160
160
  'ws:model' => model_uri,
161
161
  'ws:mean_log_likelihood' => mean_log_likelihood,
162
162
  'ws:supervector_hash' => supervector.hash.to_s,
163
- 'ws:supervector_sha' => supervector.sha
163
+ 'ws:sha' => supervector.sha
164
164
  }
165
165
  end
166
166
 
@@ -170,7 +170,7 @@ module Diarize
170
170
  'model' => model_uri,
171
171
  'mean_log_likelihood' => mean_log_likelihood,
172
172
  'supervector_hash' => supervector.hash.to_s,
173
- 'supervector_sha' => supervector.sha
173
+ 'sha' => supervector.sha
174
174
  }
175
175
  end
176
176
 
@@ -181,11 +181,8 @@ module Diarize
181
181
  protected
182
182
 
183
183
  def write_gmm(filename, model)
184
- # gmmlist = java.util.ArrayList.new
185
184
  gmmlist = Rjb::JavaObjectWrapper.new("java.util.ArrayList")
186
- # gmmlist << model.components
187
185
  gmmlist.java_object.add(model)
188
- # output = fr.lium.spkDiarization.lib.IOFile.new(filename, 'wb')
189
186
  output = Rjb::import('fr.lium.spkDiarization.lib.IOFile').new(filename, 'wb')
190
187
  output.open
191
188
  Rjb::import('fr.lium.spkDiarization.libModel.ModelIO').writerGMMContainer(output, gmmlist.java_object)
@@ -1,3 +1,3 @@
1
1
  module Diarize
2
- VERSION = "0.3.8"
2
+ VERSION = "0.3.9"
3
3
  end
@@ -6,12 +6,21 @@ class SegmentTest < Test::Unit::TestCase
6
6
 
7
7
  def test_initialize
8
8
  segment = Diarize::Segment.new('audio', 'start', 'duration', 'gender', 'bandwidth', 'speaker_id')
9
- assert_equal segment.instance_variable_get('@audio'), 'audio'
10
- assert_equal segment.instance_variable_get('@start'), 'start'
11
- assert_equal segment.instance_variable_get('@duration'), 'duration'
12
- assert_equal segment.instance_variable_get('@speaker_gender'), 'gender'
13
- assert_equal segment.instance_variable_get('@bandwidth'), 'bandwidth'
14
- assert_equal segment.instance_variable_get('@speaker_id'), 'speaker_id'
9
+
10
+ # instance variables
11
+ assert_equal 'audio', segment.instance_variable_get('@audio')
12
+ assert_equal 'start', segment.instance_variable_get('@start')
13
+ assert_equal 'duration', segment.instance_variable_get('@duration')
14
+ assert_equal 'gender', segment.instance_variable_get('@speaker_gender')
15
+ assert_equal 'bandwidth', segment.instance_variable_get('@bandwidth')
16
+ assert_equal 'speaker_id', segment.instance_variable_get('@speaker_id')
17
+
18
+ # attr readers
19
+ assert_equal 'start', segment.start
20
+ assert_equal 'duration', segment.duration
21
+ assert_equal 'bandwidth', segment.bandwidth
22
+ assert_equal 'gender', segment.speaker_gender
23
+ assert_equal 'speaker_id', segment.speaker_id
15
24
  end
16
25
 
17
26
  def test_speaker
@@ -106,6 +106,7 @@ class SpeakerTest < Test::Unit::TestCase
106
106
  assert_equal true, to_rdf.include?("ws:model")
107
107
  assert_equal true, to_rdf.include?("ws:mean_log_likelihood")
108
108
  assert_equal true, to_rdf.include?("ws:supervector_hash")
109
+ assert_equal true, to_rdf.include?("ws:sha")
109
110
  assert_equal true, to_rdf.include?("https://www.example.com/model/1")
110
111
  end
111
112
 
@@ -117,7 +118,7 @@ class SpeakerTest < Test::Unit::TestCase
117
118
  assert_equal true, as_json.has_key?('model')
118
119
  assert_equal true, as_json.has_key?('mean_log_likelihood')
119
120
  assert_equal true, as_json.has_key?('supervector_hash')
120
- assert_equal true, as_json.has_key?('supervector_sha')
121
+ assert_equal true, as_json.has_key?('sha')
121
122
  end
122
123
 
123
124
  def test_to_json
@@ -129,6 +130,6 @@ class SpeakerTest < Test::Unit::TestCase
129
130
  assert_equal true, as_json.has_key?('model')
130
131
  assert_equal true, as_json.has_key?('mean_log_likelihood')
131
132
  assert_equal true, as_json.has_key?('supervector_hash')
132
- assert_equal true, as_json.has_key?('supervector_sha')
133
+ assert_equal true, as_json.has_key?('sha')
133
134
  end
134
135
  end
@@ -3,7 +3,7 @@ require 'test_helper'
3
3
  class VersionTest < Test::Unit::TestCase
4
4
 
5
5
  def test_current_version
6
- assert_equal "0.3.8", Diarize::VERSION
6
+ assert_equal "0.3.9", Diarize::VERSION
7
7
  end
8
8
 
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diarize-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yves Raimond