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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/diarize/segment.rb +4 -4
- data/lib/diarize/speaker.rb +2 -5
- data/lib/diarize/version.rb +1 -1
- data/test/segment_test.rb +15 -6
- data/test/speaker_test.rb +3 -2
- data/test/version_test.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81c40e31baa740bf18b34d2de82bab3ae7897461
|
4
|
+
data.tar.gz: 3e987f962651badd8fc8a79d73a718d4660fe532
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c96801c0aa7dbf3409853fd519c18ce68ee291cb294f509ec642059152ac0d8cfc81936afe1b4c21d3ff4440b83e37c09594e36dddbe521e251697715653839f
|
7
|
+
data.tar.gz: a554a9ffc2de0f8f48aa198b7e11d3db639c49efbd941cad920f10453dc2c875ddd776a24c98685a14a3cac24f5890944efb947e1c143c1a8c81e63fada33587
|
data/CHANGELOG.md
CHANGED
data/lib/diarize/segment.rb
CHANGED
@@ -2,15 +2,15 @@ module Diarize
|
|
2
2
|
class Segment
|
3
3
|
include ToRdf
|
4
4
|
|
5
|
-
attr_reader :start, :duration, :
|
5
|
+
attr_reader :start, :duration, :speaker_gender, :bandwidth, :speaker_id
|
6
6
|
|
7
|
-
def initialize(audio, start, duration,
|
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 =
|
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
|
21
|
+
super.merge({'ws' => 'http://wsarchive.prototype0.net/ontology/'})
|
22
22
|
end
|
23
23
|
|
24
24
|
def uri
|
data/lib/diarize/speaker.rb
CHANGED
@@ -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:
|
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
|
-
'
|
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)
|
data/lib/diarize/version.rb
CHANGED
data/test/segment_test.rb
CHANGED
@@ -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
|
-
|
10
|
-
|
11
|
-
assert_equal segment.instance_variable_get('@
|
12
|
-
assert_equal segment.instance_variable_get('@
|
13
|
-
assert_equal segment.instance_variable_get('@
|
14
|
-
assert_equal segment.instance_variable_get('@
|
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
|
data/test/speaker_test.rb
CHANGED
@@ -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?('
|
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?('
|
133
|
+
assert_equal true, as_json.has_key?('sha')
|
133
134
|
end
|
134
135
|
end
|
data/test/version_test.rb
CHANGED