gawseed/algorithm/aggregator.py
def stringSplitter(index, key, subkey, value, results, args = []):
    """Splits a value string into a series of new keys inside a new index
       (named in argument 1, or else old_index + '_split')"""

    # XXX: allow subkey to be specified other than ''
    subkey = ''

    split_index = None
    if len(args) > 0:
	    split_index = args[0]
    else:
	    split_index = index + "_split" 

    # create the index slots if they don't exist yet
    if split_index not in results:
        results[split_index] = {}
        
    # create new keys by splitting the old key
    # XXX: accept a split argument
    for newkey in key.split():
        # create the key slot if it doesn't exist
        if newkey not in results[split_index]:
            results[split_index][newkey] = { subkey: 1.0 }
        else:
            results[split_index][newkey][subkey] += 1
Splits a value string into a series of new keys inside a new index
       (named in argument 1, or else old_index + '_split')
Splits a value string into a series of new keys inside a new index
(named in argument 1, or else old_index + '_split')
Splits a value string into a series of new keys inside a new index ( named in argument 1 or else old_index + ' _split ' )
def stringSplitter(index, key, subkey, value, results, args = []):
    subkey = ''
    split_index = None
    if len(args) > 0:
	    split_index = args[0]
    else:
	    split_index = index + "_split" 
    if split_index not in results:
        results[split_index] = {}
    for newkey in key.split():
        if newkey not in results[split_index]:
            results[split_index][newkey] = { subkey: 1.0 }
        else:
            results[split_index][newkey][subkey] += 1
def stringSplitter ( index , key , subkey , value , results , args = [ ] ) : subkey = '' split_index = None if len ( args ) > 0 : split_index = args [ 0 ] else : split_index = index + "_split" if split_index not in results : results [ split_index ] = { } for newkey in key . split ( ) : if newkey not in results [ split_index ] : results [ split_index ] [ newkey ] = { subkey : 1.0 } else : results [ split_index ] [ newkey ] [ subkey ] += 1
Splits a value string into a series of new keys inside a new index
(named in argument 1, or else old_index + '_split')
Splits a value string into a series of new keys inside a new index ( named in argument 1 or else old_index + ' _split ' )
"""Splits a value string into a series of new keys inside a new index
       (named in argument 1, or else old_index + '_split')""" # XXX: allow subkey to be specified other than '' # create the index slots if they don't exist yet # create new keys by splitting the old key # XXX: accept a split argument # create the key slot if it doesn't exist
index
key
subkey
value
results
args