Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (1 of 34), Read 165 times, 1 File Attachment
Conf: VEDIT User Applications
From: Pauli Lindgren
Date: Monday, April 14, 2008 04:40 AM

One of the features most editors have but Vedit is missing, is spelling checker.

I have now made a macro that uses Aspell to check spelling from within Vedit.
Aspell is an open source spelling checker used by many text editors, as well as by Firefox.
You can download Aspell at:
http://aspell.net/

The enclosed zip file contains the following:
- ASPELL.VDM is the macro that implements the spelling checker functions
- SPELL.MNU is Tools menu for calling the functions.

Unzip the files in your USER-MAC directory.
Change the path of aspell.exe at the beginning of aspell.vdm, if necessary (Reg_Set(#51=...)).
You can use spell.mnu as default menu for .txt files etc., or copy the lines to your tools menu (but do not change the key bindings).

Using ASPELL.VDM:

When you have a text file open on which you want to check spelling, select "Check Spelling" on Tools menu.
(You do not need to save the file in order to check spelling, the macro saves a tmp file for that.)

A dialog box open. Here you can select whether you want to start checking from beginning of file or from cursor location.
The number of lines and number of (different) error words are limited for safety and speed, maybe these can be removed later.
You can change these values in the dialog box.
Click OK to start checking.

Aspell is now called. After Aspell has been run, the words with error are highlighted with yellow background (using syntax highlighting).

You can now correct the words manually, or ask for suggestion. For suggestion, move cursor at misspelled word and select "Suggest correction for word at cursor" from Tools menu, or press Shift-F6.
A window with list of words is opened. User cursor Up/Down to select word, then Enter to replace. Or press Esc or Space to cancel.

After you have finished checking the spelling, select "Exit spell check mode" from Tools menu, or press Shift-F7.
This restores the syntax color and keyboard configuration.

This macro probably still needs some more development. For example, if you want to run spelling check on file that already uses syntax highlighting, it would be necessary to save and restore the syntax file used.

--
Pauli

 
Aspell.vdm V1.0

 


Topic: Re: ASPELL.VDM - Using Aspell spelling checker with Ve (2 of 34), Read 135 times
Conf: VEDIT User Applications
From: Fritz Heberlein
Date: Monday, April 14, 2008 07:44 AM

vedit-userapps Listmanager schrieb:
> I have now made a macro that uses Aspell to check spelling from within Vedit.

O, simply wonderful! I have tried that several times but wasn't able to
get it working. Thanks so much!

Fritz

 


Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (3 of 34), Read 131 times, 1 File Attachment
Conf: VEDIT User Applications
From: Pauli Lindgren
Date: Tuesday, April 15, 2008 12:22 PM

Here is new version of ASPELL.VDM, V1.1 2008-04-15

Changes:

- If block highlighted, check spelling in the block only.

- Select dictionary language and file type from dialog.

-> The languages currently selectable are those that come with English dictionary: en-US, en-GB, and en-CA.

-> The "File type" can be Plain text, text with URLs, HTML, or TeX. This selects a filter so that spelling is not checked for example inside HTML tags. The initial value for file type is set based on extension.

- Now use terse mode to speed up operation (now Aspell only outputs data for those words that contain error.)

- "Suggest" function searches for full words only. This way you get suggestions for correct word in case the beginning of the word is the same as some other word.

- Fixed reading the max errors and max lines values from dialog box.

- Quote Aspell command characters used in pipe mode (so that for example lines starting with '-' will be checked also).

--
Pauli

 
Aspell.vdm V1.1

 


Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (4 of 34), Read 137 times
Conf: VEDIT User Applications
From: Peter Rejto
Date: Saturday, April 19, 2008 05:13 AM

Hi,

I would like to join Fritz in extending our thanks/gratitude to Pauli for ASPELL.VDM.

Since I am a Firefox user and since I like to know "what is under the hood" I do appreciate knowing that Firefox uses ASPELL.

Special thanks to the person who did the Tex option. Since I am a TeX user I would appreciate the reference.

Now a self survey for Fritz:
At present I am using 4SPELL(The Dutch Usergroup program) which I call within Vedit. I am sure Fritz knows about 4SPELL.
So, I would appreciate a rough comparison, 4SPELL versus ASPELL. Possibly, this is the wrong question to ask. Then please do not loose any sleep over it.

Thanks for everything,

-peter.

 


Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (5 of 34), Read 143 times
Conf: VEDIT User Applications
From: Ian Binnie
Date: Saturday, April 19, 2008 08:00 AM

On 4/19/2008 5:13:08 AM, Peter Rejto wrote:
>Hi,
>
>I would like to join Fritz in
>extending our thanks/gratitude
>to Pauli for ASPELL.VDM.
>
>Since I am a Firefox user and
>since I like to know "what is
>under the hood" I do
>appreciate knowing that
>Firefox uses ASPELL.

As far as I know Firefox does not use Aspell, but uses 2 dll. I am not sure what engine it uses.

Aspell was available as an extension to Firefox prior to 2.0, but is no longer supported by the author.

I was going to give it a try with vedit, but the windows version only comes with an installer, which has resisted my attempts to unpack it.

I might give it a try if I can compile it.

 


Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (6 of 34), Read 133 times
Conf: VEDIT User Applications
From: Peter Rejto
Date: Thursday, April 24, 2008 01:45 AM

On 4/19/2008 8:00:53 AM, Ian Binnie wrote:
>
>I was going to give it a try with vedit,
>but the windows version only comes with
>an installer, which has resisted my
>attempts to unpack it.
>
>I might give it a try if I can compile
>it.

Ian,

Thanks for your offer about ASPELL. I just downloaded it from www.aspell.net/win32 and installed it. It seems to work for me. Since it is getting late I did not try to run it form Pauli's macro.

Looking forward to hearing from you.

Thanks again,

-peter

 


Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (7 of 34), Read 124 times, 1 File Attachment
Conf: VEDIT User Applications
From: Pauli Lindgren
Date: Thursday, April 24, 2008 10:54 AM

Here is new version of ASPELL.VDM, v1.2.

Changes:

- Max lines and max errors options moved to Options dialog which can be accessed by clicking on [Options] button (or by pressing O key). This makes the main dialog cleaner, and the hotkeys in the dialog now do not require pressing Alt key.

- Added new option "Allow Run-together words" in the main dialog. When it is checked, any composite words that are created by combining two or more correct words are accepted. When not checked, only those composite words are accepted that are included in the dictionary.

- Tools menu is saved when spell check is run, and SPELL.MNU is loaded instead. When you select "Exit spelling check mode", the original Tools menu is restored.

- Syntax highlighting setting is saved, and restored when you select "Exit...". Now you can use spell check with files that use syntax highlighting (such as HTML).

- Word separator setting is set to match Aspell word separator so that correct word is found in Suggest function. Original setting is restored when "Exit..." is selected.

- Now also displays spelling errors for which there are no suggested corrections. These are displayed in different color. The colors can be set in Options dialog.

- Settings in Options dialog, as well as dictionary selection and Run-together word option are remembered (saved in aspell.ini file in user-mac directory).

- Commands "Ignore word" and "Add word" added to Suggest window. They are marked with "->" at the beginning of line. You can access these commands by moving cursor up and then pressing enter. (Cursor is by default on the first suggested word, and PgUp and Home keys move cursor to the first word instead of top of the window.)

"-> Ignore word" just removes the word from syntax highlighting, but it has no effect on subsequent runs of spell check.

"-> Add word to dict" adds the current word into user dictionary, so that on subsequent runs of spell check this word is no more marked as spelling error. For confirmation, a dialog opens to display the word being added. In addition, there is option to save the word in lower case, which causes Aspell to ignore case in spelling check. If you confirm the save to dictionary, the word is removed from syntax highlighting, too.

- Ignore word option can be executed directly without opening word list, by selecting it from spell menu or by pressing the hotkey Ctrl-Shift-i.

- Added another language in the dictionary selection: Swedish. You need to install Swedish dictionary in order to use it. You can replace this with some other dictionary by changing two lines in the code, one in the dialog box and one a few lines after that. Search for string "Swedish".

The zip file contains all the necessary files: ASPELL.VDM, USER.MNU and a document file ASPELL_VDM.TXT, so you do not need to download the earlier versions.


--
Pauli

 
Aspell.vdm V1.2

 


Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (8 of 34), Read 121 times
Conf: VEDIT User Applications
From: Peter Rejto
Date: Sunday, May 04, 2008 05:45 PM

Pauli,

The new version works like a charm. In fact,
I learned using your macro I have learned that in your aspell.vdm you have misspelled the word "overwritten".

Now I would like to suggest two possible enhancements:

1.: After replacing/ignoring a misspelled word I would like automatically go to the next misspelled word.

2.: Since I am using your Spell.MNU via my mouse to replace a misspelled word, I would like to be able to use the mouse to choose between replace and ignore in the popup window.

Finally, I have a hunch that the "No More Errors" message on the stat line simply means that the set of misspelled words is empty. This may also happen if I was unable to run ASPELL.EXE. So I added an Aspell.hlp menu item to your SPELL.MNU;

System('"F:\Program Files\Aspell\bin\aspell.exe "',DOS+MAX)

Incidentally, when I run this aspell help utility, it says that I should type aspell -?. But if I add this extra "?" I get an error message saying that Windows can not recognize Program as an internal or external command.

Thanks for everything.


-peter.

 


Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (9 of 34), Read 115 times
Conf: VEDIT User Applications
From: Pauli Lindgren
Date: Monday, May 05, 2008 11:06 AM

On 5/4/2008 5:45:59 PM, Peter Rejto wrote:
>
> Now I would like to suggest two possible enhancements:
>
> 1.: After replacing/ignoring a misspelled word I would
> like automatically go to the next misspelled word.

I originally wanted to have a keyboard command to go to next error, but it is not easy to implement since Aspell does not give information about the locations of the errors.

It would be possible to find next error by searching for all the erroneous words listed in the .syn file. But this does not always work correctly. Anyway, I have an implementation for that, so I will probably include it in the next release.

Maybe I could add an option to automatically find the next error, too.

>
> 2.: Since I am using your Spell.MNU via my mouse to
> replace a misspelled word, I would like to be able to use
> the mouse to choose between replace and ignore in the
> popup window.

That would be a nice feature in C function select and other similar macros, too.

I think I have suggested it before, that Get_Key() should check for mouse clicks, in addition to key presses. Then it would be possible to select items with mouse, too.


>
>Finally, I have a hunch that the "No More Errors" message
>on the stat line simply means that the set of misspelled
>words is empty.

I don't think there is such message.
When the words are removed from syntax file (e.g. with ignore), the number of words remaining is displayed.

When you check for errors, and no errors are found, message "No errors" is displayed.

If you try to get suggestions for a correct word, message "No suggestions" is displayed.

> This may also happen if I was unable to run
> ASPELL.EXE. So I added an Aspell.hlp menu item to your
> SPELL.MNU;
>
> System('"F:\Program Files\Aspell\bin\aspell.exe "',DOS+MAX)

I don't know what you need that for, but the better solution would be the following:
1. Open DOS box and go to the directory that contains aspell.exe.
2. Enter command aspell -? >help.txt
3. Whenever you want to see the help text in Vedit, just open the file help.txt.

But did you notice that there are HTML help files in ...\aspell\doc\html directory?

>
>But if I add this extra "?" I get an error message saying
>that Windows can not recognize Program as an internal or
>external command.

This may be the same problem that I had originally with running Aspell. You have to create a .bat file to use more complex command line parameters.

--
Pauli

 


Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (10 of 34), Read 115 times
Conf: VEDIT User Applications
From: Peter Rejto
Date: Tuesday, May 06, 2008 12:06 PM

On 5/5/2008 11:06:06 AM, Pauli Lindgren wrote:
Maybe I could add an option to
automatically find the next error,
too.
>
Great !!
>> 2.: Since I am using your Spell.MNU via my mouse to
>> replace a misspelled word, I would like to be able to use
>> the mouse to choose between replace and ignore in the
>> popup window.
>
>That would be a nice feature in C
>function select and other similar
>macros, too.
>
>I think I have suggested it before, that
>Get_Key() should check for mouse clicks,
>in addition to key presses. Then it
>would be possible to select items with
>mouse, too.

In other words, this is a suggestion to
Ted and not to Pauli ?

>>Finally, I have a hunch that the "No More Errors" message
>>on the stat line simply means that the set of misspelled
>>words is empty.
>
>I don't think there is such message.

Of course, it is my typo. I meant
"No errors" Thanks for explaining
where it comes from!


>> This may also happen if I was unable to run
>> ASPELL.EXE. So I added an Aspell.hlp menu item to your
>> SPELL.MNU;
>>
>> System('"F:\Program Files\Aspell\bin\aspell.exe "',DOS+MAX)
>
>I don't know what you need that for:

I meant it to be the "poor man's way"
of checking that the path to aspell.exe
is set properly! I do need some feedback
from aspell.exe !
Here is an unplanned experiment that I
did. I was eager to run your aspell.vdm
macro and installed it right away,
without setting the proper path of
aspell.exe. I was getting the
"No errors" messages on the stat line.
Then I realized that aspell.exe
did not find any misspelled words since
it was not running.



> ...but the better solution would be
the following:
1. Open DOS box and go to the directory
that contains aspell.exe.
2. Enter command aspell -? >help.txt
3. Whenever you want to see the help
text in Vedit, just open the file
help.txt.

I agree. In fact I have done it within
Vedit by issuing:

System(`"F:Program Files\Aspell\bin\aspell.exe" help`,DOS+MAX))

Note that I have only the space
delimeter before "help", similarly to
the way that you pass "pipe" to your
batch file

>This may be the same problem that I
had originally with running Aspell.
>
Did you have to experiment with
"pipe" ?


I have a hunch that there is a typo in the
aspell "help.txt" file. Specifically,
I believe that the hyphen "-" should be
dropped. I hope that you will have a
chance to look at it. In fact, I am
suggesting to add a corrected version
to your instruction file, aspell..txt?


Thanks for everything.

-peter.

 


Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (11 of 34), Read 119 times
Conf: VEDIT User Applications
From: Pauli Lindgren
Date: Wednesday, May 07, 2008 12:26 PM

On 5/6/2008 12:06:27 PM, Peter Rejto wrote:
>>
>>I think I have suggested it before, that
>>Get_Key() should check for mouse clicks,
>>in addition to key presses. Then it
>>would be possible to select items with
>>mouse, too.
>
>In other words, this is a suggestion to
>Ted and not to Pauli ?

Yes. The macro uses Get_Key() command. That command only reads key presses and not mouse. So there is nothing I can do. It requires changes in Vedit code to read mouse also.

>Here is an unplanned experiment that I
>did. I was eager to run your aspell.vdm
>macro and installed it right away,
>without setting the proper path of
>aspell.exe. I was getting the
>"No errors" messages on the stat line.
>Then I realized that aspell.exe
>did not find any misspelled words since
>it was not running.

I will add a check to see if aspell was run. If aspell.exe could not run (e.g. if the path is incorrect), aspell.out file is empty, so I can check for that situation.


>Note that I have only the space
>delimeter before "help", similarly to
>the way that you pass "pipe" to your
>batch file

Yes, the help text can be requested either with option -? or with command help.

>
>>This may be the same problem that I
>had originally with running Aspell.
>>
>Did you have to experiment with
>"pipe" ?

The problem was with input/output redirection, which requires shell, i.e. DOS option has to be used in system() command. But then the problem was that command line was too long. That is why .bat file is needed.

NOTE!
There is a bug in aspell.vdm in TeX mode.
The command line option for Tex mode is wrong (-T, should be -t). I have already corrected that, but the macro is in the middle of changes so I can not post it yet.

--
Pauli

 


Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (31 of 34), Read 61 times
Conf: VEDIT User Applications
From: Peter Rejto
Date: Saturday, January 03, 2009 01:13 PM

On 5/7/2008 12:26:20 PM, Pauli Lindgren wrote:

>The problem was with input/output
>redirection, which requires shell, i.e.
>DOS option has to be used in system()
>command. But then the problem was that
>command line was too long. That is why
>.bat file is needed.

Pauli,

I would like to ask my question again about the necessity of the .bat file. This time, I would like to use,
Christian's comment in webboard.vedit.com/read?53459,34 which says that

"I modified opencurs.vdm now to avoid the DOS option. At the same time, I increased the length limit for the
filenames from 100 to 254. That is the max value I got working. On higher values Vedit complains "wrong filename". "

More specifically, I wouldlike to use/adapt the code on line 220 of opencurs_30-Dec-2008.vdm which says,

Sys(`|@(106) "|@(121)"`,SUPPRESS+SIMPLE+NOWAIT) //Open file in application

Since Ian was a strong advocate of the CMD.EXE option and since this is a CMD.EXE option, I would like to refer to it
as the Binnie-Ziemski option.


I tried to use/adapt this Binne-Ziemski option to your aspelltmp.bat file. In other words, using the Vedit text registers,
I tried to pass the same parameters to aspell.exe as your bach file does. I had limited success.
I had no problem passing the check parameter to aspell.exe. Here are the details:

Reg_Set(106, "cmd /k ")
Reg_Set(107, "c:\program files (x86)\aspell\bin\aspell.exe " )
Reg_Set(108, "-c")
Reg_Set(109, FILENAME)
System(`|@(106) "|@(107)" |@(108) |@(109)`)

However, I did have problems with the pipe parameter.

In fact, I created a new directory and copied over your temporary files into this new directory.
This is what I got for your spelltmp.bat:

"C:\Program Files (x86)\Aspell\bin\aspell" -a --lang=en_US -t < "c:\vedit\temp\spell.txt" >"c:\vedit\temp\aspell.out"

Then I changed the c:\vedit\temp directory to my new directory, c:\localvedit and changed aspell.out to new.out
and called the new file spelltmp_new.bat:

"C:\Program Files (x86)\Aspell\bin\aspell.exe" -a --lang=en_US <"c:\localvedit\spell.txt" >"c:\localvedit\aspell.out"

Finally, at the command prompt, I typed spelltmp_new .
This batch file did start up aspell.exe and transmitted some parameters. I got an error message complaining about the
"<" charater at the beginning of a word. However, I did not get the file new.out.

My main problem is that I do not know the exact syntax for the --pipe parameter.
I take that it takes an input filename and an output filename with some delimiters.

To be sure your aspell.vdm works like a charm. I just do not know how to put the pieces together.

Thanks as always,

-peter.

 


Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (12 of 34), Read 102 times, 1 File Attachment
Conf: VEDIT User Applications
From: Pauli Lindgren
Date: Friday, May 09, 2008 09:23 AM

Here is new version of ASPELL.VDM, v1.3.

Changes:

- Path to Aspell home directory is now fetched from registry. So it is no more necessary to edit the macro for that.

- List of available languages can be defined in aspell.ini file. It is no more necessary to edit the macro when you add more dictionaries. In addition, this allows you to change the order of languages in the dialog.
An example ini file is included in the .zip package. By default, only three dialects of English are included. There are some other languages commented out, you can uncomment those if you install the corresponding dictionary. See aspell_vdm.txt for more info.

- [Edit aspell.ini] button added to Options dialog. Opens aspell.ini and exits macro.

- Added commands in SPELL.MNU to find next/previous error. Keyboard shortcuts Alt-N and Alt-P in Vedit standard keyboard layout call these menu items. In addition, Shift-F7 can be used for Next Error.

This has been made by searching any of the error words in syntax file. This does not always work correctly. For example, if one word is part of another word (e.g. example and examples) and the shorter word happens to be first in the list, then the longer word is not found.
Another problem is that the maximum length of search string is only 250 characters. That is why the search string has to be cut. (Maybe after next version of Vedit has been published, the length can be increased to 1000).

- Shortcut key for "Exit spell check mode" has been changed to Shift-F8. (This is more logical since it is the last key in the group.)

- Option to automatically find next error after the initial spell check and after each replace / ignore word operation. This can be enabled from the Options dialog.

- Option to automatically detect language. Can be enabled from the Options dialog. Currently detects French, German and Swedish. If none of these is detected, the previously used other language is selected.
The language detect selects the initial selection for radio buttons, but you can change the selection if it is not OK.

- Added option Ignore Case in the main dialog.

- Added option Ignore Accents in the main dialog.

- Added error checks in case aspell.exe could not be run or if selected dictionary was not found.

- When OK pressed in Options dialog, the settings are saved to aspell.ini (previously, settings were saved only if you click OK in the main dialog).

- Fix: TeX mode did not work (command line parameter was wrong)

- Fix: in Suggest window, top line for PgUp and Home is 3 instead of 4

- Default colors changed. Errors with suggestion are displayed in color 100 as in the original version, and errors without suggestion are displayed in bright red.

- spellchk.syn is created in user-mac directory (instead of Vedit home dir) so that files are not cluttered in so many places.

--
Pauli

 
Aspell.vdm v1.3

 


Topic: Re: ASPELL.VDM - Using Aspell spelling checker with Ve (13 of 34), Read 103 times
Conf: VEDIT User Applications
From: Christian Ziemski
Date: Friday, May 09, 2008 12:47 PM

On 09.05.2008 15:25 vedit-userapps Listmanager wrote:
> From: "Pauli Lindgren"
>
> Here is new version of ASPELL.VDM, v1.3.

Pauli:

Well done!
I like that macro and I'll try to stress-test it a bit ;-)

Christian

 


Topic: Re: ASPELL.VDM - Using Aspell spelling checker with Ve (14 of 34), Read 102 times
Conf: VEDIT User Applications
From: Christian Ziemski
Date: Friday, May 09, 2008 04:07 PM

On 09.05.2008 15:25 vedit-userapps Listmanager wrote:
> From: "Pauli Lindgren"
>
> Here is new version of ASPELL.VDM, v1.3.

My first observations:

1) If the first or last word of the file/block are misspelled and the
cursor is in the middle of that word, the suggestions doesn't work. That
is because of the pattern code |i is not counting BoF and EoF as word
delimiters.

Workaround:

In lines 440.. use:

Search("|{|i,|<}", REVERSE+ADVANCE+NOERR)
#68 = CP
Search("|{|i,|>}", NOERR)



2) If option "find next error automatically" is enabled and the first
misspelled word is at BoF the cursor is set to the second misspelled
word just after the spelling check.


3) There are strange highlighting effects sometimes.
For example in a line with the first and last word misspelled those
words are highlighted as such.
If I then edit the line by deleting one character, another (correctly
spelled) word is highlighted instead of the wrong ones. But that seems
to be VEDIT's error and not the macro's one.

Christian

 


Topic: Re: ASPELL.VDM - Using Aspell spelling checker wit (17 of 34), Read 97 times
Conf: VEDIT User Applications
From: Pauli Lindgren
Date: Thursday, May 15, 2008 11:24 AM

On 5/9/2008 4:07:57 PM, Christian Ziemski wrote:
>
>
>Workaround:
>
>In lines 440.. use:
>
>Search("|{|i,|<}",REVERSE+ADVANCE+NOERR)
>#68 = CP
>Search("|{|i,|>}", NOERR)

Thanks. I have now included that in the code.


>
>2) If option "find next error automatically" is enabled and the first
>misspelled word is at BoF the cursor is set to the second misspelled
>word just after the spelling check.

I had noticed that problem but I thought that it is such a rare case that it is not worth spending time to fix it.
But I have fixed it now.

>
>3) There are strange highlighting
>effects sometimes.

I haven't seen that effect.

However, there is that irritating problem with Vedit switching to wrong syntax highlighting after running the macro. It happens practically always if I have at least 2 different syntax highlighting files loaded. It is the same problem as with Wildfilew.vdm.

There are some other minor fixes I would like to do before publishing new version.
For example word separator still needs adjusting to be compatible with Aspell.
Further, if a word contains numbers (such as "exapmle2"), it is not highlighted and next_error does not find it. (In this case, Aspell reports "exapmle" as the error word. Maybe it is not necessary to find these errors (some spelling checkers ignore such words), but they are still reported in the total number of errors, which can cause confusion.

--
Pauli

 


Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (15 of 34), Read 97 times
Conf: VEDIT User Applications
From: Peter Rejto
Date: Tuesday, May 13, 2008 11:31 PM

On 5/9/2008 9:23:43 AM, Pauli Lindgren wrote:
>Here is new version of
>ASPELL.VDM, v1.3.
>
>Changes:
>
>- Path to Aspell home
>directory is now fetched from
>registry. So it is no more
>necessary to edit the macro
>for that.
>
>Pauli


Thanks, Version 1.3 works like a charm for me.
At the same time a big thank you to Christian for his stress test. I just like to know about the, possible but not probable, situations in which aspell.vdm does not work.

Special thanks for fetching the Aspell path from the
from the registry. I would like to use this part of your macro as a tutorial. So, I replaced #51 by 51 in that command and issued the command,

Registry_Get_Item(51,"HKEY_LOCAL_MACHINE\SOFTWARE\Aspell\(Default)"

from the Vedit command mode. To my great surprise I got a "BAD PARAMETER ERROR MESSAGE".

Looking forward to hearing from you and thanks for everything.

-peter

 


Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (16 of 34), Read 90 times
Conf: VEDIT User Applications
From: Peter Rejto
Date: Wednesday, May 14, 2008 12:55 AM

On 5/13/2008 11:31:29 PM, Peter Rejto wrote:
>On 5/9/2008 9:23:43 AM, Pauli Lindgren
>wrote:
>>Here is new version of
>>ASPELL.VDM, v1.3.
>>
>>Changes:
>>
>>- Path to Aspell home
>>directory is now fetched from
>>registry. So it is no more
>>necessary to edit the macro
>>for that.
>>
>>Pauli
>
>
>Thanks, Version 1.3 works like a charm
>for me.
>At the same time a big thank you to
>Christian for his stress test. I just
>like to know about the, possible but not
>probable, situations in which aspell.vdm
>does not work.
>
>Special thanks for fetching the Aspell
>path from the
>from the registry. I would like to use
>this part of your macro as a tutorial.
>So, I replaced #51 by 51 in that command
>and issued the command,
>
>Registry_Get_Item(51,"HKEY_LOCAL_MACHINE
>\SOFTWARE\Aspell\(Default)"
>
>from the Vedit command mode. To my
>great surprise I got a "BAD PARAMETER
>ERROR MESSAGE".
>
>Looking forward to hearing from you and
>thanks for everything.
>
>-peter

Pauli,

I did find my mistake! I did forget to close one of my parentheses. This certainly explains why I had a "BAD PARAMETER.

-peter

 


Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (18 of 34), Read 86 times, 1 File Attachment
Conf: VEDIT User Applications
From: Pauli Lindgren
Date: Tuesday, June 10, 2008 09:07 AM

Here is new version of ASPELL.VDM, v1.4.
It contains just a few changes:

- Suggest and Next-Error now work even if the error is at the very beginning or end of file (or block)

- Removed "no more errors" message from Next-Error since it may overwrite other messages.

- Spell checking a block of text in binary file (such as Word .doc file) is now possible
(does not set binary file type for tmp text file).

- Language auto detect parameters adjusted and added detection for Spanish.

- Language auto detect starts detecting at block begin if block highlighted (but checks 1000 chars even if block is smaller).

--
Pauli

 
ASPELL14.ZIP (14KB)

 


Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (19 of 34), Read 86 times
Conf: VEDIT User Applications
From: Peter Rejto
Date: Wednesday, June 18, 2008 03:19 PM

Thanks Pauli,

I tried Version 1.4 and it works like a charm for me.

I also did some experiments with the two System( ) commands in your ASPELL.VDM . Specifically, I have removed the DOS option in each of them. In other words, I have replaced your System( ) command by,

System('"|(VEDIT_TEMP)\spelltmp.bat"',SIMPLE) .

This replacement seems to have no affect on the functionality of the macro.

This experiment was motivated by Christian's recent enhancement of the compiler macros. Specifically, in the enhanced version of C-INIT.VDM he remarks that,

System('"|(VEDIT_TEMP)\vcs-tmp.bat"', SIMPLE) //CZ: strange, but the DOS option doesn't work here any longer


So, I thought to try out the removal of the DOS option in your case as well.

I am looking forward to hearing your reactions to this replacement. In fact, I do hope to hear from both of you.

-peter

 


Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (20 of 34), Read 68 times
Conf: VEDIT User Applications
From: Doc Evans
Date: Wednesday, October 08, 2008 10:57 AM

Does anyone know how to make this work under wine?

Everything seemed to install OK, but when I actually run the macro, I get the following error:

----

C:\vedit\MSDOSNTI.PIF
Invalid program filename
Check your pif file

----

I can't even guess what is responsible for generating that message (i.e., wine, the VEDIT installation, or something about the macro may be assuming something to be true which is in fact not true under wine).

 


Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (21 of 34), Read 77 times
Conf: VEDIT User Applications
From: Ian Binnie
Date: Wednesday, October 08, 2008 07:24 PM

On 10/8/2008 10:57:43 AM, Doc Evans wrote:
>actually run the macro, I get
>the following
>error:

----

C:\vedit\MSDOSNT
>I.PIF
Invalid program
>filename
Check your pif
>file

----

I can't even guess
>what is responsible for
>generating that message (i.e.,
>wine, the VEDIT installation,
>or something about the macro
>may be assuming something to
>be true which is in fact not
>true under wine).

Do you have a System call with "DOS"?

This is unnecessary see
http://webboard.vedit.com/read?49026,49
for discussion.

 


Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (22 of 34), Read 79 times
Conf: VEDIT User Applications
From: Doc Evans
Date: Thursday, October 09, 2008 12:10 AM

---

Do you have a System call with "DOS"?

This is unnecessary see
http://webboard.vedit.com/read?49026,49
for discussion.

---

Sorry, I don't understand what you are asking. I simply installed the macro and ran it. I don't know what you mean by "a System Call with 'DOS'".

After getting more and more frustrated at my inability to get it to work, I ended up simply using vanilla aspell, instead of trying to use it from VPW.

 


Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (23 of 34), Read 77 times
Conf: VEDIT User Applications
From: Ian Binnie
Date: Thursday, October 09, 2008 08:43 PM

On 10/9/2008 12:10:23 AM, Doc Evans wrote:
>---

Do you have a System call
>with "DOS"?

This is
>unnecessary
>see
http://webboard.vedit.com/
>read?49026,49
for
>discussion.

---

Sorry, I
>don't understand what you are
>asking. I simply installed the
>macro and ran it. I don't know
>what you mean by "a System
>Call with 'DOS'".

After
>getting more and more
>frustrated at my inability to
>get it to work, I ended up
>simply using vanilla aspell,
>instead of trying to use it
>from VPW.


I assume you are running aspell14.zip
At line 239 & 823 the following System call:_
System('"|(VEDIT_TEMP)\spelltmp.bat"',DOS+SIMPLE) // Run Aspell

Just getting rid of DOS+ should fix this.
(Note I am not using this myself, so haven't tested.)

 


Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (24 of 34), Read 75 times
Conf: VEDIT User Applications
From: Pauli Lindgren
Date: Tuesday, October 14, 2008 04:26 AM

On 10/9/2008 8:43:10 PM, Ian Binnie wrote:
>
> At line 239 & 823 the following System call:_
> System('"|(VEDIT_TEMP)\spelltmp.bat"',DOS+SIMPLE) // Run Aspell
>
> Just getting rid of DOS+ should fix this.
> (Note I am not using this myself, so haven't tested.)

Yes, the System() call seems to work without DOS option. So you can remove it to see if that helps in Wine.

I guess when you call a .bat file, the shell is started automatically even if DOS option is not used.
(Originally, the DOS option was needed because .bat was not used and shell is needed for input/output redirection.)

I don't know how Wine works.
However, MSDOSNTI.PIF tries to execute command
%SystemRoot%\SYSTEM32\CMD.EXE

So the question is, does the environment variable SystemRoot exist, and does CMD.EXE exist in the location specified?

--
Pauli

 


Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (25 of 34), Read 75 times
Conf: VEDIT User Applications
From: Ian Binnie
Date: Tuesday, October 14, 2008 08:22 AM

On 10/14/2008 4:26:16 AM, Pauli Lindgren wrote:
>On 10/9/2008 8:43:10 PM, Ian Binnie
>wrote:
>Yes, the System() call seems to work
>without DOS option. So you can remove it
>to see if that helps in Wine.
>
>I guess when you call a .bat file, the
>shell is started automatically even if
>DOS option is not used.
>(Originally, the DOS option was needed
>because .bat was not used and shell is
>needed for input/output redirection.)

DOS invokes the 16 bit real mode - it has been obsolete since 1996.

>I don't know how Wine works.

It only supports 32 bit API (and only a subset of these).

>However, MSDOSNTI.PIF tries to execute
>command
>%SystemRoot%\SYSTEM32\CMD.EXE

Not really, it causes windows to execute ntvdm.exe, which tries to emulate a real mode DOS environment. This is not supported in XP 64 (or Vista AFAIK).

See http://webboard.vedit.com/read?49026,49

PS It is about time vedit dropped (or ignored) this misleading option.

 


Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (26 of 34), Read 79 times
Conf: VEDIT User Applications
From: Pauli Lindgren
Date: Thursday, October 16, 2008 11:11 AM

On 10/14/2008 8:22:06 AM, Ian Binnie wrote:
>
> Not really, it causes windows to execute
> ntvdm.exe, which tries to emulate a real
> mode DOS environment. This is not
> supported in XP 64 (or Vista AFAIK).

But the command line in the .PIF file is
%SystemRoot%\SYSTEM32\CMD.EXE ???


> PS It is about time vedit dropped (or
> ignored) this misleading option.

Definitely not.
DOS option is used to start a shell.
Without shell you can not do for example input/output redirection.
That is why I originally added the DOS option in the system () call in aspel.vdm.
However, because the length of command line is limited in system() call, it was not possible to use long pathnames. Therefore I changed aspell.vdm to use a .bat file.

But maybe the way DOS option operates could be changed.
I suppose it could just call the shell with given command line as parameter.

--
Pauli

 


Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (27 of 34), Read 80 times
Conf: VEDIT User Applications
From: Ian Binnie
Date: Friday, October 17, 2008 12:59 AM

On 10/16/2008 11:11:17 AM, Pauli Lindgren wrote:
>On 10/14/2008 8:22:06 AM, Ian Binnie
>wrote:
>>
>> Not really, it causes windows to execute
>> ntvdm.exe, which tries to emulate a real
>> mode DOS environment. This is not
>> supported in XP 64 (or Vista AFAIK).
>
>But the command line in the .PIF file is
>%SystemRoot%\SYSTEM32\CMD.EXE ???

But ntvdm.exe is called to execute the .PIF file, so the damage is done by then.
>
>> PS It is about time vedit dropped (or
>> ignored) this misleading option.
>
>Definitely not.
>DOS option is used to start a shell.

I was not suggesting dropping the command prompt, just avoiding the .PIF file.

You can then get the full "power" of the command processor.

If you really want the retro experience you can run command.com on 2K/XP.

 


Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (28 of 34), Read 82 times
Conf: VEDIT User Applications
From: Peter Rejto
Date: Tuesday, December 30, 2008 06:24 PM

Pauli,

I am back to your ASPELL.VDM. I like very much your philosophy that once a file is opened in Vedit then ASPELL.EXE should work in the background.

So, I would like to understand how your macro works.
Specifically, I would like to know how do you tell ASPELL.EXE which file to check for spelling.

I also printed out the help message and this is what I got.


Aspell 0.50.3 alpha. Copyright 2000 by Kevin Atkinson.

Usage: aspell [options]

is one of:
-?|help display this help message
-c|check to check a file


I could not find anything similar in your macro.

Thanks as always,

-peter.

 


Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (29 of 34), Read 92 times
Conf: VEDIT User Applications
From: Christian Ziemski
Date: Wednesday, December 31, 2008 02:18 AM

On 12/30/2008 6:24:32 PM, Peter Rejto wrote:
>
>Specifically, I would like to know how do you tell
>ASPELL.EXE which file to check for spelling.
>
>I also printed out the help message and this is what I
>got.
>
>[little]

Calling help this way:

C:\>"C:\Program Files\Aspell\bin\aspell.exe" --help

Aspell 0.50.3 alpha. Copyright 2000 by Kevin Atkinson.

Usage: aspell [options]

is one of:
-?|help display this help message
-c|check to check a file
-a|pipe "ispell -a" compatibility mode
-l|list produce a list of misspelled words from standard input
[dump] config dumps the current configuration to stdout
config prints the current value of an option
soundslike returns the soundslike equivalent for each word entered
filter passes standard input through filters
-v|version prints a version line
dump|create|merge master|personal|repl [word list]
dumps, creates or merges a master, personal, or replacement word list.

[options] is any of the following:

--conf= main configuration file
--conf-dir= location of main configuration file
--data-dir= location of language data files
--dict-dir= location of the main word list
--encoding= encoding to expect data to be in
--add|rem-filter= add or removes a filter
--mode= filter mode = none,url,email,sgml,tex
-e,--mode=email enter Email mode.
-H,--mode=sgml enter Html/Sgml mode.
-t,--mode=tex enter TeX mode.
--add|rem-extra-dicts= extra dictionaries to use
--home-dir= location for personal files
-W,--ignore= ignore words <= n chars
--[dont-]ignore-accents ignore accents when checking words
--[dont-]ignore-case ignore case when checking words
--[dont-]ignore-repl ignore commands to store replacement pairs
--jargon= extra information for the word list
--keyboard= keyboard definition to use for typo analysis
--lang= language code
--language-tag= deprecated, use lang instead
--local-data-dir= location of local language data files
-d,--master= base name of the main dictionary to use
--module=
--add|rem-module-search-order=
--per-conf= personal configuration file
-p,--personal= personal word list file name
--prefix= prefix directory
--repl= replacements list file name
-C|-B,--[dont-]run-together consider run-together words legal
--run-together-limit= maxium numbers that can be strung together
--run-together-min= minimal length of interior words
--[dont-]save-repl save replacement pairs on save all
--[dont-]set-prefix set the prefix based on executable location
--size= size of the word list
--spelling= no longer used
--[dont-]strip-accents strip accents from word lists
--sug-mode= suggestion mode
--add|rem-word-list-path= Search path for word list information files
-b|-x,--[dont-]backup create a backup file by appending ".bak"
--[dont-]reverse reverse the order of the suggest list
--[dont-]time time load time and suggest time in pipe mode
--keymapping= keymapping for check mode, one of aspell ispell
--add|rem-email-quote= email quote characters
--email-margin= num chars that can appear before the quote char
--add|rem-tex-command= TeX commands
--[dont-]tex-check-comments check TeX comments
--add|rem-tex-extension= TeX file extensions
--add|rem-sgml-check= sgml attributes to always check.
--add|rem-sgml-extension= sgml file extensions


gives additional info.

Pauli is using the "pipe mode" (-a).

Christian

 


Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (30 of 34), Read 97 times
Conf: VEDIT User Applications
From: Peter Rejto
Date: Thursday, January 01, 2009 07:45 AM

On 12/31/2008 2:18:32 AM, Christian Ziemski wrote:
.....>
>gives additional info.
>
>Pauli is using the "pipe mode" (-a).

Thanks Christian,

I have trouble implementing the "pipe mode". Specifically, I can not create an output file. I take that this mode will take two parameters, the input filename and the output filename with some delimiters.

Since Pauli's ASPELL.VDM runs like a charm for me, I also looked at Pauli's batch file that transmits these parameters to aspell.exe. This is that I got:

Pauli's aspelltmp.bat:

"C:\Program Files (x86)\Aspell\bin\aspell" -a --lang=en_US -t <"c:\vedit\temp\spell.txt" >"c:\vedit\temp\aspell.out"

I tried to experiment with this batch file but could not get the output file, aspell.out.

I also checked the aspell.exe help message that you have sent me. But could not find instruction about creating an output file.

So, I am stuck.

Thanks as always.

-peter.

 


Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (32 of 34), Read 100 times
Conf: VEDIT User Applications
From: Pauli Lindgren
Date: Sunday, January 04, 2009 05:19 PM

On 1/1/2009 7:45:37 AM, Peter Rejto wrote:
>
>
>"C:\Program Files(x86)\Aspell\bin\aspell" -a --lang=en_US -t <"c:\vedit\temp\spell.txt" >"c:\vedit\temp\aspell.out"
>
>I tried to experiment with this batch
>file but could not get the output file,
>aspell.out.

Pipe mode reads input from standard input and writes output to standard output.

Since Vedit does not support pipe mode, I used tmp files. You direct standard input and output to files using input/output redirection characters, < and >, as you can see in the command line quoted above.

--
Pauli

 


Topic: ASPELL.VDM - Using Aspell spelling checker with Ve (33 of 34), Read 105 times
Conf: VEDIT User Applications
From: Peter Rejto
Date: Monday, January 05, 2009 02:50 PM

On 1/4/2009 5:19:40 PM, Pauli Lindgren wrote:

>Pipe mode reads input from standard
>input and writes output to standard
>output.
>
>Since Vedit does not support pipe mode,
>I used tmp files. You direct standard
>input and output to files using
>input/output redirection characters, <
>and >, as you can see in the command
>line quoted above.


Thanks Pauli for explaining the pipe concept to me and for explaning the structure of your batch file, spelltmp.bat.

I also did some more experiments with spelltmp.bat. I simply
ignored the error messages and wanted to see what happens if I launch this batch file on my own. I did succeed. Here are the details:

Independent launching of spelltmp.bat:

1.: I renamed the aspell.out file in my c:\vedit\temp directory to aspell_orig.out.

2.: I launched spelltmp.bat by double clicking on its filename in the prompt window.

3.: This resulted in a new aspell.out file.

4.: I compared the two files, aspell_orig.out and aspell.out.

5.: The content of these two files were identical.
(This is my definition of success.)


It seems that my independent launching of your spelltmp.bat file works like a charm! So, I am at a loss in explaining the reason for the error messages that I got. Ironically, this error message complained about one of your redirection characters. Specifically, it complained about the character "<".

In any case I have learned quite a bit. Thanks again.



-peter

 


Topic: ASPELL.VDM v1.6 (34 of 34), Read 6 times
Conf: VEDIT User Applications
From: Pauli Lindgren
Date: Monday, August 30, 2010 10:44 AM

New version of ASPELL.VDM (V1.6) is now available on my web page:
http://koti.mbnet.fi/pkl/vedit/aspell.htm

The main new feature is the source code filter, which allows you to check spelling in comments and strings in program source code.

Unlike the other filters (URL, HTML, TeX), this option does not use the filters in Aspell.exe.
While Aspell does have some sort of source code filter, it is not available in Windows version, so I implemented it in the macro.
You must have syntax highlighting enabled to use this filter. The macro automatically fetches the comment delimiters from currently active syntax file. It should work with most syntax files, but there are some limitations:
- Only one pair of block comment delimiters can be used. (However, there can be multiple line comment delimiters.)
- Only single-line strings delimited by double quotes are checked.

Another new feature is Instant Check, which instantly checks a single word or highlighted block. To use it, call the label INSTANT. Spelling check is then started immediately, without showing the dialog box. Any options you selected previously will be used. If a block is highlighted, it will be checked. If no block is highlighted, a single word on which cursor is located is checked.
This option is currently only available while you are in spelling check mode. You can call it by selecting "check Word / block" in the spTools menu.

In addition, aspell.vdm now restores your old keyboard configuration on exit, and restores cursor position if no spelling errors were found.

--
Pauli