X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;ds=sidebyside;f=norms.py;fp=norms.py;h=f9fc1d73aebde753a52cf5038bfa6a85db2f54ed;hb=d89e4fd0c7455c64099319a0dbfc3f36ad1f5baf;hp=08cff74b82541f2e2331f2ce85775db68ea44399;hpb=0de5e7da1efcabf40d5b38df08de1b614325e225;p=cipher-tools.git

diff --git a/norms.py b/norms.py
index 08cff74..f9fc1d7 100644
--- a/norms.py
+++ b/norms.py
@@ -13,7 +13,8 @@ def normalise(frequencies):
     [(1, 0.4082482904638631), (2, 0.8164965809277261), (3, 0.4082482904638631)]
    """
     length = sum([f ** 2 for f in frequencies.values()]) ** 0.5
-    return collections.defaultdict(int, ((k, v / length) for (k, v) in frequencies.items()))
+    return collections.defaultdict(int, ((k, v / length) 
+        for (k, v) in frequencies.items()))
 
 def scale(frequencies):
     """Scale a set of frequencies so the largest is 1
@@ -28,7 +29,8 @@ def scale(frequencies):
     [(1, 0.5), (2, 1.0), (3, 0.5)]
     """
     largest = max(frequencies.values())
-    return collections.defaultdict(int, ((k, v / largest) for (k, v) in frequencies.items()))
+    return collections.defaultdict(int, ((k, v / largest) 
+        for (k, v) in frequencies.items()))
     
 
 def l2(frequencies1, frequencies2):