Class: NoyesJava::Segmenter

Inherits:
Object
  • Object
show all
Defined in:
lib/java_impl/segment.rb

Instance Method Summary collapse

Constructor Details

#initialize(win_size, win_shift) ⇒ Segmenter

Returns a new instance of Segmenter.


3
4
5
# File 'lib/java_impl/segment.rb', line 3

def initialize win_size, win_shift
  @filter = Java::talkhouse.Segmenter.new win_size, win_shift
end

Instance Method Details

#<<(data) ⇒ Object


6
7
8
9
# File 'lib/java_impl/segment.rb', line 6

def << data
  java_matrix = @filter.apply data.to_java(:double)
  java_matrix.map {|java_array|java_array.to_a} if java_matrix
end