# Path: dsegmenter/treeseg/constants.py
# ENCODING = "utf-8"


from dsegmenter.treeseg.constants import ENCODING
from bisect import bisect_right

    def __nonzero__(self):
        """Return True if the given segment is not empty.

        Returns:
          bool: True if segment is not empty

        """
        return bool(self.leaves)

    def __unicode__(self):
        """Return unicode representation of given segment.

        Returns:
          unicode: unicode string representing this object

        """
        ret = u"(" + unicode(self.name)
        for t in self.leaves:
            ret += u' ' + unicode(t[-1])
        ret += u" )"
        return ret

    def __str__(self):
        """Return utf-8 string representation of given segment.

        Returns:
          str: utf-8 string representing this object

        """

# Path: dsegmenter/treeseg/constants.py
# ENCODING = "utf-8"


# Path: dsegmenter/treeseg/discourse_segment.py
from dsegmenter.treeseg.constants import ENCODING
from bisect import bisect_right


    def __nonzero__(self):
        """Return True if the given segment is not empty.

        Returns:
          bool: True if segment is not empty

        """
        return bool(self.leaves)

    def __unicode__(self):
        """Return unicode representation of given segment.

        Returns:
          unicode: unicode string representing this object

        """
        ret = u"(" + unicode(self.name)
        for t in self.leaves:
            ret += u' ' + unicode(t[-1])
        ret += u" )"
        return ret

    def __str__(self):
        """Return utf-8 string representation of given segment.

        Returns:
          str: utf-8 string representing this object

        """

        return self.__unicode__().encode(ENCODING)