# # # add_file "Makefile" # content [a2160490c328f6697e917af964f80740cc1af3e5] # # patch "mk2.py" # from [fd9cea464ab12217dc6f0004ecad13b5a9c51baf] # to [160b4053f2d72fa2807c10cc1b72df4d11828ebf] # # patch "viewmtn.py" # from [045fb4d288dfb3824fbfbad1c5815abecdec6e96] # to [5de4dc55065621a80377580d13ff4fada54f5029] # ============================================================ --- Makefile a2160490c328f6697e917af964f80740cc1af3e5 +++ Makefile a2160490c328f6697e917af964f80740cc1af3e5 @@ -0,0 +1,8 @@ +ctags: + find . -name "*.py" -print0 | xargs -0 ctags + +clean: + find . -name "*.pyc" -exec rm {} \; + +release: + ./release.sh ============================================================ --- mk2.py fd9cea464ab12217dc6f0004ecad13b5a9c51baf +++ mk2.py 160b4053f2d72fa2807c10cc1b72df4d11828ebf @@ -47,15 +47,15 @@ class MarkovChain(object): @classmethod def log_chunkable (cls, self, entropies): # fast, but not necessarily as correct - return math.log (len(self.states.keys ()), 2) / 8 + return math.log (len(self.states.keys ()), 2) / 10 @classmethod def standard_deviation_chunkable (cls, self, entropies): l_h = len(entropies) mean_h = sum(entropies) / l_h sd_h = math.sqrt(sum([ pow(t - mean_h, 2) for t in entropies ]) / l_h) - print >> sys.stderr, l_h, mean_h, sd_h - cutoff = mean_h + 2.5 * sd_h # should really justify in some way other than 'it works' +# print >> sys.stderr, l_h, mean_h, sd_h + cutoff = mean_h + 3 * sd_h # should really justify in some way other than 'it works' return cutoff def update(self, gen): @@ -119,7 +119,7 @@ class MarkovChain(object): keys = self.states.keys() keylen = len(keys) if keylen == 0: - return None + return None, None max_h = -1 candidate = None entropies = [] ============================================================ --- viewmtn.py 045fb4d288dfb3824fbfbad1c5815abecdec6e96 +++ viewmtn.py 5de4dc55065621a80377580d13ff4fada54f5029 @@ -367,7 +367,7 @@ class BranchDivisions: def calculate_divisions (self, branches): if self.divisions != None: return - chain = MarkovChain (2, join_token='.', cutoff_func=MarkovChain.standard_deviation_chunkable) + chain = MarkovChain (2, join_token='.', cutoff_func=MarkovChain.log_chunkable) for branch in branches: chain.update (branch.name.split ('.')) chain.upchunk ()