xsidurd commited on
Commit
400c46a
·
unverified ·
1 Parent(s): 1f5c1b8

go : implement SetSplitOnWord (#1114)

Browse files

* Go binding: Implement SetSplitOnWord

* Add comment for consistency

bindings/go/params.go CHANGED
@@ -19,6 +19,10 @@ func (p *Params) SetTranslate(v bool) {
19
  p.translate = toBool(v)
20
  }
21
 
 
 
 
 
22
  func (p *Params) SetNoContext(v bool) {
23
  p.no_context = toBool(v)
24
  }
 
19
  p.translate = toBool(v)
20
  }
21
 
22
+ func (p *Params) SetSplitOnWord(v bool) {
23
+ p.split_on_word = toBool(v)
24
+ }
25
+
26
  func (p *Params) SetNoContext(v bool) {
27
  p.no_context = toBool(v)
28
  }
bindings/go/pkg/whisper/context.go CHANGED
@@ -81,6 +81,10 @@ func (context *context) SetSpeedup(v bool) {
81
  context.params.SetSpeedup(v)
82
  }
83
 
 
 
 
 
84
  // Set number of threads to use
85
  func (context *context) SetThreads(v uint) {
86
  context.params.SetThreads(int(v))
 
81
  context.params.SetSpeedup(v)
82
  }
83
 
84
+ func (context *context) SetSplitOnWord(v bool) {
85
+ context.params.SetSplitOnWord(v)
86
+ }
87
+
88
  // Set number of threads to use
89
  func (context *context) SetThreads(v uint) {
90
  context.params.SetThreads(int(v))
bindings/go/pkg/whisper/interface.go CHANGED
@@ -42,6 +42,7 @@ type Context interface {
42
  SetDuration(time.Duration) // Set duration
43
  SetThreads(uint) // Set number of threads to use
44
  SetSpeedup(bool) // Set speedup flag
 
45
  SetTokenThreshold(float32) // Set timestamp token probability threshold
46
  SetTokenSumThreshold(float32) // Set timestamp token sum probability threshold
47
  SetMaxSegmentLength(uint) // Set max segment length in characters
 
42
  SetDuration(time.Duration) // Set duration
43
  SetThreads(uint) // Set number of threads to use
44
  SetSpeedup(bool) // Set speedup flag
45
+ SetSplitOnWord(bool) // Set split on word flag
46
  SetTokenThreshold(float32) // Set timestamp token probability threshold
47
  SetTokenSumThreshold(float32) // Set timestamp token sum probability threshold
48
  SetMaxSegmentLength(uint) // Set max segment length in characters