# 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
            relation argument to obtain senses for

        Returns:
          list: list of tokens and their parts of speech

        """
        ret = []
        snt = wrd = None
        for s_id, w_ids in \
                self._get_snt2tok(a_rel[a_arg][TOK_LIST]).iteritems():
            snt = a_parses[s_id][WORDS]
            for w_id in w_ids:
                wrd = snt[w_id]
                ret.append((wrd[TOK_IDX].lower(), wrd[1].get(POS)))
        return ret

    def _get_snt2tok(self, a_tok_list):
        """Generate mapping from sentence indices to token lists.

        Args:
          a_tok_list (list):
            list of sentence and token indices pertaining to the argument

        Returns:
          defaultdict:
            mapping from sentence indices to token lists

        """
        snt2tok_pos = defaultdict(set)
        for el in a_tok_list:

# 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

            relation argument to obtain senses for

        Returns:
          list: list of tokens and their parts of speech

        """
        ret = []
        snt = wrd = None
        for s_id, w_ids in \
                self._get_snt2tok(a_rel[a_arg][TOK_LIST]).iteritems():
            snt = a_parses[s_id][WORDS]
            for w_id in w_ids:
                wrd = snt[w_id]
                ret.append((wrd[TOK_IDX].lower(), wrd[1].get(POS)))
        return ret

    def _get_snt2tok(self, a_tok_list):
        """Generate mapping from sentence indices to token lists.

        Args:
          a_tok_list (list):
            list of sentence and token indices pertaining to the argument

        Returns:
          defaultdict:
            mapping from sentence indices to token lists

        """
        snt2tok_pos = defaultdict(set)
        for el in a_tok_list:

            snt_id = el[SNT_ID]