Learning token dictionary When processing texts written in a human-readable language, typically a first step is tokenization, where we have a dictionary of tokens (words) and we collapse each substring in that dictionary into a single token.  For a language like English, the dictionary is known in advance.

In my case, I want to parse files with a format not based on any human language.  I don't have a dictionary of known tokens; instead, I want to learn this dictionary.  I do have lots of sample data I can analyze.

Are there techniques for generating a dictionary, given many example files?

I expect that any common substring that appears in many files is a good candidate for a token, so an obvious approach is to look for all common substrings and add them to the dictionary.  However, a complication is that there is no equivalent of whitespace that separates tokens, so it seems like some filtering might be needed to avoid treating phrases (sequences of multiple tokens) as a new token.  For example, imagine if we had a large corpus of English writing, except that all spaces and punctuation are omitted, and we tried to infer a dictionary of English words from that.  We might naturally infer that "ARE", "THE", and "HER" are reasonable tokens, as they occur frequently as substrings.  All well and good so far.  However, we wouldn't want the algorithm to add "ARETHE" to the dictionary, even though "ARETHE" appears fairly frequently, as "ARETHE" is just the concatenation of the two tokens "ARE" and "THE".  I suspect it might be possible to detect this, because the frequency of "ARETHE" is not much more than the product of the frequencies of "ARE" and "THE", but I'm not sure.  Is there a clean way to handle this wrinkle?
Actually you can often just split on the white space, remove punctuation, and lowercase. This will provide your tokens. For example, if I had a string "jdf asdsa sdfr" (no English), then I could derive the tokens jdf, asdsa, and sdfr. The only thing that is known before hand would be the stopwords (and, be it the), which do come from the English dictionary. However, in this case, it does not sound like you would need stopwords. I would suggest looking at the following libraries available in python:

SpaCy

NLTK

Scikit-learn