Module: DTW::Bands
- Defined in:
- lib/dtwrb/bands.rb,
sig/dtwrb.rbs
Defined Under Namespace
Modules: Unconstrained Classes: SakoeChiba, Slanted
Constant Summary collapse
- DEFAULT_RATIO =
Admits warping of up to a quarter of the longer sequence, the usual setting for speech.
0.25- DEFAULT =
SakoeChiba.new(ratio: DEFAULT_RATIO)
- SLANTED =
Slanted.new(ratio: DEFAULT_RATIO)
Class Method Summary collapse
Class Method Details
.resolve(band) ⇒ _Band
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/dtwrb/bands.rb', line 69 def resolve(band) case band when Numeric SakoeChiba.new(ratio: band) when nil, :unconstrained Unconstrained when :sakoe_chiba DEFAULT when :slanted SLANTED else return band if band.respond_to?(:radius) raise( UnknownStrategyError, "unknown band #{band.inspect}: expected a numeric Sakoe-Chiba ratio, :sakoe_chiba, " \ ":slanted, :unconstrained or an object responding to #radius" ) end end |