From bfa699904d0040536aa5de8ceb35ead939e571fc Mon Sep 17 00:00:00 2001
From: "J.F.J. Laros"
Date: Thu, 16 Feb 2017 15:37:05 +0100
Subject: [PATCH] Documentation.
---
dict_trie/dict_trie.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/dict_trie/dict_trie.py b/dict_trie/dict_trie.py
index e0f912a..7e6aa8d 100644
--- a/dict_trie/dict_trie.py
+++ b/dict_trie/dict_trie.py
@@ -1,11 +1,16 @@
def _hamming(path, node, word, distance):
"""
+ Find the first path in the trie that is within a certain hamming distance
+ of {word}. Note that this does not necessarily the one with the smallest
+ distance.
+
:arg str path: Path taken so far to reach the current node.
:arg dict node: Current node.
:arg str word: Query word.
:arg int distance: Amount of errors we can still make.
- :returns str:
+ :returns str: A word in the trie that has Hamming distance of at most
+ {distance} to {word}.
"""
if distance < 0:
return ''
@@ -50,7 +55,7 @@ class Trie(object):
:arg str word: A word.
- :returns dict: The node if found, None otherwise.
+ :returns dict: The node if found, {} otherwise.
"""
node = self.root
--
2.21.0