Old Wordmerge directions

potentially no longer needed.

WordMerge

This script helps with updating basic level .csv files after adding a new entry in the original .cha or .opf. After exporting your updated .cha or .opf to a csv, you can use wordmerge2.py to fill all the basic_level values from the original .csv into this new/updated csv file.

The script can be found on our GitHub repo here. On our lab Macs, the script can be found locally in the Github folder on the desktop OR on Opus at /Volumes/seedlings/Scripts_and_Apps/Github

Before starting your Wordmerge, you should pull the latest version of the script using git pull origin master in whichever directory you intend to use.

Usage

  1. Open Terminal on Macs or gitbash on PCs.

  2. Type cd and then drag in the folder where the script is. It should look something like this:

    cd /Users/bergelsonlab/Desktop/Github/SeedlingsBabylab/wordmerge

  3. Hit Enter.

  4. Now you can run the script. First type python wordmerge.py. Then, the script takes three arguments. Put these immediately after the python command and a space (don't hit enter).

    • the full path to the "old" file, located in Subject Files, e.g. /Volumes/Fas-Phyc-PEB-Lab/Seedlings/Subject_Files/09_07-14-2014/09_10/Home_Visit/Analysis/Audio_Analysis/09_10_audio_sparse_code.csv

    • the full path to the "new" file that you exported from CLAN or DataVyu into Working Files, e.g. /Volumes/Fas-Phyc-PEB-Lab/Seedlings/Working_Files/09_10/Audio/09_10_newclan_merged_processed.csv

    • the full path to the directory you want the script to output the wordmerged csv into (usually your working files folder), e.g. /Volumes/Fas-Phyc-PEB-Lab/Seedlings/Working_Files/09_10/Audio

  5. The script will output a new .csv file with the two files merged.

    • If there were any errors besides additions (capitalization or otherwise), the script will tell you and will output an error.txt file in an error folder. Check through these and make any necessary changes in the merged.csv and in your cha or opf

  6. Open your new merged.csv and fix the cells in the basic level column that say *** FIX ME ***. The first thing you should do is click the arrow in the upper left hand corner of the spreadsheet to highlight the whole sheet and then click Filter All (in the upper right hand corner of the menu bar). Then highlight the entire column of comments (the column to the right of basic_level) and DELETE COLUMN. We don't want comments in the final basic level sheet.

  7. Make sure you check the whole basic level according to our basic level rules. (All the basic_level entries from the original file will be filled in, but the new entries won't have basic levels yet.)

  8. Save your wordmerged.csv file to working files and delete your processed.csv file.

SLIDES to help with this process found here

Batch Wordmerge2

-batch Flag After adding -batch flag, it accepts two inputs: old_folder and new_folder

$ python wordmerge2.py old_folder new_folder -batch

This script then runs the normal wordmerge2 process for every pair of files that have the same prefix inside the old folder and prints new csv files to the new folder.

Two log files will also be generated in the new folder. date_count_log.csv records the counts for the occurrence of ***FIX ME***, *CASE* and *TIME*; date_error_log.csv records the counts of errors in different types for each file.

delta and mark inputs are set to default value inside this script, printLog is set to False so no individual log information would be printed to terminal or commandline, but the total count log would be displayed.

  • old_folder is the ABSOLUTE path of the old folder which contains both old files and new files and should be absolute path.

  • new_folder is the ABSOLUTE path of the new folder where merged csv files are generated and should be absolute path.

-pho Flag

After adding -pho flag, the script merges basic level from basic-level file to pho file.

The input types are the same as normal wordmerge2 process, except that the old_file is replaced by bl_file and the new_file is replaced by pho_file.

$ python wordmerge2.py bl_file pho_file new_file_writeTo delta mark printLog -pho

-pho flag can also be used with -batch flag, and the input types would be the same as normal wordmerge2 batch process.

$ python wordmerge2.py old_folder new_folder -batch -pho

Last updated