# Path: dsenser/resources.py
# BAR_RE = re.compile(r'\|')
# CHM = ConnHeadMapper()
# ELLIPSIS_RE = re.compile(r"[.][.]+")
# EQ_RE = re.compile("=+")
# HASH_RE = re.compile("\s*#\s*")
# SPACE_RE = re.compile("\s+")
# TAB_RE = re.compile("\t+")
# PSTEMMER = PorterStemmer()
# WORD1 = "word1"
# POL = "priorpolarity"
# POL_IDX = 0
# INTENS = "type"
# INTENS_IDX = 1
# POS = "pos1"
# POS_IDX = 2
# NEGATIONS = set(["cannot", "not", "none", "nothing",
#                  "nowhere", "neither", "nor", "nobody",
#                  "hardly", "scarcely", "barely", "never",
#                  "n't", "noone", "havent", "hasnt",
#                  "hadnt", "cant", "couldnt", "shouldnt",
#                  "wont", "wouldnt", "dont", "doesnt",
#                  "didnt", "isnt", "arent", "aint", "no"
#                  ])
# LCSI = load_LCSI(DFLT_LCSI_PATH)
# BROWN_CLUSTERS = LoadOnDemand(load_BROWN, DFLT_BROWN_PATH)
# CONNS = load_conns(DFLT_ECONN_PATH)
# CONNTOK2CONN = defaultdict(list)
# CONNTOKS = set(CONNTOK2CONN.keys())
# INQUIRER, STEMMED_INQUIRER = load_INQUIRER(DFLT_INQUIRER_PATH)
# MPQA = load_MPQA(DFLT_MPQA_PATH)
# W2V = LoadOnDemand(load_W2V, DFLT_W2V_PATH)
# def load_conns(a_fname):
# def conn2str(a_conn):
# def load_LCSI(a_fname):
# def load_BROWN(a_fname):
# def load_INQUIRER(a_fname):
# def load_MPQA(a_fname):
# def load_W2V(a_fname):
#     def __init__(self, a_cmd, *a_args, **a_kwargs):
#     def __contains__(self, a_name):
#     def __getitem__(self, a_name):
#     def load(self):
#     def unload(self):
# class LoadOnDemand(object):


from conftest import TEST_BROWN_PATH
from dsenser.resources import LoadOnDemand, load_BROWN, CONNS, DFLT_W2V_PATH, \
    INQUIRER, LCSI, MPQA, STEMMED_INQUIRER, W2V, conn2str
from unittest import TestCase
from mock import patch
import gensim
#!/usr/bin/env python
# -*- coding: utf-8; mode: python; -*-

##################################################################
# Imports
from __future__ import absolute_import





##################################################################
# Constants
ON_THE_CONTRARY = (("on", "the", "contrary"),)
NEITHER_NOT = (("neither", ), ("nor",))
EMPTY = ((), )
BROWN_CLUSTERS = LoadOnDemand(load_BROWN, TEST_BROWN_PATH)


##################################################################
# Test Classes
class TestResources(TestCase):
    def test_BROWN_CLUSTERS(self):
        assert BROWN_CLUSTERS["jasper"] == "1100011110"
        assert BROWN_CLUSTERS["un"] == "1100011110|1110110010|1011010110"
        assert "" not in BROWN_CLUSTERS

    def test_CONNS(self):
        assert ON_THE_CONTRARY in CONNS

# Path: dsenser/resources.py
# BAR_RE = re.compile(r'\|')
# CHM = ConnHeadMapper()
# ELLIPSIS_RE = re.compile(r"[.][.]+")
# EQ_RE = re.compile("=+")
# HASH_RE = re.compile("\s*#\s*")
# SPACE_RE = re.compile("\s+")
# TAB_RE = re.compile("\t+")
# PSTEMMER = PorterStemmer()
# WORD1 = "word1"
# POL = "priorpolarity"
# POL_IDX = 0
# INTENS = "type"
# INTENS_IDX = 1
# POS = "pos1"
# POS_IDX = 2
# NEGATIONS = set(["cannot", "not", "none", "nothing",
#                  "nowhere", "neither", "nor", "nobody",
#                  "hardly", "scarcely", "barely", "never",
#                  "n't", "noone", "havent", "hasnt",
#                  "hadnt", "cant", "couldnt", "shouldnt",
#                  "wont", "wouldnt", "dont", "doesnt",
#                  "didnt", "isnt", "arent", "aint", "no"
#                  ])
# LCSI = load_LCSI(DFLT_LCSI_PATH)
# BROWN_CLUSTERS = LoadOnDemand(load_BROWN, DFLT_BROWN_PATH)
# CONNS = load_conns(DFLT_ECONN_PATH)
# CONNTOK2CONN = defaultdict(list)
# CONNTOKS = set(CONNTOK2CONN.keys())
# INQUIRER, STEMMED_INQUIRER = load_INQUIRER(DFLT_INQUIRER_PATH)
# MPQA = load_MPQA(DFLT_MPQA_PATH)
# W2V = LoadOnDemand(load_W2V, DFLT_W2V_PATH)
# def load_conns(a_fname):
# def conn2str(a_conn):
# def load_LCSI(a_fname):
# def load_BROWN(a_fname):
# def load_INQUIRER(a_fname):
# def load_MPQA(a_fname):
# def load_W2V(a_fname):
#     def __init__(self, a_cmd, *a_args, **a_kwargs):
#     def __contains__(self, a_name):
#     def __getitem__(self, a_name):
#     def load(self):
#     def unload(self):
# class LoadOnDemand(object):


# Path: tests/test_resources.py
from conftest import TEST_BROWN_PATH
from dsenser.resources import LoadOnDemand, load_BROWN, CONNS, DFLT_W2V_PATH, \
    INQUIRER, LCSI, MPQA, STEMMED_INQUIRER, W2V, conn2str
from unittest import TestCase
from mock import patch
import gensim

#!/usr/bin/env python
# -*- coding: utf-8; mode: python; -*-

##################################################################
# Imports
from __future__ import absolute_import





##################################################################
# Constants
ON_THE_CONTRARY = (("on", "the", "contrary"),)
NEITHER_NOT = (("neither", ), ("nor",))
EMPTY = ((), )
BROWN_CLUSTERS = LoadOnDemand(load_BROWN, TEST_BROWN_PATH)


##################################################################
# Test Classes
class TestResources(TestCase):
    def test_BROWN_CLUSTERS(self):
        assert BROWN_CLUSTERS["jasper"] == "1100011110"
        assert BROWN_CLUSTERS["un"] == "1100011110|1110110010|1011010110"
        assert "" not in BROWN_CLUSTERS

    def test_CONNS(self):
        assert ON_THE_CONTRARY in CONNS

        assert NEITHER_NOT in CONNS