Skip to content

Instantly share code, notes, and snippets.

View rossb83's full-sized avatar

Benjamin Ross rossb83

  • Uber
  • New York, NY
  • 08:52 (UTC -04:00)
  • LinkedIn in/benjineer
View GitHub Profile
@smhanov
smhanov / dawg.py
Last active April 26, 2023 16:01
Use a DAWG as a map
#!/usr/bin/python3
# By Steve Hanov, 2011. Released to the public domain.
# Please see http://stevehanov.ca/blog/index.php?id=115 for the accompanying article.
#
# Based on Daciuk, Jan, et al. "Incremental construction of minimal acyclic finite-state automata."
# Computational linguistics 26.1 (2000): 3-16.
#
# Updated 2014 to use DAWG as a mapping; see
# Kowaltowski, T.; CL. Lucchesi (1993), "Applications of finite automata representing large vocabularies",
# Software-Practice and Experience 1993