Skip to content

Commit 918258a

Browse files
author
Andreas Buerki
committed
v. 0.7
1 parent af57034 commit 918258a

9 files changed

Lines changed: 55 additions & 25 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ tested under OS X, Xubuntu Linux, and via Cygwin on Windows 7 and 8 and should w
3030
*******
3131
COMPATIBLE SYSTEMS
3232

33-
The WADP was tested on OS X (v. 10.8 10.9 and 10.10), Xubuntu (v. 14.04) and Cygwin (v. 1.8) under Windows 7 and 8. It should run on all platforms on which a bash shell is installed, which includes Windows with the [Cygwin](cygwin.com) package installed.[^1]
33+
The WADP was tested on OS X (v. 10.12), Xubuntu (v. 14.04), Ubuntu (v. 16.04) and Cygwin under Windows 10. It should run on all platforms on which a bash shell is installed, which includes Windows with the [Cygwin](cygwin.com) package installed.[^1]
3434
[^1]: The supplied WADP-installer and double-clickable launcher assume that Cygwin is installed in `C:\cygwin` which is the default location. For more information regarding Cygwin requirements, see the WADP manual.
3535

3636
*******
3737
INSTALLATION
3838

3939
Using the supplied installers:
4040

41-
For OS X, Xubuntu and Cygwin, installers are provided. Inside the WADP directory, double-click on `Xubuntu_installer` (for Xubuntu), `OSX_installer` (OS X) or `Cygwin_installer`/`Cygwin64_installer` (for Cygwin regular and 64-bit installations).[^3]
42-
[^3]: If the double-clickable installers fail to run, open a terminal window and run the `install.sh` instead.
41+
For OS X, Ubuntu, Xubuntu and Cygwin, installers are provided. Move the WADP folder onto the Desktop of your computer. Inside the WADP directory, double-click on `Ubuntu_Installer` (for Ubuntu), `Xubuntu_installer` (for Xubuntu), `OSX_installer` (OS X) or `Cygwin_installer`/`Cygwin64_installer` (for Cygwin regular and 64-bit installations).[^3]
42+
[^3]: If the double-clickable installers fail to run (or when installing on other Linux/UNIX systems), open a terminal window and run the `install.sh` (inside the `src` folder) instead.
4343
These installers replace previous versions of the installed files. It may be necessary to log out and log in again before the installation takes effect. It should now be possible to launch the WADP by double-clicking on the yellow WADP icon placed on the desktop in in the WADP directory. For further details, see the included manual.
4444

4545
*******

README.pdf

1.07 KB
Binary file not shown.

Ubuntu_Installer.desktop

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[Desktop Entry]
2+
Type=Application
3+
Name=Installer Ubuntu
4+
Exec=src/installer.sh
5+
Terminal=true
6+
StartupNotify=false

release_notes.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
release notes v. 0.7
2+
********************
3+
4+
reporter module
5+
- made adjustments to run better under Cygwin
6+
7+
installer.sh
8+
- made adjustments to run better under Linux
9+
10+
added Ubuntu installer launcher and tested under Ubuntu 16.04
11+
12+
113
release notes v. 0.6.9
214
**********************
315

src/WADP.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export PATH="$PATH:/usr/local/bin:/usr/bin:/bin:"$HOME/bin"" # needed for Cygwin
55
copyright="(c) 2015 Cardiff University; written by Andreas Buerki
66
Licensed under the EUPL v. 1.1"
77
####
8-
version="0.6.9"
8+
version="0.7"
99
# DESCRRIPTION: processes word-association data
1010
################# defining functions ###############################
1111
#

src/administrator.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
copyright=" (c)2015-17 Cardiff University; written by Andreas Buerki
55
Licensed under the EUPL v. 1.1"
66
####
7-
version="0.6.9"
7+
version="0.7"
88
# DESCRRIPTION: performs administrative functions on wa dbs and data files
99
################# defining functions ###############################
1010
# define csv_parser function
1111
############################
1212
csv_parser ( ) {
13-
sed $extended -e 's/\|/PIPE/g' -e 's/\"\"//g' -e 's/(([^\",]+)|(\"[^\"]+\")|(\"\")|(\"[^\"]+\"\"[^"]+\"\"[^\"]+\")+)/\1\|/g' -e 's/\|$//g' -e 's/\|,/\|/g' -e 's/,,/\|\|/g' -e 's/\|,/\|\|/g' -e 's/^,/\|/g' -e 's/\"//g' $1
13+
sed $extended -e 's/\|/PIPE/g' -e 's/\"\"//g' -e 's/(([^\",]+)|(\"[^\"]+\")|(\"\")|(\"[^\"]+\"\"[^"]+\"\"[^\"]+\")+)/\1\|/g' -e 's/\|$//g' -e 's/\|,/\|/g' -e 's/,,/\|\|/g' -e 's/\|,/\|\|/g' -e 's/^,/\|/g' -e 's/\"//g' "$1"
1414
}
1515
# define add_windows_returns function
1616
#######################
@@ -127,7 +127,7 @@ echo
127127
echo " cue: $cue"
128128
new_cue=$cue
129129
echo
130-
new_diff="$(sed $extended -e 's/</*response missing*/' -e 's/>/*response missing*/' -e 's/ //g' -e 's/\|/ -> /' -e 's/\|/ vs. /' -e 's/\|/ -> /' -e 's/^/ /' <<< "$difference" | sed -e 's/QQUUEESSTTIIOONNMMAARRKK/?/g' -e 's/CCIIRRCCUUMMFFLLEEXX/^/g' -e 's/HHAASSHHTTAAGG/#/g' -e 's/EEXXCCLLAAMM/!/g')"
130+
new_diff="$(sed $extended -e 's/</-/' -e 's/>/-/' -e 's/ //g' -e 's/\|/ -> /' -e 's/\|/ vs. /' -e 's/\|/ -> /' -e 's/^/ /' <<< "$difference" | sed -e 's/QQUUEESSTTIIOONNMMAARRKK/?/g' -e 's/CCIIRRCCUUMMFFLLEEXX/^/g' -e 's/HHAASSHHTTAAGG/#/g' -e 's/EEXXCCLLAAMM/!/g')"
131131
echo "$new_diff"
132132
echo
133133
# following menu items are conditional so no empty side can be chosen
@@ -543,10 +543,10 @@ if [ "$dat_infile1_name" ]; then
543543
echo "" | tee -a $SCRATCHDIR/$log_name
544544
echo "$WARN The following responses to cue \"$cue\" differ:"|sed 's/^ //g' | tee -a $SCRATCHDIR/$log_name
545545
echo
546-
echo "$dat_infile1_name vs. $dat_infile2_name" | tee -a $SCRATCHDIR/$log_name
546+
echo "$dat_infile1_name vs. $dat_infile2_name" | tee -a $SCRATCHDIR/$log_name
547547
sort <<< "$resp1" | sed '/^$/d' > $SCRATCHDIR/resp1
548548
sort <<< "$resp2" | sed '/^$/d' > $SCRATCHDIR/resp2
549-
diff -y --suppress-common-lines $SCRATCHDIR/resp[12] | sed $extended -e 's/</*reponse missing*/g' -e 's/ + *>/*response missing* /'|sed -e 's/QQUUEESSTTIIOONNMMAARRKK/?/g' -e 's/CCIIRRCCUUMMFFLLEEXX/^/g' -e 's/HHAASSHHTTAAGG/#/g' -e 's/EEXXCCLLAAMM/!/g' -e 's/|//g'| tee -a $SCRATCHDIR/$log_name
549+
diff -y --suppress-common-lines $SCRATCHDIR/resp[12] | sed $extended -e 's/</-/g' -e 's/ + *>/- /'|sed -e 's/QQUUEESSTTIIOONNMMAARRKK/?/g' -e 's/CCIIRRCCUUMMFFLLEEXX/^/g' -e 's/HHAASSHHTTAAGG/#/g' -e 's/EEXXCCLLAAMM/!/g' -e 's/|//g'| tee -a $SCRATCHDIR/$log_name
550550
# copy over responses only found in dat_infile1
551551
for single_resp in $(comm -23 $SCRATCHDIR/resp[12]); do
552552
# copy it over and remove it

