speech2text 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
File without changes
@@ -19,7 +19,7 @@ module Speech
19
19
  end
20
20
 
21
21
  def to_f
22
- self.total_seconds
22
+ (self.hours.to_i * 3600) + (self.minutes.to_i * 60) + self.seconds.to_f
23
23
  end
24
24
 
25
25
  def self.from_seconds(seconds)
@@ -39,7 +39,8 @@ module Speech
39
39
  end
40
40
 
41
41
  def +(b)
42
- self.to_f + b.to_f
42
+ total = self.to_f + b.to_f
43
+ # puts "total: #{self.to_f} + #{b.to_f} = #{total.inspect}"
43
44
  Duration.from_seconds(self.to_f + b.to_f)
44
45
  end
45
46
 
@@ -61,17 +62,35 @@ if $0 == __FILE__
61
62
  a = Speech::AudioInspector::Duration.new("00:00:12.12")
62
63
  b = Speech::AudioInspector::Duration.new("00:00:02.00")
63
64
 
64
- assert "00:00:14.12", (a + b).to_s
65
+ assert_equal "00:00:14:12", (a + b).to_s
65
66
 
66
67
  a = Speech::AudioInspector::Duration.new("00:10:12.12")
67
68
  b = Speech::AudioInspector::Duration.new("08:00:02.00")
68
69
 
69
- assert "08:10:14:12", (a + b).to_s
70
+ assert_equal "08:10:14:12", (a + b).to_s
70
71
 
71
72
  a = Speech::AudioInspector::Duration.new("02:10:12.12")
72
73
  b = Speech::AudioInspector::Duration.new("08:55:02.10")
73
74
 
74
- assert "11:05:14:22", (a + b).to_s
75
+ assert_equal "11:05:14:22", (a + b).to_s
76
+
77
+ a = Speech::AudioInspector::Duration.new("00:00:12.12")
78
+ b = Speech::AudioInspector::Duration.new("00:00:02.00")
79
+
80
+ a = a + b
81
+ assert_equal "00:00:14:12", a.to_s
82
+ puts a.inspect
83
+
84
+ a = a + b
85
+ puts a.inspect
86
+
87
+ assert_equal "00:00:16:12", a.to_s
88
+
89
+ a = a + b
90
+ puts a.to_s
91
+ assert_equal "00:00:18:12", a.to_s
92
+ puts a.to_s
75
93
  end
94
+
76
95
  end
77
96
  end
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: binary -*-
2
2
  module Speech
3
3
  class Info
4
- VERSION='0.3.3'
4
+ VERSION='0.3.4'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: speech2text
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: