home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch      Fun with MS-DOS batch files      42,547 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 42,011 of 42,547   
   Herbert Kleebauer to Andy Burnelli   
   Re: requst for easy to implement spell c   
   11 Feb 22 12:49:12   
   
   XPost: alt.comp.os.windows-10, alt.usage.english   
   From: klee@unibwm.de   
      
   On 11.02.2022 00:48, Andy Burnelli wrote:   
      
    >> It's up to you, to add code for statistics and to prefer   
    >> words which have been spelled wrong in the past.   
      
   > Especially since I'm not a coder (although I use what people create).   
      
   I added a few lines of code for you. This version stores any   
   misspelled word in "spellerr.txt". Next time you start the   
   batch, first all words in "spellerr.txt" are presented and   
   then all words in "spell.txt" in a random order. You can   
   exit the batch any time by entering "x".   
      
   It's up to you, to add a full path or %temp% to the   
   temporary generated files (I prefer all in the same directory).   
      
      
   @echo off   
   MODE CON: COLS=50 LINES=10   
   color f0   
   cls   
   echo createobject("sapi.spvoice").speak wsh.arguments(0)>speak.vbs   
      
   for /f "tokens=*" %%i in (spell.txt) do call echo %%random%% %%i>>spellerr.txt   
   sort /o spelltmp.txt spellerr.txt   
   del spellerr.txt   
   set /a ok=0   
   set /a not_ok=0   
      
   for /f "tokens=1*" %%i in (spelltmp.txt) do call :sub %%j   
   :end   
   del speak.vbs   
   del spelltmp.txt   
   echo.   
   echo %ok% words correct,  %not_ok% words incorrect   
   echo.   
   pause   
   exit   
      
   :sub   
   echo.   
   set /a n=0   
   :sub1   
   set /a n=n+1   
   if %n%==3 goto :sub2   
   cscript //nologo speak.vbs "%*"   
   set a=   
   set /p a=   
   if /i "%a%"=="x" goto :end   
   if /i not "%*"=="%a%" goto :sub1   
   set /a ok=ok+1   
   goto :eof   
      
   :sub2   
   echo 0 %*>>spellerr.txt   
   echo ---------- %*   
   set /a not_ok=not_ok+1   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca