You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: segment.go
    path of file: ./repos/riot
    
    the code of the file until where you have to start completion: // Copyright 2013 Hui Chen
// Copyright 2016 ego authors
//
// Licensed und
    
func (engine *Engine) splitData(request segmenterReq) (TMap, int) {
	var (
		num       int
		numTokens int
	)
	tokensMap := make(map[string][]int)

	if request.data.Content != "" {
		content := strings.ToLower(request.data.Content)
		if engine.initOptions.Using == 3 {
			// use segmenter
			segments := engine.segmenter.ModeSegment([]byte(content),
				engine.initOptions.GseMode)

			for _, segment := range segments {
				token := segment.Token().Text()
				if !engine.stopTokens.IsStopToken(token) {
					tokensMap[token] = append(tokensMap[token], segment.Start())
				}
			}
			numTokens += len(segments)
		}

		if engine.initOptions.Using == 4 {
			tokensMap, numTokens = engine.defaultTokens(content)
		}

		if engine.initOptions.Using != 4 {
			strData := strings.Split(content, "")
			num = len(strData)
			tokenMap, numToken := engine.ForSplitData(strData, num)
			numTokens += numToken
			for key, val := range tokenMap {
				tokensMap[key] = val
			}
		}
	}

	for _, t := range request.data.Tokens {
		if !engine.stopTokens.IsStopToken(t.Text) {
			tokensMap[t.Text] = t.Locations
		}
	}

	numTokens += len(request.data.Tokens)

	return tokensMap, numTokens
}