Concatenates a word array to this word array.

@param {WordArray} wordArray The word array to append.

@return {WordArray} This word array.

@example

wordArray1.concat(wordArray2);
762974
function (wordArray) {
            // Shortcuts
            var thisWords = this.words;
            var thatWords = wordArray.words;
            var thisSigBytes = this.sigBytes;
            var thatSigBytes = wordArray.sigBytes;

            // Clamp excess bits
            this.clamp();

            // Concat
            if (thisSigBytes % 4) {
                // Copy one byte at a time
                for (var i = 0; i < thatSigBytes; i++) {
                    var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
                    thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);
                }
            } else {
                // Copy one word at a time
                for (var i = 0; i < thatSigBytes; i += 4) {
                    thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];
                }
            }
            this.sigBytes += thatSigBytes;

            // Chainable
            return this;
        }
953612
public static void append(String key, String[] words) {

        SmartForest<List<String>> synonyms = get(key);

        Set<String> set = new HashSet<>();

        for (String word : words) {
            if (StringUtil.isBlank(word)) {
                continue;
            }
            set.add(word);
        }

        if (set.size() <= 1) {
            LOG.warn(Arrays.toString(words) + " not have any change because it less than 2 word");
            return;
        }

        set.addAll(findAllWords(key, words));

        List<String> list = new ArrayList<>(set);

        for (String word : list) {
            synonyms.addBranch(word, list);
        }
    }
1147636
@SafeVarargs
    public final WordBuilder<I> append(Word<? extends I>... words) {
        if (words.length == 0) {
            return this;
        }

        int allLen = 0;
        for (Word<? extends I> w : words) {
            allLen += w.length();
        }

        ensureAdditionalCapacity(allLen);

        for (Word<? extends I> word : words) {
            int wLen = word.length();
            word.writeToArray(0, array, length, wLen);
            length += wLen;
        }

        return this;
    }
783561
public static <T> String join(T[] array, CharSequence conjunction) {
		return join(array, conjunction, null, null);
	}
760565
function mergeArray(a, b) {
  var adds = [];
  var ai = 0;

  for (var i = 0; i < b.length; i++) {
    if (('object' === type(a[i]) && 'object' === type(b[i]))
    ||  ('array' === type(a[i]) && 'array' === type(b[i]))) {
      a[i] = merge(a[i], b[i]);
    } else if ('object' === type(b[i])) {
      adds.push(merge({}, b[i]));
    } else if ('array' === type(b[i])) {
      adds.push(merge([], b[i]));
    } else if (!~a.indexOf(b[i])) {
      adds.push(b[i]);
    }
  }

  for (; ai < adds.length; ai++) {
    a.push(adds[ai]);
  }

  return a;
}
317308
public static int[] concatArrays(int[] a, int[] b) {
        final int alen = a.length;
        final int blen = b.length;
        if (alen == 0) {
            return b;
        }
        if (blen == 0) {
            return a;
        }
        final int[] result = new int[alen + blen];
        arraycopy(a, 0, result, 0, alen);
        arraycopy(b, 0, result, alen, blen);
        return result;
    }
893948
public ToStringBuilder append(final Object[] array) {
        style.append(buffer, null, array, null);
        return this;
    }