src/categoriser.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
copyright="categoriser.sh (c) 2015-17 Cardiff University; written by Andreas Buerki
44
- Licensed under the EUPL v. 1.1"
55
####
6-
version="0.6.9"
6+
version="0.7"
77
# DESCRRIPTION: assigns categories to word-association data
88
################ the following section can be adjusted
99
# the key used for category assignments
@@ -34,7 +34,7 @@ allowed_categories='A,CR,CRRC,E,F,I,L,LCR,LRC,OC,OCCR,OCRC,RC,S,SCR,SRC,SS'
3434
# define csv_parser function
3535
############################
3636
csv_parser ( ) {
37-
sed $extended -e 's/\|/PIPE/g' -e 's/\"\"//g' -e 's/(([^\",]+)|(\"[^\"]+\")|(\"\")|(\"[^\"]+\"\"[^"]+\"\"[^\"]+\")+)/\1\|/g' -e 's/\|$//g' -e 's/\|,/\|/g' -e 's/,,/\|\|/g' -e 's/\|,/\|\|/g' -e 's/^,/\|/g' -e 's/\"//g' $1
37+
sed $extended -e 's/\|/PIPE/g' -e 's/\"\"//g' -e 's/(([^\",]+)|(\"[^\"]+\")|(\"\")|(\"[^\"]+\"\"[^"]+\"\"[^\"]+\")+)/\1\|/g' -e 's/\|$//g' -e 's/\|,/\|/g' -e 's/,,/\|\|/g' -e 's/\|,/\|\|/g' -e 's/^,/\|/g' -e 's/\"//g' "$1"
3838
}
3939
#######################
4040
# define add_windows_returns function

src/install.sh

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export PATH="$PATH:/usr/local/bin:/usr/bin:/bin" # needed for Cygwin
33
##############################################################################
44
# installer (c) 2015 Cardiff University, licensed under the EUPL V.1.1.
55
# written by Andreas Buerki
6-
version="0.5"
6+
version="0.6"
77
####
88
## set installation variables
99
export title="WADP"
@@ -31,14 +31,14 @@ Options: -u uninstalls the software
3131
while getopts dhpuV opt
3232
do
3333
case $opt in
34-
d) diagnostic=true
34+
d) diagnostic=TRUE
3535
;;
3636
h) help
3737
exit 0
3838
;;
39-
u) uninstall=true
39+
u) uninstall=TRUE
4040
;;
41-
p) pathonly=true
41+
p) pathonly=TRUE
4242
;;
4343
V) echo "$(basename $(sed 's/ //g' <<<$0)) - version $version"
4444
echo "Copyright (c) 2015 Cardiff University"
@@ -61,23 +61,27 @@ fi
6161
platform=$(uname -s)
6262
# and make adjustments accordingly
6363
if [ "$(grep 'CYGWIN' <<< $platform)" ]; then
64-
CYGWIN=true
64+
CYGWIN=TRUE
6565
bash -lc 'export USERNAME="$USERNAME"'
6666
# check if $HOME contains spaces
6767
if [ "$(grep ' ' <<<"$HOME")" ]; then
6868
echo "WARNING: Your Cygwin installation user name contains one or more spaces." >&2
6969
fi
7070
elif [ "$(grep 'Darwin' <<< $platform)" ];then
71-
DARWIN=true
71+
DARWIN=TRUE
72+
elif [ "$(grep 'Linux' <<< $platform)" ]; then
73+
LINUX=TRUE
7274
else
73-
LINUX=true
75+
# probably some flavour of Linux
76+
LINUX=TRUE
7477
fi
7578
# ascertain source directory
7679
export sourcedir="$(dirname "$0")"
77-
if [ "$(grep '^\.' <<<"$sourcedir")" ]; then
80+
if [ "$(grep '^\.' <<<"$sourcedir")" ] || [ "$LINUX" ]; then
7881
sourcedir="$(pwd)/src"
7982
fi
8083
if [ "$diagnostic" ]; then
84+
echo "platform is $platform"
8185
echo "sourcedir is $sourcedir"
8286
echo "0 is $0"
8387
echo "dirname is $(dirname "$0")"
@@ -179,7 +183,7 @@ echo ""
179183
echo "Installing files to $HOME/bin"
180184
mkdir -p "$DESTINATION"
181185
for file in $components; do
182-
cp "$sourcedir/$file" "$DESTINATION/" || problem=true
186+
cp "$sourcedir/$file" "$DESTINATION/" || problem=TRUE
183187
if [ "$problem" ]; then
184188
echo "Installation encountered problems. Manual installation may be required." >&2
185189
exit 1

src/reporter.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
copyright="2015-7 Cardiff Universtiy; written by Andreas Buerki
55
- Licensed under the EUPL v. 1.1"
66
####
7-
version="0.6.9"
7+
version="0.7"
88
# DESCRRIPTION: creates reports for word-association data
99
################# defining functions ###############################
1010
# define csv_parser function
1111
############################
1212
csv_parser ( ) {
13-
sed $extended -e 's/\|/PIPE/g' -e 's/\"\"//g' -e 's/(([^\",]+)|(\"[^\"]+\")|(\"\")|(\"[^\"]+\"\"[^"]+\"\"[^\"]+\")+)/\1\|/g' -e 's/\|$//g' -e 's/\|,/\|/g' -e 's/,,/\|\|/g' -e 's/\|,/\|\|/g' -e 's/^,/\|/g' -e 's/\"//g' $1
13+
sed $extended -e 's/\|/PIPE/g' -e 's/\"\"//g' -e 's/(([^\",]+)|(\"[^\"]+\")|(\"\")|(\"[^\"]+\"\"[^"]+\"\"[^\"]+\")+)/\1\|/g' -e 's/\|$//g' -e 's/\|,/\|/g' -e 's/,,/\|\|/g' -e 's/\|,/\|\|/g' -e 's/^,/\|/g' -e 's/\"//g' "$1"
1414
}
1515
#######################
1616
# define add_windows_returns function
@@ -375,6 +375,9 @@ if [ -n "$(cut -d '|' -f 1 <<< "$in_header" | grep 'ID')" ]; then
375375
in_with_ID=true
376376
# put IDs in variable
377377
in_respondentIDs=$(cut -d '|' -f 1 <<< "$in_wa")
378+
if [ "$CYGWIN" ]; then
379+
in_respondentIDs="$(echo $in_respondentIDs | tr '\n' ' ')"
380+
fi
378381
# check if there are non-unique respondent IDs
379382
if [ "$(sort <<< "$in_respondentIDs" |uniq| wc -l)" -ne "$(wc -l <<< "$in_respondentIDs")" ]; then
380383
echo "ERROR: non-unique respondent IDs in $in_filename_only. Please verify and try again, or use file without respondent IDs."
@@ -437,9 +440,14 @@ fi
437440
# pick out cues from header
438441
cues="$(cut -d '|' -f $(sed -e 's/^ //' -e 's/ /,/g' <<< $cue_columns) <<< "$in_header")"
439442
no_of_cues=$(( $( tr -dc ' ' <<< $cue_columns | wc -c) + 1 ))
443+
# adjust cue count for Cygwin
444+
if [ "$CYGWIN" ]; then
445+
(( no_of_cues -= 1 ))
446+
fi
440447
if [ "$diagnostic" ]; then
441448
echo "cue columns: $cue_columns"
442449
echo "no of cues: $no_of_cues"
450+
sleep 1
443451
fi
444452
########################### assembling by-respondent report ####################
445453
if [ "$by_respondent" ]; then
@@ -458,7 +466,7 @@ if [ "$by_respondent" ]; then
458466
fi
459467
done
460468
# assemble overall list of categories
461-
extant_cats=$(cut -f 1 $RSCRATCHDIR/* | sort | uniq)
469+
extant_cats=$(cut -f 1 $RSCRATCHDIR/* | sort | uniq | tr '\n' ' ')
462470
if [ "$diagnostic" ]; then echo "categories are $extant_cats";fi
463471
echo "."
464472
##### assemble report
@@ -500,7 +508,6 @@ $(sed $extended 's/^\|//g' <<< "$out_row")"
500508
out_row=
501509
out_cat=
502510
fi
503-
504511
########################### assembling by-cue report ####################
505512
if [ "$by_cue" ]; then
506513
echo "Gathering figures for report of categories by cue..."
@@ -509,12 +516,13 @@ if [ "$by_cue" ]; then
509516
cut -d '|' -f $colu <<< "$in_categories" | sed 's/^$/_/g' | sort | uniq -c | sed $extended -e 's/^ +//' -e 's/([[:digit:]]+) (.+)/\2 \1/g' > $SCRATCHDIR/$(cut -d '|' -f $colu <<< $cues)
510517
done
511518
# assemble overall list of categories
512-
extant_cats=$(cut -f 1 $SCRATCHDIR/* | sort | uniq)
519+
extant_cats=$(cut -f 1 $SCRATCHDIR/* | sort | uniq |tr '\n' ' ')
513520
#echo "categories are $extant_cats"
514521
##### assemble report
515522
# assemble header
516523
report_out="cues|$(sed 's/ /|/g' <<< $extant_cats| sed 's/_/no response/g')"
517524
# assemble rows
525+
# cues="$(tr '\n' ' ' <<<$cues)"
518526
for row in $(eval echo {1..$no_of_cues}); do
519527
current_cue=$(cut -d '|' -f $row <<< $cues)
520528
out_row=$current_cue

0 commit comments

Comments
 (0)