returns all token offsets of this document as a generator of
        (token node ID str, character onset int, character offset int) tuples.

        Parameters
        ----------
        offset_ns : str or None
            The namespace from which the offsets will be retrieved. If no
            namespace is given, the default namespace of this document graph is
            chosen

        Returns
        -------
        offsets : generator(tuple(str, int, int))
            a generator of (token node ID str, character onset int, character
            offset int) tuples, which represents all the tokens in the order
            they occur in the document.

def _get_all_offsets(self, offset_ns=None):
        """
        returns all token offsets of this document as a generator of
        (token node ID str, character onset int, character offset int) tuples.

        Parameters
        ----------
        offset_ns : str or None
            The namespace from which the offsets will be retrieved. If no
            namespace is given, the default namespace of this document graph is
            chosen

        Returns
        -------
        offsets : generator(tuple(str, int, int))
            a generator of (token node ID str, character onset int, character
            offset int) tuples, which represents all the tokens in the order
            they occur in the document.
        """
        for token_id, _token_str in self.get_tokens():
            onset = self.node[token_id]['{0}:{1}'.format(offset_ns, 'onset')]
            offset = self.node[token_id]['{0}:{1}'.format(offset_ns, 'offset')]
            yield (token_id, onset, offset)