#!/bin/sh
#] 
#] *********************
#] $ bash "$d_bin"'blog/blog analysis.sh' 
# www.BillHowell.ca  11Oct2024 initial 
# view in text editor, using constant-width font (eg courier), tabWidth = 3

# for tests see "$d_SysMaint"'blogs/0_blogs notes.txt'
#24************************24




#24************************24
# List of operators, generated with :
# $ grep  "^#]"  "$d_bin"'blog/blog analysis.sh' |  sed "s/^#\]/  /"  >"$d_bin"'blog/blog analysis TblOfContents.txt'
#


#08********08
# Setup 

source  "$d_bin"'standard header.sh'
source  "$d_bin"'fileops.sh'
source  "$d_bin"'blog/blog header Jacobovici.sh'


#08********08
#] +-----+
#] basics- keyWrdA_setup, pTxt_to_pWrdL : 


#] keyWrdA_setup()  - create an array of keywords from catenation of several keyword files
# 13Oct2024 initial
# arrays: "$d_SysMaint"'Linux/array notes.txt'

	keyWrdA_setup()
{  
	#rm current arrays, if they exist
	unset  nullL
	unset  keyWrdL
	unset  scoreL

	i=0
	while read -u 9  pKeyWrd;  do
		while read -u 8  line;  do
			keyWrdL[$i]=$( echo "$line"  |  sed  's|\(.*\)\t.*|\1|' )
			scoreL[$i]=$( echo "$line"  |  sed  's|.*\t\(.*\)|\1|' )
			nullL[$i]=0
			let "i= i + 1"
		done 8< "$pKeyWrd"
	done 9< "$pKeyWrd_pthL"
	keyWrdA_length="$i"
}

# Jacobovici pKeyWrdAllL.txt : [old, not used] but maybe useful for something else
# $ cat  "$"  "$"  "$"  >"$"


#] pTxt_to_pWrdL()  - extract all words in pTxt (mv this to fileops.sh later)
# 14Oct2024
# see "$d_SysMaint"'Linux/unicode notes.txt'


	pTxt_to_pWrdL()
{  
	# problems \{\}\\\/[,][(][)]\[\]\|\-
	iconv -f utf8 -t ascii//TRANSLIT   "$pCmtRaw"  |  sed  's|[ ~#%+^_<>$!?:;=()`\&\.\"\*\|’“”,]\+|\n|g'  |  sed  "s|[ \']\+|\n|g"  |  sort -u --ignore-case  >"$pWrdBlogRawL"
	grep  "^@"  "$pWrdBlogRawL"  >"$pAuthorL"
	grep  --invert-match  "^@"  "$pWrdBlogRawL"  >"$pNoAuthL"
}  


#] pWrdL_rmStdDictionary_pNovel()  - rm words from pWrdL that are in the Linux dictionary
#]     14Oct2024 mv this to fileops.sh later
# 14Oct2024

	pWrdL_rmStdDictionary_pNovel()
{  
	echo ''

}  



#08********08
#] +-----+
#] transcription processing [manual, auto] stages : 


#] pCmtBig_process()  - save comments longer than pMinSize to pCmtBig

	pCmtBig_process()
{  
	pSize=$( pth_get_byteSize  "$pCmtOne" )
	if [ "$pSize"  -gt  "$pMinSize" ]; then  cat   >>"$pCmtTmp"  "$pCmtOne";  fi
	echo  >"$pCmtOne"  ''
}  


#] pCmtKey_process()  - augment pCmtBig with keyword scores
# 13Oct2024 @00:22

	pCmtKey_process()
{  
	iskeyL=''
	scoreTotal=0

	for (( i=0; i < $keyWrdA_length; i++ ))
	do 
		iskeyL[$i]=$( grep -iq "${keyWrdL[$i]}"  "$pCmtOne"; [ $? -eq 0 ] && echo  "${scoreL[$i]}"  || echo 0 )
		let "scoreTotal = scoreTotal + ${iskeyL[$i]}"
	done 
# nyet	keyWrdA_length=i

	echo  >>"$pCmtTmp"  "#] $scoreTotal  ${iskeyL[@]}"
	cat   >>"$pCmtTmp"  "$pCmtOne"  
	echo  >"$pCmtOne"  ''
}  


