You can try encoding your input in shingles maybe, and feeding vectorized shingles (instead of a one hot encoded dictionary) into the usual CBOW or skipgram thing to train the embedding.
You'd need to invest plenty of effort into shingling and vectorizing properly to get useful results, though.