(outPath)
| 52 | } |
| 53 | |
| 54 | function run(outPath) { |
| 55 | const DATA_FILES = [ |
| 56 | 'train_AddToPlaylist_full.json', |
| 57 | 'train_GetWeather_full.json', |
| 58 | 'train_PlayMusic_full.json', |
| 59 | ]; |
| 60 | |
| 61 | const DATA_PATH = './data/raw/'; |
| 62 | |
| 63 | let allRecords = []; |
| 64 | DATA_FILES.forEach(fp => { |
| 65 | const fullPath = path.resolve(__dirname, path.join(DATA_PATH, fp)); |
| 66 | const loaded = loadJSON(fullPath); |
| 67 | const parsed = parseRecords(loaded); |
| 68 | allRecords = allRecords.concat(parsed); |
| 69 | }); |
| 70 | |
| 71 | console.log(`Parsed ${allRecords.length} records`); |
| 72 | writeCSV(allRecords, outPath); |
| 73 | } |
| 74 | |
| 75 | |
| 76 | const parser = new argparse.ArgumentParser(); |
no test coverage detected