markov: don't learn recursive stuff
This commit is contained in:
		
							parent
							
								
									43da4bff5a
								
							
						
					
					
						commit
						16fa94cb24
					
				| @ -74,9 +74,11 @@ class Markov(Plugin): | |||||||
|         target = reply_destination_for_event(event) |         target = reply_destination_for_event(event) | ||||||
| 
 | 
 | ||||||
|         # learn the line |         # learn the line | ||||||
|         log.debug(u"learning %s", trimmed_what) |         recursing = getattr(event, '_recursing', False) | ||||||
|         context = markovlib.get_or_create_target_context(target) |         if not recursing: | ||||||
|         markovlib.learn_line(trimmed_what, context) |             log.debug(u"learning %s", trimmed_what) | ||||||
|  |             context = markovlib.get_or_create_target_context(target) | ||||||
|  |             markovlib.learn_line(trimmed_what, context) | ||||||
| 
 | 
 | ||||||
|         log.debug(u"searching '%s' for '%s'", what, my_nick) |         log.debug(u"searching '%s' for '%s'", what, my_nick) | ||||||
|         if re.search(my_nick, what, re.IGNORECASE) is not None: |         if re.search(my_nick, what, re.IGNORECASE) is not None: | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user