github.com/balzaczyy/golucene@v0.0.0-20151210033525-d0be9ee89713/analysis/util/charUtils.go (about) 1 package util 2 3 import ( 4 "github.com/balzaczyy/golucene/core/util" 5 "unicode" 6 ) 7 8 // util/CharacterUtils.java 9 10 type CharacterUtilsSPI interface{} 11 12 /* 13 Characterutils provides a unified interface to Character-related 14 operations to implement backwards compatible character operations 15 based on a version instance. 16 */ 17 type CharacterUtils struct { 18 CharacterUtilsSPI 19 } 20 21 /* Returns a Characters implementation according to the given Version instance. */ 22 func GetCharacterUtils(matchVersion util.Version) *CharacterUtils { 23 return &CharacterUtils{} 24 } 25 26 /* Converts each unicode codepoint to lowerCase via unicode.ToLower(). */ 27 func (cu *CharacterUtils) ToLowerCase(buffer []rune) { 28 for i, v := range buffer { 29 buffer[i] = unicode.ToLower(v) 30 } 31 }