(self, path, expandSubPaths=True, frequency=(0,1))
Adds a tuple of elements as a path. If the elements are not strings, 
        a conversion to strings will be made. This function can be used to 
        to set custom subpath statistics, via the frequency tuple (see below).

        @path: The path tuple to be added, e.g. ('a', 'b', 'c')
        @expandSubPaths: Whether or not to calculate subpath statistics for this path
        @frequency: A tuple (x,y) indicating the frequency of this path as subpath 
            (first component) and longest path (second component). Default is (0,1).
Adds a tuple of elements as a path. If the elements are not strings, 
        a conversion to strings will be made. This function can be used to 
        to set custom subpath statistics, via the frequency tuple (see below).
Adds a tuple of elements as a path . If the elements are not strings a conversion to strings will be made . This function can be used to to set custom subpath statistics via the frequency tuple ( see below ) .
def addPathTuple(self, path, expandSubPaths=True, frequency=(0,1)):
        """
        Adds a tuple of elements as a path. If the elements are not strings, 
        a conversion to strings will be made. This function can be used to 
        to set custom subpath statistics, via the frequency tuple (see below).

        @path: The path tuple to be added, e.g. ('a', 'b', 'c')
        @expandSubPaths: Whether or not to calculate subpath statistics for this path
        @frequency: A tuple (x,y) indicating the frequency of this path as subpath 
            (first component) and longest path (second component). Default is (0,1).
        """
        
        assert len(path)>0, 'Error: paths needs to contain at least one element'        

        if type(path[0]) == str:
            path_str = path
        else: 
            path_str = tuple(map(str, path))

        self.paths[len(path)-1][path_str] += frequency

        if expandSubPaths:
            for k in range(0, len(path_str)-1):
                for s in range(len(path_str)-k):
                    # for all start indices from 0 to n-k

                    subpath = ()
                    # construct subpath
                    for i in range(s, s+k+1):
                        subpath += (path_str[i],)
                    # add subpath weight to first component of occurrences                   
                    self.paths[k][subpath] += (frequency[1], 0)
def addPathTuple ( self , path , expandSubPaths = True , frequency = ( 0 , 1 ) ) : assert len ( path ) > 0 , 'Error: paths needs to contain at least one element' if type ( path [ 0 ] ) == str : path_str = path else : path_str = tuple ( map ( str , path ) ) self . paths [ len ( path ) - 1 ] [ path_str ] += frequency if expandSubPaths : for k in range ( 0 , len ( path_str ) - 1 ) : for s in range ( len ( path_str ) - k ) : # for all start indices from 0 to n-k subpath = ( ) # construct subpath for i in range ( s , s + k + 1 ) : subpath += ( path_str [ i ] , ) # add subpath weight to first component of occurrences                    self . paths [ k ] [ subpath ] += ( frequency [ 1 ] , 0 )