Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
44 lines (42 sloc) 2.25 KB
# This bash script conceived by Michael Ullyot (Augmented Criticism Lab, Department of English, University of Calgary: <>) and largely written by Kourosh Banaeianzadeh (LabNext, University of Calgary) on 14 October 2017
# First, clear your Terminal window:
# Create some variables to point, later, at the files to run on:
# Enable pyenv in your Bash shell, so we can run this on Python 2.7:
eval "$(pyenv init -)"
# Then use pyenv to switch the version of Python we're running:
pyenv global 2.7.14
# Just to be safe, confirm that it's the right version:
python --version
# Okay, preliminaries over. Now, move into the coreNLP directory:
cd /Users/ullyot/Sandbox/coreNLP
# Set the 3 lines of properties for coreNLP to follow:
echo "annotators = tokenize, ssplit, pos, lemma" >
echo "outputExtension = .xml" >>
echo "file = $inputFilePathName" >>
# Load the code, libraries, and model jars (whatever that means; see for details):
java -cp "/Users/ullyot/Sandbox/coreNLP/*" -Xmx2g edu.stanford.nlp.pipeline.StanfordCoreNLP -file inputFile
# Run the parser, using
java -cp "*" -Xmx500m edu.stanford.nlp.pipeline.StanfordCoreNLP -props
# Move coreNLP's output file back to the directory we started in:
mv "$inputFileName.xml" $originalDirectory
# Move into the directory containing Marie Dubremetz's chiasmusDetector, available here <>:
cd /Users/ullyot/Sandbox/chiasmusDetector
# Copy the original text file here:
cp $inputFilePathName .
# Copy the coreNLP's outful file here:
cp "$inputFilePathName.xml" .
# Now, at last, run the Python script:
python "$inputFileName.xml" "$inputFileName.chiasmus.xml"
# Then render it more legible with an XSLT transform:
xsltproc annotationDoc.xsl "$inputFileName.chiasmus.xml" > "$inputFileName.xslt"
# Remove the files you just used:
rm $inputFileName
rm "$inputFileName.xml"
# And move the output files to the directory we began with:
mv "$inputFileName.chiasmus.xml" $originalDirectory
mv "$inputFileName.xslt" $originalDirectory