from config import *
import DataPreProcessing as dpp
import MergeMetaData as mmd
import XML2JSONCoverter as x2j
import TextExtractor as text
#import AddTextToMetadata as atm
import MetadataExtracter as me
from util import *

def main():
    #me.extractXML(BASE_PATH)
    XMLfilesPathArray = findAllFilesFromBasePath(NEW_ETDs_UPLOAD_PATH,'xml')
    x2j.convertXml2JsonfromPathArray(XMLfilesPathArray)
    mmd.merge()
    text.extractTexts(NEW_ETDs_UPLOAD_PATH, ETD_TEXT_PATH)
    #addAllTextToMetadata()
    dpp.preProcessAllMetadata(METADATA_JSON_FILE_PATH, NEW_METADATA_JSON_FILE_PATH)

if __name__ == '__main__':
	main()

    
