Skip to content

Instantly share code, notes, and snippets.

View dj-leander's full-sized avatar
🍭
Just playing

Kenneth Salazar dj-leander

🍭
Just playing
  • Barcelona, Spain
  • 21:59 (UTC -12:00)
View GitHub Profile
@dj-leander
dj-leander / dawg.py
Created April 19, 2025 16:37 — forked from smhanov/dawg.py
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