Markov: trivial code cleanup
This commit is contained in:
		
							parent
							
								
									14fd5721c1
								
							
						
					
					
						commit
						b327bcab71
					
				| @ -288,7 +288,7 @@ class Markov(Module): | ||||
|         # don't learn recursion | ||||
|         if not event._recursing: | ||||
|             words = line.split() | ||||
|             if len(words) <= 0: | ||||
|             if len(words) == 0: | ||||
|                 return line | ||||
| 
 | ||||
|             db = self.get_db() | ||||
| @ -465,7 +465,7 @@ class Markov(Module): | ||||
|         if len(gen_words) < min_size + 2 and len(filter(lambda a: a != self.stop, key_hits)) > 0: | ||||
|             found_word = random.choice(filter(lambda a: a != self.stop, key_hits)) | ||||
|             return found_word | ||||
|         elif len(key_hits) <= 0: | ||||
|         elif len(key_hits) == 0: | ||||
|             return self.stop | ||||
|         else: | ||||
|             found_word = random.choice(key_hits) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user