haspirater

detect aspirated 'h' in French words
git clone https://a3nm.net/git/haspirater/
Log | Files | Refs | README

commit ea564cb6be9b8584ef8784b70a2640bf0efc9587
parent 66507dc52df0df911cc9f0049980ff54a647086d
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Mon, 30 May 2011 13:12:26 -0400

remove labels from drawing, add the result

Diffstat:
README | 2+-
haspirated_h.pdf | 0
trie2dot.py | 8+++-----
3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/README b/README @@ -101,5 +101,5 @@ confidence values. You can use trie2dot.py to convert the output of buildtrie.py or compresstrie.py in the dot format which can be used to render a drawing -of the trie. +of the trie. The result of such a drawing is given as aspirated_h.pdf diff --git a/haspirated_h.pdf b/haspirated_h.pdf Binary files differ. diff --git a/trie2dot.py b/trie2dot.py @@ -47,14 +47,12 @@ def to_dot(trie, prefix=''): for (key, child) in sorted(children.items(), key=total, reverse=True): i = to_dot(child, prefix+key) - print("%d -> %d [label=\"%s\",penwidth=%d]" % (my_id, i, - key, 1+int(log(total((None, child)))))) + print("%d -> %d [penwidth=%d]" % (my_id, i, + 1+int(log(total((None, child)))))) return my_id # TODO aspect causes graphviz crash? -# TODO check if nodes don't get removed with aspect, it seems too good -# to be true -print("digraph G {\naspect=\"3\"\n") +print("digraph G {\naspect=\"1\"\n") to_dot(trie, 'h') print("}")