tapcode/tapcode.py
def genTapcode(sentence: str, tap:str = ".", sep: str = " ", dec:bool = False) -> str:
    """
    Generate TapCode from string\Decimal Values

    Args:

        sentence (String):         Sentence
        tap (String):               Tap string ("." by default)
        sep (String):               Separator (" " by default)
        dec (Boolean):              Input type (True for decimal input False for String input!)

    Return:

        String. Generated tap code.

    Example:

        >>> genTapcode("Hello")
        ".. ... . ..... ... . ... . ... ...."
        >>> genTapcode("Hello", "-", "_")
        "--_---_-_-----_---_-_---_-_---_----"
        >>> genTapcode("23 15 31 31 34", dec=True)
        ".. ... . ..... ... . ... . ... ...."

    """
    if dec:
        inp = sentence
    if not dec:
        inp = encipher(sentence, sep)

    DecimalTaps = "".join(filter(str.isdigit , inp)) # keep numbers and remove other chars

    output = []
    for i in DecimalTaps:
        output.append(int(i) * tap)
        output.append(sep)

    # Just like encipher function
    if sep:
        return "".join(output)[:-(len(sep))]
    else:
        return "".join(output)

    Generate TapCode from string\Decimal Values

    Args:

        sentence (String):         Sentence
        tap (String):               Tap string ("." by default)
        sep (String):               Separator (" " by default)
        dec (Boolean):              Input type (True for decimal input False for String input!)

    Return:

        String. Generated tap code.

    Example:

        >>> genTapcode("Hello")
        ".. ... . ..... ... . ... . ... ...."
        >>> genTapcode("Hello", "-", "_")
        "--_---_-_-----_---_-_---_-_---_----"
        >>> genTapcode("23 15 31 31 34", dec=True)
        ".. ... . ..... ... . ... . ... ...."

    
Generate TapCode from string\Decimal Values
Generate TapCode from string \ Decimal Values
def genTapcode(sentence: str, tap:str = ".", sep: str = " ", dec:bool = False) -> str:
    if dec:
        inp = sentence
    if not dec:
        inp = encipher(sentence, sep)
    DecimalTaps = "".join(filter(str.isdigit , inp)) 
    output = []
    for i in DecimalTaps:
        output.append(int(i) * tap)
        output.append(sep)
    if sep:
        return "".join(output)[:-(len(sep))]
    else:
        return "".join(output)
def genTapcode ( sentence : str , tap : str = "." , sep : str = " " , dec : bool = False ) -> str : if dec : inp = sentence if not dec : inp = encipher ( sentence , sep ) DecimalTaps = "" . join ( filter ( str . isdigit , inp ) ) output = [ ] for i in DecimalTaps : output . append ( int ( i ) * tap ) output . append ( sep ) if sep : return "" . join ( output ) [ : - ( len ( sep ) ) ] else : return "" . join ( output )
Generate TapCode from string\Decimal Values
Generate TapCode from string \ Decimal Values
"""
    Generate TapCode from string\Decimal Values

    Args:

        sentence (String):         Sentence
        tap (String):               Tap string ("." by default)
        sep (String):               Separator (" " by default)
        dec (Boolean):              Input type (True for decimal input False for String input!)

    Return:

        String. Generated tap code.

    Example:

        >>> genTapcode("Hello")
        ".. ... . ..... ... . ... . ... ...."
        >>> genTapcode("Hello", "-", "_")
        "--_---_-_-----_---_-_---_-_---_----"
        >>> genTapcode("23 15 31 31 34", dec=True)
        ".. ... . ..... ... . ... . ... ...."

    """ # keep numbers and remove other chars # Just like encipher function
sentence
str
None
tap
str
Tap string ("." by default)
Tap string ( " . " by default )
sep
str
Separator (" " by default)
Separator ( " " by default )
dec
bool
Input type (True for decimal input False for String input!)
Input type ( True for decimal input False for String input! )
examples
None