<commit_before>#include <Constants.au3>

Global $MyProgress_StepIndex = 0
Global $MyProgress_StepCount = 100
Global $MyProgress_MainText = ""

; NOTE: $MyProgress_SubTextSuffix must be one line text.
Global $MyProgress_SubTextSuffix = _
		"If GUI automation goes wrong, press ALT+SHIFT+x to stop."

Func MyProgress_buildSubText($subtext)
	If StringInStr($subtext, @CRLF) = 0 Then
		Return $subtext & @CRLF & @CRLF & $MyProgress_SubTextSuffix
	Else
		Return $subtext & @CRLF & $MyProgress_SubTextSuffix
	EndIf
EndFunc   ;==>MyProgress_buildSubText

; NOTE: $subtext must be one or two lines.
Func MyProgress_On($title, $maintext, $subtext = "", $x = -1, $y = -1, $opt = -1)
	If $opt = -1 Then
		$opt = $DLG_MOVEABLE
	EndIf
	$MyProgress_MainText = $maintext
	ProgressOn($title, $maintext, MyProgress_buildSubText($subtext), $x, $y, $opt)
EndFunc   ;==>MyProgress_On

Func MyProgress_Step($subtext = "", $maintext = "")
	$MyProgress_StepIndex = $MyProgress_StepIndex + 1
	Local $percent = 100 * $MyProgress_StepIndex / $MyProgress_StepCount
	If $maintext <> "" Then
		$MyProgress_MainText = $maintext
	EndIf
	ProgressSet($percent, MyProgress_buildSubText($subtext), $MyProgress_MainText)
EndFunc   ;==>MyProgress_Step

Func MyProgress_Set($percent, $subtext = "", $maintext = "")
	If $maintext <> "" Then
		$MyProgress_MainText = $maintext
	EndIf
	ProgressSet($percent, MyProgress_buildSubText($subtext), $MyProgress_MainText)
EndFunc   ;==>MyProgress_Set

Func MyProgress_Off()
	ProgressOff()
EndFunc   ;==>MyProgress_Off
<commit_msg>Modify the message about hotkey to stop.<commit_after>#include <Constants.au3>

Global $MyProgress_StepIndex = 0
Global $MyProgress_StepCount = 100
Global $MyProgress_MainText = ""

; NOTE: $MyProgress_SubTextSuffix must be one line text.
Global $MyProgress_SubTextSuffix = _
		"Press alt+shift+x to stop if GUI automation goes wrong."

Func MyProgress_buildSubText($subtext)
	If StringInStr($subtext, @CRLF) = 0 Then
		Return $subtext & @CRLF & @CRLF & $MyProgress_SubTextSuffix
	Else
		Return $subtext & @CRLF & $MyProgress_SubTextSuffix
	EndIf
EndFunc   ;==>MyProgress_buildSubText

; NOTE: $subtext must be one or two lines.
Func MyProgress_On($title, $maintext, $subtext = "", $x = -1, $y = -1, $opt = -1)
	If $opt = -1 Then
		$opt = $DLG_MOVEABLE
	EndIf
	$MyProgress_MainText = $maintext
	ProgressOn($title, $maintext, MyProgress_buildSubText($subtext), $x, $y, $opt)
EndFunc   ;==>MyProgress_On

Func MyProgress_Step($subtext = "", $maintext = "")
	$MyProgress_StepIndex = $MyProgress_StepIndex + 1
	Local $percent = 100 * $MyProgress_StepIndex / $MyProgress_StepCount
	If $maintext <> "" Then
		$MyProgress_MainText = $maintext
	EndIf
	ProgressSet($percent, MyProgress_buildSubText($subtext), $MyProgress_MainText)
EndFunc   ;==>MyProgress_Step

Func MyProgress_Set($percent, $subtext = "", $maintext = "")
	If $maintext <> "" Then
		$MyProgress_MainText = $maintext
	EndIf
	ProgressSet($percent, MyProgress_buildSubText($subtext), $MyProgress_MainText)
EndFunc   ;==>MyProgress_Set

Func MyProgress_Off()
	ProgressOff()
EndFunc   ;==>MyProgress_Off

{'fraction_non_alphanumeric': 0.11942174732872407, 'fraction_numerical': 0.008799497171590195, 'mean_word_length': 4.894444444444445, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2704059', 'n_tokens_mistral': 1201, 'n_tokens_neox': 1100, 'n_words': 256}