404726
function append_article(concater,items,depth){
    // append article body
    for(var index in items){
        // append section 
        let sub = "\\";
        if(depth < 3){
            for(var i=0;i<depth;i++){
                sub += `sub`;
            }
            sub += `section{${items[index].title}}\n\n`;
        }
        else{
            // FIXME: not being tested!
            sub += `paragraph{${items[index].title}}\n\n`;
        }
        concater += sub;
        // base on type to do different thing
        for(var c_index in items[index].content){
            switch(items[index].content[c_index].type){
                case "none":
                    concater += `{\\large ${items[index].content[c_index].name}}\\\\\n\n`;
                    for(var t_index in items[index].content[c_index].data){
                        concater += `${items[index].content[c_index].data[t_index].info}\\\\\n`
                    }
                    concater += `\n`;
                break;
                case "text":
                    concater += `${items[index].content[c_index].name}\n\\begin{itemize}\n\n`;
                    for(var t_index in items[index].content[c_index].data){
                        concater += `\\item ${items[index].content[c_index].data[t_index].info}\\\\\n`
                    }
                    concater += `\\end{itemize}\n`;
                break;
                case "list":
                    // append title
                    concater += `${items[index].content[c_index].name}\n\n`;
                    let list_concat = "";
                    // append function 
                    let nested = append_nested(list_concat,items[index].content[c_index].data);
                    concater += nested;
                    concater += `\n\n`;
                break;
                case "table":
                    // construct table title
                    concater += `\\begin{tabular}{ |`;
                    for(var i=0;i<items[index].content[c_index].data.length;i++){
                        concater += `p{3cm}|`
                    }
                    concater += ` }\n\\hline\n`;
                    concater += `\\multicolumn{${items[index].content[c_index].data.length}}{|c|}{${items[index].content[c_index].name}} \\\\\n\n`
                    // add column 
                    let column_title = [];
                    let row_obj = [];
                    for(var d_index in items[index].content[c_index].data){
                        // push title
                        column_title.push(items[index].content[c_index].data[d_index].title);
                        // create row object
                        for(var v_index in items[index].content[c_index].data[d_index].value){
                            // insert by index (reverse)
                            row_obj.push(items[index].content[c_index].data[d_index].value[v_index]);
                        }
                    }
                    // generate column title
                    concater += `\\hline\n`;
                    for(var i in column_title){
                        if(i != 0) concater += `&`;
                        concater += `${column_title[i]}`;
                    }
                    concater += `\\\\\n`;
                    // generate column value
                    concater += `\\hline\n`;
                    for(var i=0;i<(row_obj.length/items[index].content[c_index].data.length);i++){
                        for(var j=0;j<items[index].content[c_index].data.length;j++){
                            if(j != 0) concater += `&`;
                            concater += `${row_obj[i+j*(row_obj.length/items[index].content[c_index].data.length)]}`;
                        }
                        concater += `\\\\\n`
                    }
                    concater += `\\hline\n`;
                    concater += `\\end{tabular}\n\n`;
                break;
                case "formula": 
                    concater += `${items[index].content[c_index].name}\n\n`;
                    for(var t_index in items[index].content[c_index].data){
                        if(items[index].content[c_index].data[t_index].info != undefined){
                            concater += `${items[index].content[c_index].data[t_index].info}\n`;
                        }
                        if(items[index].content[c_index].data[t_index].inline != undefined){
                            // stripping (Test for non-latex format)
                            // items[index].content[c_index].data[t_index].inline = utils.strip_latex_format(items[index].content[c_index].data[t_index].inline,'\\(','\\)')
                            concater += `${items[index].content[c_index].data[t_index].inline}\n`;
                        }
                        if(items[index].content[c_index].data[t_index].display != undefined){
                            // stripping (Test for non-latex format)
                            // items[index].content[c_index].data[t_index].display = utils.strip_latex_format(items[index].content[c_index].data[t_index].display,'\\[','\\]');
                            concater += `${items[index].content[c_index].data[t_index].display}\n`;
                        }
                        if(items[index].content[c_index].data[t_index].equation != undefined){
                            concater += `\n\\begin{equation}\n${items[index].content[c_index].data[t_index].equation}\n\\end{equation}\n`;
                        }
                    }
                    concater += `\n`;
                break;
                case "code":
                    concater += `${items[index].content[c_index].name}\n\n`;
                    for(var t_index in items[index].content[c_index].data){
                        concater += `\\begin{lstlisting}[language=${items[index].content[c_index].data[t_index].lang}, caption=${items[index].content[c_index].data[t_index].caption}]\n`;
                        if(items[index].content[c_index].data[t_index].src != undefined){
                            // read from file
                            let raw = fs.readFileSync(items[index].content[c_index].data[t_index].src,'utf-8');
                            concater += `${raw}\n`;
                        }
                        else if(items[index].content[c_index].data[t_index].raw != undefined){
                            concater += `${items[index].content[c_index].data[t_index].raw}\n`;
                        }
                        concater += `\\end{lstlisting}\n\n`;
                    }
                break;
                case "figure":
                    concater += `${items[index].content[c_index].name}\n\n`;
                    for(var t_index in items[index].content[c_index].data){
                        if(items[index].content[c_index].data[t_index].path != ""){
                            if(items[index].content[c_index].data[t_index].size == "") items[index].content[c_index].data[t_index].size = 1;
                            // legal path
                            concater += `\\begin{figure}[H]\n\\begin{${items[index].content[c_index].data[t_index].align}}\n`;
                            concater += `\\includegraphics[width=${items[index].content[c_index].data[t_index].size}\\textwidth]{${items[index].content[c_index].data[t_index].path}}\n`;
                            concater += `\\caption{${items[index].content[c_index].data[t_index].caption}}\n`;
                            concater += `\\end{${items[index].content[c_index].data[t_index].align}}\n\\end{figure}\n\n`;
                        }
                    }
                break;
                case "web-restful-api":
                    concater += `${items[index].content[c_index].name}\n\n`;
                    for(var t_index in items[index].content[c_index].data){
                        concater += `\\begin{tcolorbox}[title={${items[index].content[c_index].data[t_index].usage}}]\n`;
                        concater += `\\textbf{Method:} ${items[index].content[c_index].data[t_index].method}\\\\\n`
                        concater += `\\textbf{Url:} ${items[index].content[c_index].data[t_index].url}\\\\\n`
                        concater += `\\textbf{Description:} ${items[index].content[c_index].data[t_index].description}\\\\\n`
                        // Add table for field -> append table
                        concater += `\\textbf{Parameter:}\\\\\n`;
                        concater += `\\begin{center}\n\\begin{tabular}{ | l | r | }\n`
                        concater += `\\hline\n`
                        concater += `\\textbf{Field Name} & \\textbf{Data Type} \\\\\n`
                        concater += `\\hline\n`
                        for(var f_index in items[index].content[c_index].data[t_index].field){
                            concater += `${items[index].content[c_index].data[t_index].field[f_index].name} & ${items[index].content[c_index].data[t_index].field[f_index].type}\\\\\n`
                        }
                        concater += `\\hline\n`
                        concater += `\\end{tabular}\\end{center}\n`
                        // message 
                        concater += `\\tcblower\n`
                        concater += `\\textbf{Error Msg:}`
                        for(var e_index in items[index].content[c_index].data[t_index].error){
                            concater += ' '+ items[index].content[c_index].data[t_index].error[e_index];
                        }
                        concater += `\n\\\\\n`
                        concater += `\\textbf{Success Msg:}`
                        for(var e_index in items[index].content[c_index].data[t_index].success){
                            concater += ' ' + items[index].content[c_index].data[t_index].success[e_index];
                        }

                        // end 
                        concater += `\n\\end{tcolorbox}`;
                    }
                break;
                case "graphviz":
                    concater += `${items[index].content[c_index].name}\n\n`;
                    for(var t_index in items[index].content[c_index].data){
                        if(items[index].content[c_index].data[t_index].src != undefined && items[index].content[c_index].data[t_index].src != ""){
                            if(items[index].content[c_index].data[t_index].size == "") items[index].content[c_index].data[t_index].size = 1;
                            // generate from file
                            let result = 'drawFile-'+rs.generate(12).toString();
                            gviz.drawFile(items[index].content[c_index].data[t_index].src,{output:result,dest:os.tmpdir(),type:'png'},(err,msg) => {
                                if(err)
                                    console.log(msg)
                                else{
                                    console.log(`Result image: ${msg.result}\n\n`)
                                }
                            });
                            // Append the filename on it
                            concater += `\\begin{figure}[H]\n\\begin{${items[index].content[c_index].data[t_index].align}}\n`;
                            if(os.type() == "Windows_NT"){
                                concater += `\\includegraphics[width=${items[index].content[c_index].data[t_index].size}\\textwidth]{${path.join(os.tmpdir(),result+'.png').replace(/\\/g,'/')}}\n`;
                            }
                            else{
                                concater += `\\includegraphics[width=${items[index].content[c_index].data[t_index].size}\\textwidth]{${path.join(os.tmpdir(),result+'.png')}}\n`;
                            }
                            concater += `\\caption{${items[index].content[c_index].data[t_index].caption}}\n`;
                            concater += `\\end{${items[index].content[c_index].data[t_index].align}}\n\\end{figure}\n\n`;
                        }
                        else if(items[index].content[c_index].data[t_index].raw != ""){
                            // draw from raw
                            let result = 'drawFile-'+rs.generate(12).toString();
                            gviz.drawRaw(items[index].content[c_index].data[t_index].raw,{output:result,dest:os.tmpdir(),type:'png'},(err,msg) => {
                                if(err)
                                    console.log(msg)
                                else{
                                    if(err)
                                        console.log(msg)
                                    else{
                                        console.log(`Temp file: ${msg.tmpf}\nResult image: ${msg.result}\n\n`)
                                    }
                                }
                            })
                            // Append the filename on it
                            concater += `\\begin{figure}[H]\n\\begin{${items[index].content[c_index].data[t_index].align}}\n`;
                            if(os.type() == "Windows_NT"){
                                concater += `\\includegraphics[width=${items[index].content[c_index].data[t_index].size}\\textwidth]{${path.join(os.tmpdir(),result+'.png').replace(/\\/g,'/')}}\n`;
                            }
                            else{
                                concater += `\\includegraphics[width=${items[index].content[c_index].data[t_index].size}\\textwidth]{${path.join(os.tmpdir(),result+'.png')}}\n`;
                            }
                            concater += `\\caption{${items[index].content[c_index].data[t_index].caption}}\n`;
                            concater += `\\end{${items[index].content[c_index].data[t_index].align}}\n\\end{figure}\n\n`;    
                        }
                    }
                break;
                default:
                    // not match
                break;
            }
            // figure part
            if(items[index].content[c_index].figure != undefined){
                for(var f_index in items[index].content[c_index].figure){
                    if(items[index].content[c_index].figure[f_index].path != ""){
                        if(items[index].content[c_index].figure[f_index].size == "") items[index].content[c_index].figure[f_index].size = 1;
                        // legal path
                        concater += `\\begin{figure}[H]\n\\begin{${items[index].content[c_index].figure[f_index].align}}\n`;
                        concater += `\\includegraphics[width=${items[index].content[c_index].figure[f_index].size}\\textwidth]{${items[index].content[c_index].figure[f_index].path}}\n`;
                        concater += `\\caption{${items[index].content[c_index].figure[f_index].caption}}\n`;
                        concater += `\\end{${items[index].content[c_index].figure[f_index].align}}\n\\end{figure}\n\n`;
                    }
                }
            }
            // detect subarticle
            if(items[index].content[c_index].subarticle != undefined && items[index].content[c_index].subarticle.length >= 1){
                concater = append_article(concater,items[index].content[c_index].subarticle,depth+1);
            }
        }
    }
    return concater;
}
570103
public static INDArray concat(INDArray[] history) {
        INDArray arr = Nd4j.concat(0, history);
        return arr;
    }
631280
function flatten(a) {
  function _reduce(a) { return a.reduce(_flatten, []); }

  function _flatten(a, b) {
    return a.concat(Array.isArray(b) ? _reduce(b) : b);
  }

  return _reduce(a);
}
1198441
function concat(buffers) {
  var size = 0;
  for (var i = 0; i < buffers.length; i++) {
    size += buffers[i].length;
  }

  var concatenated = new Buffer(size);
  for (var cursor = 0, j = 0; j < buffers.length; cursor += buffers[j].length, j++) {
    buffers[j].copy(concatenated, cursor);
  }

  return concatenated;
}
53274
@Override
    public INDArray concat(int dimension, INDArray... toConcat) {
        if (toConcat == null || toConcat.length == 0)
            throw new ND4JIllegalStateException("Can't concatenate 0 arrays");

        if (toConcat.length == 1)
            return toConcat[0];

        // if reusable var wasn't created for this thread, or is smaller then needed - set it to new value
        if (extrazA.get() == null || extrazB.get() == null || extrazSize.get() == null || extrazSize.get() < toConcat.length) {
            extrazA.set(new PointerPointer(toConcat.length));
            extrazB.set(new PointerPointer(toConcat.length));
            extrazSize.set(toConcat.length);
        }

        PointerPointer shapeInfoPointers = extrazA.get();
        PointerPointer dataPointers = extrazB.get();
        int sumAlongDim = 0;

        long[] outputShape = ArrayUtil.copy(toConcat[0].shape());

        boolean allScalars = true;

        for (int i = 0; i < toConcat.length; i++) {
            Preconditions.checkState(toConcat[i].rank() == outputShape.length, "Encountered different array ranks for concat: input[0].shape()=%ndShape, input[%s].shape()=%ndShape",
                    toConcat[0], i, toConcat[i]);

            if (toConcat[i].isCompressed())
                Nd4j.getCompressor().decompressi(toConcat[i]);

            Preconditions.checkArgument(toConcat[i].dataType() == toConcat[0].dataType(), "All operands must have same data type: input 0 has type %s, input %s has type %s",
                    toConcat[0].dataType(), i, toConcat[i].dataType());

            allScalars &= toConcat[i].rank() == 0;

            shapeInfoPointers.put(i, toConcat[i].shapeInfoDataBuffer().addressPointer());
            dataPointers.put(i, toConcat[i].data().addressPointer());
            sumAlongDim += toConcat[i].size(dimension);
            for (int j = 0; j < toConcat[i].rank(); j++) {

                if (j != dimension && toConcat[i].size(j) != outputShape[j]) {
                    throw new IllegalArgumentException(
                            "Illegal concatenation at array " + i + " and shape element " + j);
                }
            }


            //log.info("Shape[{}]: {}", i, Arrays.toString(toConcat[i].shapeInfoDataBuffer().asInt()));
        }

        if (allScalars) {
            outputShape = new long[]{sumAlongDim};
        } else {
            outputShape[dimension] = sumAlongDim;
        }

        //PointerPointer dummy = new PointerPointer(new Pointer[] {null});

        INDArray ret = Nd4j.createUninitialized(toConcat[0].dataType(), outputShape, Nd4j.order()).assign(-123);

        nativeOps.concat(null, dimension, toConcat.length,
                    dataPointers, shapeInfoPointers,
                null, null,
                    ret.data().addressPointer(), (LongPointer) ret.shapeInfoDataBuffer().addressPointer(),
                    null, null,
                    //new PointerPointer(new Pointer[] {null}), new PointerPointer(new Pointer[] {null}));
                    null, null);

        return ret;
        // return super.concat(dimension,toConcat);
    }
