diff --git a/Source/Includes/Wordlist.ahk b/Source/Includes/Wordlist.ahk index b5bc519..906d360 100644 --- a/Source/Includes/Wordlist.ahk +++ b/Source/Includes/Wordlist.ahk @@ -306,7 +306,7 @@ CheckValid(Word,ForceLearn=false) { return } - } else if ( RegExMatch(Word, "S)[a-zA-Zà-öø-ÿÀ-ÖØ-ß]") = 0 ) + } else if ( RegExMatch(Word, "S)[a-zA-Zà-öø-ÿÀ-ÖØ-ß]") = 0 ) { Return } @@ -467,12 +467,43 @@ StrUnmark(string) { ; Remove combining marks and return result. string := RegExReplace(StrGet(&buf, len, "UTF-16"), "\pM") - StringReplace, string, string, æ, ae, All - StringReplace, string, string, Æ, AE, All - StringReplace, string, string, œ, oe, All - StringReplace, string, string, Œ, OE, All - StringReplace, string, string, ß, ss, All + StringReplace, string, string, æ, ae, All + StringReplace, string, string, Æ, AE, All + StringReplace, string, string, œ, oe, All + StringReplace, string, string, ÂŒ, OE, All + StringReplace, string, string, ß, ss, All return, string -} \ No newline at end of file +} + +;------------------------------------------------------------------------ + +BulkLearnFromClipboard(textblock) +{ + global g_TerminatingCharactersParsed + + ;Display progress bar window... + Progress, M, Please wait..., Bulk learning..., %g_ScriptTitle% + + ;Count how many individual items there are, we need this number to display + ;an accurate progress bar. + Loop, Parse, textblock, %g_TerminatingCharactersParsed%`r`n%A_Tab%%A_Space% + { + ;Count the individual items + Counter++ + } + + Loop, Parse, textblock, %g_TerminatingCharactersParsed%`r`n%A_Tab%%A_Space% + { + ;Display words to show progress... + ProgressPercent := Round(A_Index/Counter * 100) + Progress, %ProgressPercent%, Please wait..., %A_LoopField%, %g_ScriptTitle% + AddWordToList(A_LoopField, 0,"ForceLearn") + } + + ;Turn off progress bar window... + Progress, Off + + return +} diff --git a/Source/TypingAid.ahk b/Source/TypingAid.ahk index e11d755..a4bd7af 100644 --- a/Source/TypingAid.ahk +++ b/Source/TypingAid.ahk @@ -1099,6 +1099,7 @@ BuildTrayMenu() Menu, Tray, NoStandard Menu, Tray, add, Settings, Configuration Menu, Tray, add, Pause, PauseResumeScript + Menu, Tray, add, Bulk Learn, BulkLearnFromClipboardMenu IF (A_IsCompiled) { Menu, Tray, add, Exit, ExitScript @@ -1258,6 +1259,17 @@ if (g_PauseState == "Paused") } Return + +BulkLearnFromClipboardMenu: +MsgBox, 4, Bulk-learn words from clipboard contents, Would you like to continue? (press Yes or No) +IfMsgBox No +{ + Return +} +BulkLearnFromClipboard(clipboard) +Return + + ExitScript: ExitApp Return