private void mapCommandsToAString() {
        encodedCommandSequence = "";

        //adding session break and matched char to character to map
        if(!characterToCommandHashMap.containsKey(DataStreamPatternRecognizer.matchedChar)){
            characterToCommandHashMap.put(DataStreamPatternRecognizer.matchedChar,
                    String.valueOf(DataStreamPatternRecognizer.matchedChar));
            commandToCharacterHashMap.put(String.valueOf(DataStreamPatternRecognizer.matchedChar),
                    DataStreamPatternRecognizer.matchedChar);
        }
        if(!characterToCommandHashMap.containsKey(sessionBreak)){
            characterToCommandHashMap.put(sessionBreak, String.valueOf(sessionBreak));
            commandToCharacterHashMap.put(String.valueOf(sessionBreak), sessionBreak);
        }

        //get unique commands
        for (String command : commandSequence)
            commandSet.add(command);
        //assign unique character for unique commands
        for (String command : commandSet){
            if(command.equals( String.valueOf(sessionBreak) ))
                continue;
            if(commandToCharacterHashMap.containsKey(command))
                continue;
            characterToCommandHashMap.put((char) counter, command);
            commandToCharacterHashMap.put(command, (char) counter);
            counter++;
        }

        //encode sequence of commands to a string
        for (String command : commandSequence)
            encodedCommandSequence += commandToCharacterHashMap.get(command);

        //find index to split training and testing data
        splitIndex = encodedCommandSequence.length();
//        int trainingLength, leftSearchIndex, rightSearchIndex;
//        trainingLength = (int) ((p/(p+q)) * encodedCommandSequence.length());
//        leftSearchIndex = rightSearchIndex = trainingLength;
//        while ((encodedCommandSequence.charAt(leftSearchIndex) != '-') &&
//                (encodedCommandSequence.charAt(rightSearchIndex) != '-')){
//            leftSearchIndex--;
//            rightSearchIndex++;
//        }
//        splitIndex = encodedCommandSequence.charAt(leftSearchIndex) == '-' ? leftSearchIndex : rightSearchIndex;
    }