merge_machine/preprocess_fields_v3.py
def token_templates(token, simple = True):
	''' Parameters:
		simple if True, then this method only builds full patterns (i.e. no strict prefixes) and also just considers
		L and D (not A) '''
	if simple:
		if len(token) >= MPL[0] and len(token) <= MPL[1]:
			candidate = list([char_template(token[n]) for n in range(len(token))])
			if 'D' in candidate: yield '{}$'.format(''.join(candidate))
	else:
		l = list()
		for n in range(len(token)):
			l.append(''.join(char_templates(token[n])))
			if n < MPL[0] or 'D' not in l: continue
			for p in itertools.product(l):
				yield p
				if n == len(token) - 1: yield '{}$'.format(p)
 Parameters:
		simple if True, then this method only builds full patterns (i.e. no strict prefixes) and also just considers
		L and D (not A) 
simple if True, then this method only builds full patterns  and also just considers
L and D (not A)
simple if True then this method only builds full patterns and also just considers L and D ( not A )
def token_templates(token, simple = True):
	if simple:
		if len(token) >= MPL[0] and len(token) <= MPL[1]:
			candidate = list([char_template(token[n]) for n in range(len(token))])
			if 'D' in candidate: yield '{}$'.format(''.join(candidate))
	else:
		l = list()
		for n in range(len(token)):
			l.append(''.join(char_templates(token[n])))
			if n < MPL[0] or 'D' not in l: continue
			for p in itertools.product(l):
				yield p
				if n == len(token) - 1: yield '{}$'.format(p)
def token_templates ( token , simple = True ) : if simple : if len ( token ) >= MPL [ 0 ] and len ( token ) <= MPL [ 1 ] : candidate = list ( [ char_template ( token [ n ] ) for n in range ( len ( token ) ) ] ) if 'D' in candidate : yield '{}$' . format ( '' . join ( candidate ) ) else : l = list ( ) for n in range ( len ( token ) ) : l . append ( '' . join ( char_templates ( token [ n ] ) ) ) if n < MPL [ 0 ] or 'D' not in l : continue for p in itertools . product ( l ) : yield p if n == len ( token ) - 1 : yield '{}$' . format ( p )
Parameters:
simple if True, then this method only builds full patterns (i.e.
Parameters : simple if True then this method only builds full patterns ( i . e .
''' Parameters:
		simple if True, then this method only builds full patterns (i.e. no strict prefixes) and also just considers
		L and D (not A) '''
token
simple