wordipy/main.py
def abbreviationize(input_str, sep=""):
    """
    This function does the following two things
    1) Takes the abbrevation with or without space and returns the abbrevation without spaces
    2) Takes the tupled item and returns the repeated item tuple times (tuple is not a data type in this context)
    
    Parameters
    ----------
    input_str : str
    sep : str (symbols like comma (,))

    Returns
    -------
    str
        a string of expected output
    Examples
    --------
    >>> abbreviationize("C M")
    'CM'
    >>> abbreviationize("Triple A")
    'AAA'
    >>> abbreviationize('Double Bam', sep=",")
    'Bam, Bam'
    >>> abbreviationize('Quadruple Baby', sep=",")
    'Baby, Baby, Baby, Baby' 
    """
    process_words = helpers.processing(input_str)
    input_str_list = input_str.split(" ")

    intersection = set(process_words) & set(voc.tuple_.keys())

    #print(intersection)
    if len(intersection):
        '''
        if double, triple (tuples) is present in the input
        '''
        times = intersection.pop()
        times_num = int(voc.tuple_[times])
        item = input_str.replace(times, '')[len(times):] + sep
        # lstrip() can also be used, but strip trims spaces from both sides
        output = (item*times_num).strip()
        last_char_remove = True if sep != "" else False
        if last_char_remove:
            output = output[:-1]
        check = final_abbreviationize(output, input_str_list)
        if check:
            return check
        return output
    else:
        return final_abbreviationize(input_str, input_str_list)

    This function does the following two things
    1) Takes the abbrevation with or without space and returns the abbrevation without spaces
    2) Takes the tupled item and returns the repeated item tuple times (tuple is not a data type in this context)
    
    Parameters
    ----------
    input_str : str
    sep : str (symbols like comma (,))

    Returns
    -------
    str
        a string of expected output
    Examples
    --------
    >>> abbreviationize("C M")
    'CM'
    >>> abbreviationize("Triple A")
    'AAA'
    >>> abbreviationize('Double Bam', sep=",")
    'Bam, Bam'
    >>> abbreviationize('Quadruple Baby', sep=",")
    'Baby, Baby, Baby, Baby' 
    
This function does the following two things
1) Takes the abbrevation with or without space and returns the abbrevation without spaces
2) Takes the tupled item and returns the repeated item tuple times (tuple is not a data type in this context)

Parameters

input_str : str
sep : str (symbols like comma (,))

Returns

str
a string of expected output
Examples


This function does the following two things 1 ) Takes the abbrevation with or without space and returns the abbrevation without spaces 2 ) Takes the tupled item and returns the repeated item tuple times ( tuple is not a data type in this context ) Parameters input_str : str sep : str ( symbols like comma ( )) Returns str a string of expected output Examples
def abbreviationize(input_str, sep=""):
    process_words = helpers.processing(input_str)
    input_str_list = input_str.split(" ")
    intersection = set(process_words) & set(voc.tuple_.keys())
    if len(intersection):
        times = intersection.pop()
        times_num = int(voc.tuple_[times])
        item = input_str.replace(times, '')[len(times):] + sep
        output = (item*times_num).strip()
        last_char_remove = True if sep != "" else False
        if last_char_remove:
            output = output[:-1]
        check = final_abbreviationize(output, input_str_list)
        if check:
            return check
        return output
    else:
        return final_abbreviationize(input_str, input_str_list)
def abbreviationize ( input_str , sep = "" ) : process_words = helpers . processing ( input_str ) input_str_list = input_str . split ( " " ) intersection = set ( process_words ) & set ( voc . tuple_ . keys ( ) ) if len ( intersection ) : '''
        if double, triple (tuples) is present in the input
        ''' times = intersection . pop ( ) times_num = int ( voc . tuple_ [ times ] ) item = input_str . replace ( times , '' ) [ len ( times ) : ] + sep output = ( item * times_num ) . strip ( ) last_char_remove = True if sep != "" else False if last_char_remove : output = output [ : - 1 ] check = final_abbreviationize ( output , input_str_list ) if check : return check return output else : return final_abbreviationize ( input_str , input_str_list )
This function does the following two things
1) Takes the abbrevation with or without space and returns the abbrevation without spaces
2) Takes the tupled item and returns the repeated item tuple times (tuple is not a data type in this context)
This function does the following two things 1 ) Takes the abbrevation with or without space and returns the abbrevation without spaces 2 ) Takes the tupled item and returns the repeated item tuple times ( tuple is not a data type in this context )
"""
    This function does the following two things
    1) Takes the abbrevation with or without space and returns the abbrevation without spaces
    2) Takes the tupled item and returns the repeated item tuple times (tuple is not a data type in this context)
    
    Parameters
    ----------
    input_str : str
    sep : str (symbols like comma (,))

    Returns
    -------
    str
        a string of expected output
    Examples
    --------
    >>> abbreviationize("C M")
    'CM'
    >>> abbreviationize("Triple A")
    'AAA'
    >>> abbreviationize('Double Bam', sep=",")
    'Bam, Bam'
    >>> abbreviationize('Quadruple Baby', sep=",")
    'Baby, Baby, Baby, Baby' 
    """ #print(intersection) '''
        if double, triple (tuples) is present in the input
        ''' # lstrip() can also be used, but strip trims spaces from both sides
input_str
sep