merge_machine/preprocess_fields_v3.py
def validated_lexical_map(lexicon, tokenize = False, stopWords = None, synMap = None):
	''' Returns a dictionary from normalized string to list of original strings. '''
	syn_map0 = None if synMap is None else cased_multi_map(synMap)
	lexical_map = defaultdict(list)
	for s in lexicon:
		if syn_map0 is not None:
			for (main_var, alt_vars) in synMap.items():
				s = re.sub(r"\b(%s)\b" % '|'.join(alt_vars), main_var, s, re.I)
		add_to_lexicon_map(lexical_map, s, tokenize, stopWords)
	return lexical_map
 Returns a dictionary from normalized string to list of original strings. 
Returns a dictionary from normalized string to list of original strings.
Returns a dictionary from normalized string to list of original strings .
def validated_lexical_map(lexicon, tokenize = False, stopWords = None, synMap = None):
	syn_map0 = None if synMap is None else cased_multi_map(synMap)
	lexical_map = defaultdict(list)
	for s in lexicon:
		if syn_map0 is not None:
			for (main_var, alt_vars) in synMap.items():
				s = re.sub(r"\b(%s)\b" % '|'.join(alt_vars), main_var, s, re.I)
		add_to_lexicon_map(lexical_map, s, tokenize, stopWords)
	return lexical_map
def validated_lexical_map ( lexicon , tokenize = False , stopWords = None , synMap = None ) : syn_map0 = None if synMap is None else cased_multi_map ( synMap ) lexical_map = defaultdict ( list ) for s in lexicon : if syn_map0 is not None : for ( main_var , alt_vars ) in synMap . items ( ) : s = re . sub ( r"\b(%s)\b" % '|' . join ( alt_vars ) , main_var , s , re . I ) add_to_lexicon_map ( lexical_map , s , tokenize , stopWords ) return lexical_map
Returns a dictionary from normalized string to list of original strings.
Returns a dictionary from normalized string to list of original strings .
''' Returns a dictionary from normalized string to list of original strings. '''
lexicon
tokenize
stopWords
synMap