Repository: drincruz/python-trie

Issue:
change default TRIE_TERMINATOR default
'!THIS_IS_THE_END!' was _really_ just an example. Using a \0 terminator makes the most sense. Let's do that.

Discussion:

Patch:
diff --git a/README.md b/README.md
index 77303a0..ba35836 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@ Example
     >>> t.contains_word("dogg")
     False
     >>> t.root
-    {'d': {'o': {'g': {'!THIS_IS_THE_END!': {'word': 'dog'}, 's': {'!THIS_IS_THE_END!': {'word': 'dogs'}}, 'g': {'y': {'!THIS_IS_THE_END!': {'word': 'doggy'}}}}}}}
+    {'d': {'o': {'g': {'\0': {'word': 'dog'}, 's': {'\0': {'word': 'dogs'}}, 'g': {'y': {'\0': {'word': 'doggy'}}}}}}}
 
 
 Unit Testing
diff --git a/trie/trie.py b/trie/trie.py
index 96f3fdb..4bd31f7 100644
--- a/trie/trie.py
+++ b/trie/trie.py
@@ -10,7 +10,7 @@ class TriePy(object):
 
     """
     # A terminator to represent and end of a path
-    __TRIE_TERMINATOR = '!THIS_IS_THE_END!'
+    __TRIE_TERMINATOR = '\0'
 
     def __init__(self):
         """


Test patch:
diff --git a/tests/test_trie.py b/tests/test_trie.py
index 0b3aa6b..7b1fa5e 100644
--- a/tests/test_trie.py
+++ b/tests/test_trie.py
@@ -15,7 +15,7 @@ def test_abc_add_word():
     my_test = {"a":
                     {"b": 
                         {"c": 
-                            {"!THIS_IS_THE_END!":
+                            {"\0":
                                 {"word": "abc"}
                             }
                         }
@@ -34,8 +34,8 @@ def test_asterisk_add_word():
     my_test = {"*":
                 {"x":
                     {"*":
-                        { "z":
-                            {"!THIS_IS_THE_END!":
+                        {"z":
+                            {"\0":
                                 {"word": "*x*z"}
                             }
                         }