Created
December 13, 2019 06:03
-
-
Save santhalakshminarayana/02244c6ebe1a3075795836c99e4e5bfe to your computer and use it in GitHub Desktop.
Indian Name Genarator - Sequence Generation - Medium
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sequences, next_chars = [], [] | |
window = 5 | |
for name in names: | |
if len(name) < window: | |
sequences.append(name+'.'*(window-len(name))) | |
next_chars.append('.') | |
seq_lengths.append(len(name)) | |
else: | |
for i in range(0,len(name) - window + 1): | |
sequences.append(name[i:i+window]) | |
if (i + window) < len(name): | |
next_chars.append(name[i+window]) | |
else: | |
next_chars.append('.') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment