Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save santhalakshminarayana/02244c6ebe1a3075795836c99e4e5bfe to your computer and use it in GitHub Desktop.
Save santhalakshminarayana/02244c6ebe1a3075795836c99e4e5bfe to your computer and use it in GitHub Desktop.
Indian Name Genarator - Sequence Generation - Medium
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