src/core/preprocess/ReadTextFile.java
public static HashMap<Integer, HashMap<Integer, MMatrix>> readFile(String fileName, int numberOfInputCharacters, int numberOfOutputCharacters, int inputOutputDelta, int skipRowsFromStart) throws FileNotFoundException {
        StringBuilder text = readText(fileName, skipRowsFromStart);

        HashMap<Integer, HashMap<Integer, Integer>> inputData = new HashMap<>();
        HashMap<Integer, HashMap<Integer, Integer>> outputData = new HashMap<>();
        int length = Math.min(text.length() - numberOfInputCharacters, text.length() - numberOfOutputCharacters - inputOutputDelta) + 1;
        for (int pos = 0; pos < length; pos++) {
            HashMap<Integer, Integer> inValues = new HashMap<>();
            for (int inCount = 0; inCount < numberOfInputCharacters; inCount++) {
                int charAt = charToInt(text.charAt(pos + inCount));
                inValues.put(inCount, charAt);
            }
            inputData.put(pos, inValues);

            HashMap<Integer, Integer> outValues = new HashMap<>();
            for (int outCount = 0; outCount < numberOfOutputCharacters; outCount++) {
                int charAt = charToInt(text.charAt(pos + outCount + inputOutputDelta));
                outValues.put(outCount, charAt);
            }
            outputData.put(pos, outValues);
        }
        HashMap<Integer, MMatrix> inputs = new HashMap<>();
        HashMap<Integer, MMatrix> outputs = new HashMap<>();
        HashMap<Integer, HashMap<Integer, MMatrix>> result = new HashMap<>();
        result.put(0, inputs);
        result.put(1, outputs);

        int charSize = charSize();
        for (Integer pos : inputData.keySet()) {
            Matrix input = new SMatrix(numberOfInputCharacters * charSize, 1);
            for (Integer index : inputData.get(pos).keySet()) {
                int charAt = inputData.get(pos).get(index);
                input.setValue(charAt + index * charSize, 0, 1);
            }
            inputs.put(pos, new MMatrix(input));
        }

        for (Integer pos : inputData.keySet()) {
            Matrix output = new SMatrix(numberOfOutputCharacters * charSize, 1);
            for (Integer index : outputData.get(pos).keySet()) {
                int charAt = outputData.get(pos).get(index);
                int col = charAt + index * charSize;
                output.setValue(col, 0,1);
            }
            outputs.put(pos, new MMatrix(output));
        }

        return result;
    }
/**
     * Reads text file and maps each character as separate input and output columns.<br>
     * Returns input matrix with hash map index 0 and output matrix with hash map index 1.<br>
     *
     * @param fileName name of file to be read.
     * @param numberOfInputCharacters number of characters per input column.
     * @param numberOfOutputCharacters number of characters per output column.
     * @param inputOutputDelta delta in number of characters between start of input and output.
     * @param skipRowsFromStart skips specified number of rows from start.
     * @return structure containing input and output matrices.
     * @throws FileNotFoundException throws exception if file is not found.
     */
Reads text file and maps each character as separate input and output columns.
Returns input matrix with hash map index 0 and output matrix with hash map index 1.

@param fileName name of file to be read.
@param numberOfInputCharacters number of characters per input column.
@param numberOfOutputCharacters number of characters per output column.
@param inputOutputDelta delta in number of characters between start of input and output.
@param skipRowsFromStart skips specified number of rows from start.
@return structure containing input and output matrices.
@throws FileNotFoundException throws exception if file is not found.
Reads text file and maps each character as separate input and output columns . Returns input matrix with hash map index 0 and output matrix with hash map index 1 . @param fileName name of file to be read . @param numberOfInputCharacters number of characters per input column . @param numberOfOutputCharacters number of characters per output column . @param inputOutputDelta delta in number of characters between start of input and output . @param skipRowsFromStart skips specified number of rows from start . @return structure containing input and output matrices . @throws FileNotFoundException throws exception if file is not found .
public static HashMap<Integer, HashMap<Integer, MMatrix>> readFile(String fileName, int numberOfInputCharacters, int numberOfOutputCharacters, int inputOutputDelta, int skipRowsFromStart) throws FileNotFoundException {
        StringBuilder text = readText(fileName, skipRowsFromStart);
        HashMap<Integer, HashMap<Integer, Integer>> inputData = new HashMap<>();
        HashMap<Integer, HashMap<Integer, Integer>> outputData = new HashMap<>();
        int length = Math.min(text.length() - numberOfInputCharacters, text.length() - numberOfOutputCharacters - inputOutputDelta) + 1;
        for (int pos = 0; pos < length; pos++) {
            HashMap<Integer, Integer> inValues = new HashMap<>();
            for (int inCount = 0; inCount < numberOfInputCharacters; inCount++) {
                int charAt = charToInt(text.charAt(pos + inCount));
                inValues.put(inCount, charAt);
            }
            inputData.put(pos, inValues);
            HashMap<Integer, Integer> outValues = new HashMap<>();
            for (int outCount = 0; outCount < numberOfOutputCharacters; outCount++) {
                int charAt = charToInt(text.charAt(pos + outCount + inputOutputDelta));
                outValues.put(outCount, charAt);
            }
            outputData.put(pos, outValues);
        }
        HashMap<Integer, MMatrix> inputs = new HashMap<>();
        HashMap<Integer, MMatrix> outputs = new HashMap<>();
        HashMap<Integer, HashMap<Integer, MMatrix>> result = new HashMap<>();
        result.put(0, inputs);
        result.put(1, outputs);
        int charSize = charSize();
        for (Integer pos : inputData.keySet()) {
            Matrix input = new SMatrix(numberOfInputCharacters * charSize, 1);
            for (Integer index : inputData.get(pos).keySet()) {
                int charAt = inputData.get(pos).get(index);
                input.setValue(charAt + index * charSize, 0, 1);
            }
            inputs.put(pos, new MMatrix(input));
        }
        for (Integer pos : inputData.keySet()) {
            Matrix output = new SMatrix(numberOfOutputCharacters * charSize, 1);
            for (Integer index : outputData.get(pos).keySet()) {
                int charAt = outputData.get(pos).get(index);
                int col = charAt + index * charSize;
                output.setValue(col, 0,1);
            }
            outputs.put(pos, new MMatrix(output));
        }
        return result;
    }
public static HashMap < Integer , HashMap < Integer , MMatrix > > readFile ( String fileName , int numberOfInputCharacters , int numberOfOutputCharacters , int inputOutputDelta , int skipRowsFromStart ) throws FileNotFoundException { StringBuilder text = readText ( fileName , skipRowsFromStart ) ; HashMap < Integer , HashMap < Integer , Integer > > inputData = new HashMap < > ( ) ; HashMap < Integer , HashMap < Integer , Integer > > outputData = new HashMap < > ( ) ; int length = Math . min ( text . length ( ) - numberOfInputCharacters , text . length ( ) - numberOfOutputCharacters - inputOutputDelta ) + 1 ; for ( int pos = 0 ; pos < length ; pos ++ ) { HashMap < Integer , Integer > inValues = new HashMap < > ( ) ; for ( int inCount = 0 ; inCount < numberOfInputCharacters ; inCount ++ ) { int charAt = charToInt ( text . charAt ( pos + inCount ) ) ; inValues . put ( inCount , charAt ) ; } inputData . put ( pos , inValues ) ; HashMap < Integer , Integer > outValues = new HashMap < > ( ) ; for ( int outCount = 0 ; outCount < numberOfOutputCharacters ; outCount ++ ) { int charAt = charToInt ( text . charAt ( pos + outCount + inputOutputDelta ) ) ; outValues . put ( outCount , charAt ) ; } outputData . put ( pos , outValues ) ; } HashMap < Integer , MMatrix > inputs = new HashMap < > ( ) ; HashMap < Integer , MMatrix > outputs = new HashMap < > ( ) ; HashMap < Integer , HashMap < Integer , MMatrix > > result = new HashMap < > ( ) ; result . put ( 0 , inputs ) ; result . put ( 1 , outputs ) ; int charSize = charSize ( ) ; for ( Integer pos : inputData . keySet ( ) ) { Matrix input = new SMatrix ( numberOfInputCharacters * charSize , 1 ) ; for ( Integer index : inputData . get ( pos ) . keySet ( ) ) { int charAt = inputData . get ( pos ) . get ( index ) ; input . setValue ( charAt + index * charSize , 0 , 1 ) ; } inputs . put ( pos , new MMatrix ( input ) ) ; } for ( Integer pos : inputData . keySet ( ) ) { Matrix output = new SMatrix ( numberOfOutputCharacters * charSize , 1 ) ; for ( Integer index : outputData . get ( pos ) . keySet ( ) ) { int charAt = outputData . get ( pos ) . get ( index ) ; int col = charAt + index * charSize ; output . setValue ( col , 0 , 1 ) ; } outputs . put ( pos , new MMatrix ( output ) ) ; } return result ; }
Reads text file and maps each character as separate input and output columns.<br>
 Returns input matrix with hash map index 0 and output matrix with hash map index 1.<br>
Reads text file and maps each character as separate input and output columns . <br > Returns input matrix with hash map index 0 and output matrix with hash map index 1 . <br >