import tensorflow as tf


"""Dataset for iterating over text."""

import collections
import numpy as np
import tensorflow as tf


def _split_string(string):
    """Splits a byte string into an array of character bytes."""
    text = tf.compat.as_text(string)
    ret = np.empty(len(text), dtype=np.object)
    for i, char in enumerate(text):
        ret[i] = tf.compat.as_bytes(char)
    return ret


def vocabulary(filename, max_size=None, num_oov_buckets=1):
    """Builds vocabulary and ID lookup tables from the given file."""

