# Path: dsegmenter/bparseg/constants.py
# NO_PARSE_RE = re.compile("""\s*No\s+parse\s+for\s*:\s*"([^\n]+)"$""",
#                          re.IGNORECASE)
# 
# WORD_SEP = re.compile("\s+")
# 
# ENCODING = "utf-8"


from .constants import NO_PARSE_RE, WORD_SEP, ENCODING
import codecs
import nltk.tree
import nltk
import sys
import re

##################################################################
class CTree(Tree):
    """Class for reading and modifying constituency trees.

    This class subclasses :class:`Tree`.

    This class extends its parent by one additional public class method
    :meth:`parse_lines()`

    """

    @classmethod
    def parse_lines(cls, a_lines, a_one_per_line=False):
        """Parse input lines and return list of BitPar trees.

        Args:
          a_lines (list): decoded lines of the input file
          a_one_per_line (bool): flag indicating whether file is in one
                         sentence per line format

        Yields:
          constituency trees

        """
        lines = []
        itree = None
        imatch = None
        for iline in a_lines:
            iline = iline.strip()

# Path: dsegmenter/bparseg/constants.py
# NO_PARSE_RE = re.compile("""\s*No\s+parse\s+for\s*:\s*"([^\n]+)"$""",
#                          re.IGNORECASE)
# 
# WORD_SEP = re.compile("\s+")
# 
# ENCODING = "utf-8"


# Path: dsegmenter/bparseg/constituency_tree.py
from .constants import NO_PARSE_RE, WORD_SEP, ENCODING
import codecs
import nltk.tree
import nltk
import sys
import re


##################################################################
class CTree(Tree):
    """Class for reading and modifying constituency trees.

    This class subclasses :class:`Tree`.

    This class extends its parent by one additional public class method
    :meth:`parse_lines()`

    """

    @classmethod
    def parse_lines(cls, a_lines, a_one_per_line=False):
        """Parse input lines and return list of BitPar trees.

        Args:
          a_lines (list): decoded lines of the input file
          a_one_per_line (bool): flag indicating whether file is in one
                         sentence per line format

        Yields:
          constituency trees

        """
        lines = []
        itree = None
        imatch = None
        for iline in a_lines:
            iline = iline.strip()

            imatch = NO_PARSE_RE.match(iline)