Exemplo n.º 1
0
def medlineParser(xmlDict, saveDict, numOfProcess):
    '''
    Parse medline raw data files
    '''
    path = xml.listXmlPath(xmlDict)

    pool = cocurrency.processPool(numOfProcess)

    try:
        pool.map(medlineEntry, itertools.izip(path, itertools.repeat(saveDict)))

    except Exception:
        raise
Exemplo n.º 2
0
def medlineParser(xmlDict, saveDict, numOfProcess):
    '''
    Parse medline raw data files
    '''
    path = xml.listXmlPath(xmlDict)

    pool = cocurrency.processPool(numOfProcess)

    try:
        pool.map(medlineEntry, itertools.izip(path,
                                              itertools.repeat(saveDict)))

    except Exception:
        raise
Exemplo n.º 3
0
 def test_listXmlPath(self):
     xmlPath = xml.listXmlPath('../data/pubmedMedline/')
     for index, url in enumerate(xmlPath):
         suffix = url.split('.')[1]
         self.assertEqual(suffix, 'xml')
Exemplo n.º 4
0
 def test_xmlConvDict(self):
     xmlPath = xml.listXmlPath('../data/')
     for index, url in enumerate(xmlPath):
         conv = xml.xmlConvDict(url)
         self.assertEqual(type(conv), dict)
Exemplo n.º 5
0
 def test_listXmlPath(self):
     xmlPath = xml.listXmlPath('../data/pubmedMedline/')
     for index, url in enumerate(xmlPath):
         suffix = url.split('.')[1]
         self.assertEqual(suffix, 'xml')
Exemplo n.º 6
0
 def test_xmlConvDict(self):
     xmlPath = xml.listXmlPath('../data/')
     for index, url in enumerate(xmlPath):
         conv = xml.xmlConvDict(url)
         self.assertEqual(type(conv), dict)