예제 #1
0
    def test_get_field_words(self):
        dataset = Dataset('GDS987').populate()
        words = Word2Geo.get_field_words(dataset)

        expected = {
            "description": [
                u'analysis', u'of', u'kidneys', u'from', u'adult', u'renal',
                u'transplant', u'recipients', u'subjected', u'to',
                u'calcineurin', u'inhibitor-free', u'immunosuppression',
                u'using', u'sirolimus', u'patients', u'treated', u'with',
                u'sirolimus', u'have', u'a', u'lower', u'prevalence', u'of',
                u'chronic', u'allograft', u'nephropathy', u'compared', u'to',
                u'those', u'treated', u'with', u'cyclosporine', u'a',
                u'calcineurin', u'inhibitor'
            ],
            "title": [
                'kidney', u'transplant', u'response', u'to', u'calcineurin',
                u'inhibitor-free', u'immunosuppression', u'using', u'sirolimus'
            ],
            "summary": []
        }

        #        warn("words[title](%d)=%s" % (len(words['title']), words['title']))
        for tag, n_words in {
                "description": 105,
                "title": 9 + 8 + 7,
                "summary": 0
        }.items():
            self.assertEqual(len(words[tag]),
                             n_words,
                             msg="%s: got: %d, expected: %d" %
                             (tag, len(words[tag]), n_words))
예제 #2
0
    def test_get_field_words(self):
        geo_id='GSE10072'
        geo=Factory().newGEO(geo_id)
        words=Word2Geo.get_field_words(geo)

        self.assertEqual(len(words['title']), 42)
        self.assertEqual(len(words['description']), 0)
        self.assertEqual(len(words['summary']), 738) # not quite sure why this isn't 741
예제 #3
0
    def test_get_field_words(self):
        geo_id = "GSE10072"
        geo = Factory().newGEO(geo_id)
        words = Word2Geo.get_field_words(geo)

        self.assertEqual(len(words["title"]), 42)
        self.assertEqual(len(words["description"]), 0)
        self.assertEqual(len(words["summary"]), 738)  # not quite sure why this isn't 741
예제 #4
0
    def test_get_field_words(self):
        dataset=Dataset('GDS987').populate()
        words=Word2Geo.get_field_words(dataset)

        expected={"description" : [u'analysis', u'of', u'kidneys', u'from', u'adult', u'renal', u'transplant', u'recipients', u'subjected', u'to', u'calcineurin', u'inhibitor-free', u'immunosuppression', u'using', u'sirolimus', u'patients', u'treated', u'with', u'sirolimus', u'have', u'a', u'lower', u'prevalence', u'of', u'chronic', u'allograft', u'nephropathy', u'compared', u'to', u'those', u'treated', u'with', u'cyclosporine', u'a', u'calcineurin', u'inhibitor'],
                  "title" : ['kidney', u'transplant', u'response', u'to', u'calcineurin', u'inhibitor-free', u'immunosuppression', u'using', u'sirolimus'],
                  "summary" : []}

#        warn("words[title](%d)=%s" % (len(words['title']), words['title']))
        for tag, n_words in {"description": 105, "title": 9+8+7, "summary": 0}.items():
            self.assertEqual(len(words[tag]), n_words, msg="%s: got: %d, expected: %d" % (tag, len(words[tag]), n_words))