#] pCmtScr_process()  - filter pCmtKey by keyword score
# 13Oct2024 @00:22

	pCmtScr_process()
{  
	score_=$( grep  '#] '  "$pCmtOne"  |  sed  s'|#\] \([-]*\)\([0-9]\+\) .*|\1\2|'  )
	if  [[  "$score_"  -gt  0  ]]; then  cat   >>"$pCmtTmp"  "$pCmtOne";  fi 
	echo  >"$pCmtOne"  ''
}  


#] manually mark ALL pCmtScr comments with [#+, #-] to [select, ignore] (huge work)


#] pInnOut_process()  - filter pInnOut by OR("^#+' = Inn), depending on 
# 17Oct2024 @00:22

	pInnOut_process()
{  
	bolInnOut=$( grep  "$strInnOut"  "$pCmtOne"  )
	if  [[ -n  "$bolInnOut" ]]; then  cat   >>"$pCmtTmp"  "$pCmtOne";  fi 
	echo  >"$pCmtOne"  ''
}  


#] manually mark a copy of ALL pCmtInn with [#> , #>>] lists of fNams (huge work)
#]    the fNams apply of [all, part] of comment



#08********08
#] +-----+
#] themes processing : 


#] getRestOfCmtL()  - adds '#> '  marked fNamThemes to array restOfCmtL
#]    restOfCmtL applies to the rest of a comment
# 22Oct2024 initial

	getRestOfCmtL()
{  
		echo  'bolThemeL :'
		echo  "$bolThemeL"
	# how many restOfCmtL are there [current, new, all]?
	nStrt=${#restOfCmtL[@]}
		echo  "nStrt = $nStrt"
	nFnam=$( echo  "$bolThemeL"  |  grep -o "'" | wc -l )
	let 'nFnam =  nFnam / 2'
		echo  "nFnam = $nFnam"
	let 'nAll = nStrt + nFnam'
		echo  "nAll  = $nAll"

	# extract fNamThemeL
#	pass=$( echo  "$bolThemeL"  |  sed 's|^#>\+ ||'  |  sed  "s|.*[']\(.*\)['].*|\1|" )
#	pass="$bolThemeL"
	pass=$( echo  "$bolThemeL"  |  sed 's|^#>\+ ||' )
		echo  "bolTheme no '#> ' = $pass"
	for (( i=nStrt; i < $nAll; i++ )); do  
		restOfCmtL[$i]=$( echo  "$pass"  |  sed "s|.*[']\(.*\)['].*|\1|" )  
			echo  "restOfCmtL[$i] = ${restOfCmtL[$i]}"
		pass=$( echo  "$pass"  |  sed "s|\(.*\)['].*['].*|\1|" )
			echo  "pass $1 = $pass"
	done 
		echo  'restOfCmtL[@] : '
		echo  "${restOfCmtL[@]}"

}


# $ bash  "$d_bin"'blog/blog analysis.sh'  


#] getParagraphL()  - adds '#>> ' marked fNamThemes to array paragraphL
#]    paragraphL applies only to a "paragraph", can be line sequence without whiteLines
# 22Oct2024 initial

	getParagraphL()
{  
		echo  'bolThemeL :'
		echo  "$bolThemeL"
	# unset  paragraphL was done before this was called, only NEW fNams are used
	nFnam=$( echo  "$bolThemeL"  |  grep -o "'" | wc -l )
	let 'nFnam =  nFnam / 2'
		echo  "nFnam = $nFnam"

	# extract fNamThemeL
#	pass=$( echo  "$bolThemeL"  |  sed 's|^#>\+ ||'  |  sed  "s|.*[']\(.*\)['].*|\1|" )
#	pass="$bolThemeL"
	pass=$( echo  "$bolThemeL"  |  sed 's|^#>\+ ||' )
		echo  "bolTheme no '#> ' = $pass"
	for (( i=0; i < $nFnam; i++ )); do  
		paragraphL[$i]=$( echo  "$pass"  |  sed "s|.*[']\(.*\)['].*|\1|" )  
			echo  "paragraphL[$i] = ${paragraphL[$i]}"
		pass=$( echo  "$pass"  |  sed "s|\(.*\)['].*['].*|\1|" )
			echo  "pass $1 = $pass"
	done 
		echo  'paragraphL[@] : '
		echo  "${paragraphL[@]}"
}


#] pCmtTmp_typ_save_pThemeAry()  - appends [author, line of a comment] to applicable theme files  
# 23Oct2024 initial

	pCmtTmp_typ_save_pThemeAry()
{  
	pCmtTmp="$1"
	strThemeAry="$2"
	getThemeAry="$3"

	themeAry=$( eval  "$strThemeAry" )

	echo  >>"$pCmtTmp"  ''  
	# pCmtTmp : save to current themeAry[@] then rm , ready for future ontents
	lenThemeAry=${#themeAry[@]}
	for (( i=0; i < $lenThemeAry; i++ )); do  
		cat  >>"$dThemes${themeAry[$i]}"  "$pCmtTmp"
	done 
	# preps for new paragraph 
	#		-> nuts! I want to add linAuthor only to new themeAry[$i]
	rm    "$pCmtTmp"
	eval  "$getThemeAry"
		echo  >>"$pCmtTmp"  "$linAuthor"  
		echo  >>"$pCmtTmp"  "$line"  
}


#] pCmtThm_process()  - processes a single comment, allocating parts to [pCmtRest, pCmtParg]s
# 21Oct2024 

	pCmtThm_process()
{  
	# check inputs
		echo  "dThemes = $dThemes"
		echo  "pThemeL = $pThemeL"
		echo  "pBlgTst = $pBlog"

#	#rm pThemeL - NOT if iterative buildip~!~
#	while read -u 8  pTheme;  do
#		pinn_archiveLocalRm  "$dThemes$pTheme"
#	done 8<"$pThemeL"

	#rm current arrays, if they exist
#	unset  themeA
	unset  restOfCmtL
	unset  paragraphL

	exec 7<"$pCmtTmp"

	# skip ['#] count keyWrdCodel', '#[-, +]']lines - won't appear in pThemes
	read -u 7  line
	read -u 7  line
	# linAuthor - all pTheme files require this!
	read -u 7  linAuthor

	while read -u 7  line;  do
		bolThemeLine=$( echo "$line"  |  grep  '^#[>]\+[ ]\+' ) 
		bolWhiteLine=$( echo "$line"  |  sed   's|[ \t]*||'   ) 
		bolVotesLine=$( echo "$line"  |  grep  '[|] Votes:'   ) 
		if			[[ -n "$bolThemeLine"		]]; then  
			themeType=$( echo "$bolThemeL"  |  sed  's|^\(#[>]\+\).*|\1|' ) 
			if		[[ "$bolThemeL" == '#> '	]]; then  
				#pCmtTmp_typ_save_pThemeAry  pCmtTmp  themeAry  getThemeAry
				pCmtTmp_typ_save_pThemeAry  "$pCmtRest"  'restOfCmtL[$i]'  'getRestOfCmtL'
			elif	[[ "$bolThemeL" == '#>> '	]]; then  
				#pCmtTmp_typ_save_pThemeAry  pCmtTmp  themeAry  getThemeAry
				pCmtTmp_typ_save_pThemeAry  "$pCmtParg"  'paragraphL[$i]'  'getParagraphL'
			else  echo "themeLine error $bolThemeL"
			fi
		elif	[[ -z "$bolWhiteLine"  ||  -z "$bolVotesLine" ]]; then  
				pCmtTmp_typ_save_pThemeAry  "$pCmtParg"  'paragraphL[$i]'  'getParagraphL'
		else
			echo  >>"$pCmtRest"  "$line"  
			echo  >>"$pCmtParg"  "$line"
		fi 
	done 

	# 12Nov2024 temporary end after one comment only
	bolEnd=1
}  



#08********08
#] +-----+
#] Blog comment processing, common approach :

#] pBlog_get_pCmt()  - gets lines of a single comment

	pBlog_get_pCmt()
{  
	echo  >"$pCmtOne"  "$strNew"

	bolInn=1
	while [[ "$bolInn" == 1 ]]; do
		read -u 9 line
		bolNew=$( echo "$line"  |  grep  "$strCmtStart" )
		if  [[ -n  "$bolNew" ]]; then
			eval  "$funcSel"
			strNew="$line"
			bolInn=0
		elif	[[ "$line" ==  '# enddoc' ]]; then
			bolInn=0
			bolEnd=1
		else
			echo  >>"$pCmtOne"  "$line" 
		fi
	done 
}


#] pBlog_process()  - process a blog txt file 

	pBlog_process()
{  
	funcSel="$1"
	strCmtStart="$2"
	pBlog="$3"
	pCmtSel="$4"

	if  [ -f  "$pCmtOne" ]; then  rm  "$pCmtOne";  fi
	if  [ -f  "$pCmtTmp" ]; then  rm  "$pCmtTmp";  fi
	if  [ -f  "$pCmtSel" ]; then  rm  "$pCmtSel";  fi

	keyWrdA_setup
		echo  "keyWrdA_length = $keyWrdA_length"
		echo  'funcSel ==  '"$funcSel"

	if		[ "$funcSel" == 'pCmtBig_process' ]; then
		# get rid of unicode etc
		iconv   >"$pNoUnic"  -f utf8 -t ascii//TRANSLIT  "$pCmtRaw"
		echo   >>"$pNoUnic"  ''
		echo   >>"$pNoUnic"  '# enddoc'
		echo   >>"$pNoUnic"  ''
																	 exec 9<"$pNoUnic"
	elif	[ "$funcSel" == 'pCmtKey_process' ]; then  exec 9<"$pCmtBig"
	elif	[ "$funcSel" == 'pCmtScr_process' ]; then  exec 9<"$pCmtKey"
	# pInnOut is manual on a cp of pCmtScr
	elif	[ "$funcSel" == 'pInnOut_process' ]; then  exec 9<"$pInnOut"
	# pCmtInn is manual on a cp of pInnOut
	elif	[ "$funcSel" == 'pCmtThm_process' ]; then  exec 9<"$pCmtInn"
	fi

	# ignore early part of file up to 1st comment
	bolStart=1
	while [[ "$bolStart" == 1 ]]; do
		read -u 9 line
		bolNew=$( echo "$line"  |  grep  "$strCmtStart" )
		if [[ -n  "$bolNew" ]]; then
			strNew="$line"
			bolStart=0
		fi
	done

	# one outputfile only for pCmt[Big, Key, Scr]_process & pInnOut_process : 
	#    final version of extracted file, with extraction stats
	if		[[ "$funcSel" == 'pCmtBig_process'  ||  "$funcSel" == 'pCmtKey_process'  ||   "$funcSel" == 'pCmtScr_process'   ||   "$funcSel" == 'pInnOut_process' ]]; then 
		# one outputfile only for pCmt[Big, Key, Scr]_process & pInnOut_process : 
		#    final version of extracted file, with extraction stats
		bolEnd=0
		while [[ "$bolEnd" == 0 ]]; do  pBlog_get_pCmt;  done
		nCmt=$( grep  -o "$strCmtStart"  "$pCmtTmp" |  wc -l )
		echo  >>"$pCmtSel"  "# of extracted comments:  $nCmt" 
		echo  >>"$pCmtSel"  '' 
		cat   >>"$pCmtSel"  "$pCmtTmp" 
		echo  >>"$pCmtSel"  '' 
		echo  >>"$pCmtSel"  '# enddoc'
		echo  >>"$pCmtSel"  '' 
	# pCmtThm_process - all comments sorted into theme files ([theme, comment] redundancies)
	elif	[ "$funcSel" == 'pCmtThm_process' ]; then  
		bolEnd=0
#		while [[ "$bolEnd" == 0 ]]; do  
			pCmtThm_process  
#		done
	fi

} 

# 15Oct2024 for pCmtScr_process :
# 20:20$ grep  -o '#] '  "$pCmtTmp" |  wc -l 
# 175


#08********08
#] +-----+
#] tests, except themes tests handled separately : 


#] test_keyWrdA_setup()  - 

	test_keyWrdA_setup()
{  
	date_ymdhm=$(date +"%y%m%d %kh%Mm")
	
	echo  >>"$pTstLog"  ''
	echo  >>"$pTstLog"  '************'
	echo  >>"$pTstLog"  "test_keyWrdA_setup  $date_ymdhm"
	echo  >>"$pTstLog"  ''
	echo  >>"$pTstLog"  'i  score  keyWord'

	keyWrdA_setup
# nyet	keyWrdA_length=${#scoreL[@]}
	for (( i=0; i < ${keyWrdA_length}; i++ ))
	do 
		echo >>"$pTstLog"  "$i  ${scoreL[$i]}  ${keyWrdL[$i]}"
	done
	echo  >>"$pTstLog"  ''
	echo  >>"$pTstLog"  "nullL = ${nullL[@]}"
	echo  >>"$pTstLog"  ''
} 


#] pCmtKey_process_test()  - pCmtBig -> add [scoreTotal, keyWrdL] -> pCmtKey
# 13Oct2024

	pCmtKey_process_test()
{  
	#rm current arrays, if they exist
	unset  nullL
	unset  keyWrdL
	unset  scoreL
	scoreTotal=0

	# adapted from keyWrdA_setup()
	i=0
	while read -u 8  line;  do
		keyWrdL[$i]=$( echo "$line"  |  sed  's|\(.*\)\t.*|\1|' )
		scoreL[$i]=$( echo "$line"  |  sed  's|.*\t\(.*\)|\1|' )
		nullL[$i]=0
		let "i= i + 1"
	done 8< "$pCmtTst"

	for (( i=0; i < $keyWrdA_length; i++ )); do 
		scoreL_test[$i]=$( grep -iq "${keyWrdL[$i]}"  "$pCmtTst"; [ $? -eq 0 ] && echo  "${scoreL[$i]}"  || echo 0 )
		let "scoreTotal = scoreTotal + ${scoreL[$i]}"
	done 

	echo  >>"$pTstLog"  "scoreTotal  = $scoreTotal"
	echo  >>"$pTstLog"  "scoreL      = ${scoreL[@]}"
	echo  >>"$pTstLog"  ''
}  



#] test_pCmtKey_process()  - 14Oct2024 this is messed up!

	test_pCmtKey_process()
{  
	#  - see setup above
	date_ymdhm=$(date +"%y%m%d %kh%Mm")
	
	echo  >>"$pTstLog"  ''
	echo  >>"$pTstLog"  '************'
	echo  >>"$pTstLog"  "test_pCmtKey_process  $date_ymdhm"
	echo  >>"$pTstLog"  ''

	pCmtTst="$dBlog"'Jacobovici keyWrdL scriptSpecific.txt'
	echo  >>"$pTstLog"   'Jacobovici pCmtKey_process_test test keyWrdL scriptSpecific'
	pCmtKey_process_test

	pCmtTst="$d_bin"'blog/Jacobovici keyWrdL scriptSpecific 1st half.txt'
	echo  >>"$pTstLog"   'Jacobovici pCmtKey_process_test test keyWrdL scriptSpecific 1st half'
	pCmtKey_process_test

	pCmtTst="$d_bin"'blog/keyWrdL nice.txt'
	echo  >>"$pTstLog"   'keyWrdL nice pCmtKey_process_test test'
	pCmtKey_process_test

	pCmtTst="$d_bin"'blog/keyWrdL nice 1st half.txt'
	echo  >>"$pTstLog"   'keyWrdL nice pCmtKey_process_test test 1st half'
	pCmtKey_process_test

	pCmtTst="$d_bin"'blog/keyWrdL bad.txt'
	echo  >>"$pTstLog"   'keyWrdL bad pCmtKey_process_test test'
	pCmtKey_process_test

	pCmtTst="$d_bin"'blog/keyWrdL bad 2nd half.txt'
	echo  >>"$pTstLog"   'keyWrdL bad pCmtKey_process_test test 2nd half'
	pCmtKey_process_test

} 




#08********08
#] +-----+
#] blog: summary of classification after manual annotations


#] pCmtScr_getIOCount_pLog()  - InnOut counts in pCmtScr, saved to pLog
# 16Oct2024 initial

	pCmtScr_getIOCount_pLog()
{  
	cmtL=''
	cmtSum=0
	cmtTot=$( grep  -o "^#] "  "$pInnOut" |  wc -l )

	for (( i=1; i < 14; i++ )); do 
		cmt[$i]=$( grep  -o  "^#] $i "  "$pInnOut" |  wc -l )
		let "cmtSum = cmtSum + ${cmt[$i]}"
		cmtL="$cmtL  ${cmt[$i]}"
	done

	cmtInn=$( grep  -o "^#[+]"		"$pInnOut" |  wc -l )
	cmtOut=$( grep  -o "^#\-"		"$pInnOut" |  wc -l )
	let "cmtMis = $cmtTot - $cmtInn - $cmtOut"
	let "sumIOM = $cmtInn + $cmtOut - $cmtMis"
	# echo results
	date_ddmmmyyyy_hms=$(date +"%0e%0b%0Y %0kh%0Mm%0Ss")
	echo  >>"$pTstLog"  ''
	echo  >>"$pTstLog"  '*********************'
	echo  >>"$pTstLog"  "pCmtScr_get_pLogIOCountL  $date_ddmmmyyyy_hms"
	echo  >>"$pTstLog"  ''
	echo  >>"$pTstLog"  "cmtTot = $cmtTot"
	echo  >>"$pTstLog"  "cmtSum = $cmtSum"
	echo  >>"$pTstLog"  ''
	echo  >>"$pTstLog"  'cmt[$i] : '
	echo  >>"$pTstLog"  '  1   2    3   4    5   6  7  8  9 10 11 12 13'
	echo  >>"$pTstLog"  "$cmtL"
	echo  >>"$pTstLog"  ''
	echo  >>"$pTstLog"  "cmtInn = $cmtInn"
	echo  >>"$pTstLog"  "cmtOut = $cmtOut"
	echo  >>"$pTstLog"  "cmtMis = $cmtMis"
	echo  >>"$pTstLog"  "sumIOM = $sumIOM"
	echo  >>"$pTstLog"  ''
}


#] pCmtScr_get_pIOMisL()  - get list of scores that don't have annotation
#]    eg '#] 2  0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0'
# 17Oct2024 initial

	pCmtScr_get_pIOMisL()
{  
	cmtSum=0
	date_ddmmmyyyy_hms=$(date +"%0e%0b%0Y %0kh%0Mm%0Ss")

	echo   >"$pIOMisL"  ''
	echo  >>"$pIOMisL"  '*********************'
	echo  >>"$pIOMisL"  "pCmtScr_get_pIOMisL  $date_ddmmmyyyy_hms"
	echo  >>"$pIOMisL"  ''

	while IFS='' read -u 9 line; do
		bolNew=$( echo "$line"  |  grep  "^#] " )
		if [[ -n  "$bolNew" ]]; then
			read -u 9 line
			bolIO=$( echo "$line"  |  grep  "^#" )
			if [[ -z  "$bolIO" ]]; then
				echo  >>"$pIOMisL"  "$bolNew"
			fi
		fi
	done  9<"$pInnOut"

	echo  >>"$pIOMisL"  ''
} 

# to find all '#] ' for which following line doesn't start with # :
# geany regexpr multiline search :  #] 4 .*\n[^#]
# to find all '#] ' for which following line doesn't start with #[+-] :
# geany regexpr multiline search :  #] 4 .*\n#[^+-]
# geany regexpr multiline search :  #] .*\n #

# nothing :
# geany regexpr multiline search :  #] .*\n[^#]
# geany regexpr multiline search :  #] .*\n\n
# geany regexpr multiline search :  #] .*\n##
# >> Ahhh this had 1 item



#08********08
# Procedures -  To run :

#+-----+
#pCmtBig_process

#14Oct2024 
#20:43$ grep  -o ' | @'  "$d_projMaj"'History/Jacobovici, Exodus plagues/Jacobovici 17Nov2018 raw comments 241011.txt' |  wc -l
#22232
#20:22$ grep  -o ' | @'  '/media/bill/ramdisk/comments big.txt' |  wc -l
#1157

#16Oct2024
#11:43$ bash  "$d_bin"'blog/blog analysis.sh' 
#keyWrdA_length = 23
#funcSel ==  pCmtBig_process
#~
#11:50$ 
#>> much faster, but still slower than before combining all processes in pBlog_get_pCmt

#12:27$ grep  -o ' | @'  "$d_projMaj"'History/Jacobovici, Exodus plagues/Jacobovici comments big.txt' |  wc -l
#5425
#

#+-----+
#pCmtKey_process

#16Oct2024
#12:10$ bash  "$d_bin"'blog/blog analysis.sh' 
#keyWrdA_length = 23
#funcSel ==  pCmtKey_process
#~
#12:23$ 
#>> 13 minutes, twice as long as pCmtBig_process
#
#12:45$ grep  -o ' | @'  "$d_projMaj"'History/Jacobovici, Exodus plagues/Jacobovici comments keyWords.txt' |  wc -l
#5424
#
#4.0Mb 'Jacobovici comments keyWords.txt'

#+-----+
# pCmtScr_process

#16Oct2024
# 	if  [[  "$score_"  -gt  0  ]]; then  
# 
# 12:36$ bash  "$d_bin"'blog/blog analysis.sh' 
# keyWrdA_length = 23
# funcSel ==  pCmtScr_process
# ~
# 12:41$ 

# 12:45$ grep  -o ' | @'  "$d_projMaj"'History/Jacobovici, Exodus plagues/Jacobovici comments score.txt' |  wc -l
# 771
# >> far too many to manually check all
# 
#0.72Mb 'Jacobovici comments score.txt'

# 13:10$ bash  "$d_bin"'blog/blog analysis.sh'  
# keyWrdA_length = 38
# funcSel ==  pInnOut_process
# ~
# 13:11$ 

# 13:11$ bash  "$d_bin"'blog/blog analysis.sh'  
# keyWrdA_length = 38
# funcSel ==  pInnOut_process
# ~
# 13:14$ 





#08********08
# run - select one of options

# tests
#	test_keyWrdA_setup
#	test_pCmtKey_process


#	pTxt_to_pWrdL
#	pBlog_process  'pCmtBig_process'  '| @'  "$pNoUnic"	"$pCmtBig"
#	pBlog_process  'pCmtKey_process'  '| @'  "$pCmtBig"	"$pCmtKey"
#	pBlog_process  'pCmtScr_process'  '#] '  "$pCmtKey"	"$pCmtScr"
#	strInnOut='^#+';  pBlog_process   'pInnOut_process'	'#] '  "$pInnOut"  "$pCmtInn"
#	strInnOut='^#-';  pBlog_process   'pInnOut_process'	'#] '  "$pInnOut"  "$pCmtOut"
#	pBlog_process  'pCmtThm_process'  '#] '  "$pCmtInn"	'null'

	dThemes="$dThmTst1";  pThemeL="$dThemes"'0_pThemeL Jacobovici.txt'
	pBlog_process  'pCmtThm_process'  '#] '  "$pBlgTst1"	'null'

#	dThemes="$dThmTst2";  pBlog_process  'pCmtThm_process'  '#] '  "$pBlgTst2"	'null'
#	dThemes="$dThmTst4";  pBlog_process  'pCmtThm_process'  '#] '  "$pBlgTst3"	'null'
#	dThemes="$dThmTst8";  pBlog_process  'pCmtThm_process'  '#] '  "$pBlgTst4"	'null'



#	pCmtScr_getIOCount_pLog
#	pCmtScr_get_pIOMisL




# $ bash  "$d_bin"'blog/blog analysis.sh'  

# enddoc
