Skip to content

Instantly share code, notes, and snippets.

@jamesnvc
Created February 11, 2010 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesnvc/301912 to your computer and use it in GitHub Desktop.
Save jamesnvc/301912 to your computer and use it in GitHub Desktop.
def replace_template(map, template):
trie = Trie(map)
iter = template.__iter__
for c in iter:
if c != '$': print c
else:
s = iter.next()
trie.lookup(iter)
if replacement:
print replacement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment