(txt_dir, seq_length=80)
return dataX, dataY
Parses text file in given directory into data for next-character model.

    Args:
        txt_dir: path to text file
        seq_length: length of strings in X
Parses text file in given directory into data for next-character model.
Parses text file in given directory into data for next - character model .
def __txt_to_data(txt_dir, seq_length=80):
    """Parses text file in given directory into data for next-character model.

    Args:
        txt_dir: path to text file
        seq_length: length of strings in X
    """
    raw_text = ""
    with open(txt_dir,'r') as inf:
        raw_text = inf.read()
    raw_text = raw_text.replace('\n', ' ')
    raw_text = re.sub(r"   *", r' ', raw_text)
    dataX = []
    dataY = []
    for i in range(0, len(raw_text) - seq_length, 1):
        seq_in = raw_text[i:i + seq_length]
        seq_out = raw_text[i + seq_length]
        dataX.append(seq_in)
        dataY.append(seq_out)
    return dataX, dataY
def __txt_to_data ( txt_dir , seq_length = 80 ) : raw_text = "" with open ( txt_dir , 'r' ) as inf : raw_text = inf . read ( ) raw_text = raw_text . replace ( '\n' , ' ' ) raw_text = re . sub ( r"   *" , r' ' , raw_text ) dataX = [ ] dataY = [ ] for i in range ( 0 , len ( raw_text ) - seq_length , 1 ) : seq_in = raw_text [ i : i + seq_length ] seq_out = raw_text [ i + seq_length ] dataX . append ( seq_in ) dataY . append ( seq_out ) return dataX , dataY