# Path: dsenser/constants.py
# POS = "PartOfSpeech"
# 
# SNT_ID = 3
# 
# TOK_IDX = 0
# 
# TOK_ID = 4
# 
# TOK_LIST = "TokenList"
# 
# WORDS = "words"
# 
# Path: dsenser/resources.py
# CHM = ConnHeadMapper()
# 
# Path: dsenser/utils.py
# def is_explicit(a_rel):
#     """Check whether given relation is explicit.
# 
#     Args:
#       a_rel (dict):
#        discourse relation to classify
# 
#     Returns:
#       bool:
#         ``True`` if the relation is explicit, ``False`` otherwise
# 
#     """
#     return bool(a_rel[CONNECTIVE][TOK_LIST])


from dsenser.constants import POS, SNT_ID, TOK_IDX, TOK_ID, TOK_LIST, WORDS
from dsenser.scorer.conn_head_mapper import ConnHeadMapper
from dsenser.resources import CHM
from dsenser.utils import is_explicit
from collections import defaultdict
          tuple:
            trainings set with explicit and implicit connectives

        """
        if not a_ds:
            return (([], {}), ([], {}))
        explicit_instances = []
        implicit_instances = []
        for i, irel in enumerate(a_ds[0]):
            if is_explicit(irel):
                explicit_instances.append((i, irel))
            else:
                implicit_instances.append((i, irel))
        ret = ((explicit_instances, a_ds[1]),
               (implicit_instances, a_ds[1]))
        return ret

    def _normalize_conn(self, a_conn):
        """Normalize connective form.

        Args:
          a_conn (str):
            connectve to be normalized

        Returns:
          str: normalized connective

        """
        a_conn = a_conn.strip().lower()
        if a_conn:

# Path: dsenser/constants.py
# POS = "PartOfSpeech"
# 
# SNT_ID = 3
# 
# TOK_IDX = 0
# 
# TOK_ID = 4
# 
# TOK_LIST = "TokenList"
# 
# WORDS = "words"
# 
# Path: dsenser/resources.py
# CHM = ConnHeadMapper()
# 
# Path: dsenser/utils.py
# def is_explicit(a_rel):
#     """Check whether given relation is explicit.
# 
#     Args:
#       a_rel (dict):
#        discourse relation to classify
# 
#     Returns:
#       bool:
#         ``True`` if the relation is explicit, ``False`` otherwise
# 
#     """
#     return bool(a_rel[CONNECTIVE][TOK_LIST])


# Path: dsenser/base.py
from dsenser.constants import POS, SNT_ID, TOK_IDX, TOK_ID, TOK_LIST, WORDS
from dsenser.scorer.conn_head_mapper import ConnHeadMapper
from dsenser.resources import CHM
from dsenser.utils import is_explicit
from collections import defaultdict

          tuple:
            trainings set with explicit and implicit connectives

        """
        if not a_ds:
            return (([], {}), ([], {}))
        explicit_instances = []
        implicit_instances = []
        for i, irel in enumerate(a_ds[0]):
            if is_explicit(irel):
                explicit_instances.append((i, irel))
            else:
                implicit_instances.append((i, irel))
        ret = ((explicit_instances, a_ds[1]),
               (implicit_instances, a_ds[1]))
        return ret

    def _normalize_conn(self, a_conn):
        """Normalize connective form.

        Args:
          a_conn (str):
            connectve to be normalized

        Returns:
          str: normalized connective

        """
        a_conn = a_conn.strip().lower()
        if a_conn:

            return CHM.map_raw_connective(a_conn)[0]