addSegment = function (linesToTranslate, text, localize) {
    if (text.length >= MAX_CHAR_IN_REQUEST) {
        // break it up into smaller segments and add it to the batchRequest payload
        let splitRegExp = new RegExp(`(.{${MAX_CHAR_IN_REQUEST}})`);
        let splitLine = text.split(splitRegExp).filter(O => O);
        splitLine.forEach(item => {
            linesToTranslate.push(new translateLine(item, localize));
        })
    } else {
        linesToTranslate.push(new translateLine(text, localize));
    }
}
Helper function to break down input string if it is longer than MAX_CHAR_IN_REQUEST to translate API
@param {translateLine []} linesToTranslate Array of translateLine objects
@param {string} text text to translate
@param {boolean} localize indicates if the request should be localized or not.
@returns {void}