github.com/balzaczyy/golucene@v0.0.0-20151210033525-d0be9ee89713/core/util/fst/util.go (about)

     1  package fst
     2  
     3  import (
     4  	"github.com/balzaczyy/golucene/core/util"
     5  )
     6  
     7  // fst/Util.java
     8  
     9  /* Just takes unsigned byte values from the BytesRef and converts into an IntsRef. */
    10  func ToIntsRef(input []byte, scratch *util.IntsRefBuilder) *util.IntsRef {
    11  	scratch.Clear()
    12  	for _, v := range input {
    13  		scratch.Append(int(v))
    14  	}
    15  	return scratch.Get()
    16  }