681923
function WordList(words) {
  this.words = words;
  this.map = Object.create(null);

  for (let i = 0; i < words.length; i++) {
    const word = words[i];
    this.map[word] = i;
  }
}
1197070
function (wordArray) {
            // Shortcuts
            var words = wordArray.words;
            var sigBytes = wordArray.sigBytes;

            // Convert
            var hexChars = [];
            for (var i = 0; i < sigBytes; i++) {
                var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
                hexChars.push((bite >>> 4).toString(16));
                hexChars.push((bite & 0x0f).toString(16));
            }

            return hexChars.join('');
        }
661108
public static String[] appendStrArray(String[] arr, String str) {
		String[] newArr = new String[arr.length + 1];
		System.arraycopy(arr, 0, newArr, 0, arr.length);
		newArr[arr.length] = str;
		return newArr;
	}
557535
public static byte[] concat(byte[]... arrays) {
		int size = 0;
		for (byte[] a: arrays) {
			size += a.length;
		}
		byte[] result = new byte[size];
		int index = 0;
		for (byte[] a: arrays) {
			System.arraycopy(a, 0, result, index, a.length);
			index += a.length;
		}
		return result;
	}
986020
private static String joinString(String[] array) {
    StringBuilder sb = new StringBuilder();
    for (String value : array) {
      if (sb.length() > 0) {
        sb.append(" ");
      }
      sb.append(value);
    }
    return sb.toString();
  }