Spell Check questions

Spell Check questions

7

    Sep 09, 2014#1

    Is it possible to have spell check ignore words that are keywords from the associated (or selected) wordfile for the file being edited?

    The HELP for spell check seems to imply that multiple user dictionaries can be created.

    Dictionary Directories (Configuration - Spell Checker)
    Personal data directory
    The directory specified here will be used to store words added to user dictionaries.

    I would like to add the keywords from my wordfiles to a dictionary for each language I use. Is this possible? How would I name the file? Where would I put the file? How would I select the file when doing spell check?
    Greetings from Chicago!

    115
    Power UserPower User
    115

      Sep 09, 2014#2

      Even after excluding every reserved keyword from a language, the spell checker would still have to deal with things like variable names, subroutine names, file names, labels, structures and objects. It would be a nightmare to run against even a small program.

      I've been using UE for more than a decade and I can't recall ever using the spell check function. Why would you ever want to spell check source code?

      7

        Sep 09, 2014#3

        I'll answer you second question first.
        Why do I use spell checker on code? I have the habit of extensively commenting my code. It helps me remember what and more importantly why I did what I did. It also helps the next person that looks at the code. I like my comments to be spelled properly.

        As far as variables, etc. I don't have a problem bypassing them. It is the keywords that I find annoying. And I haven't figured out yet how to use CTAGS. It doesn't seem at all straight forward. Mostly because I don't work on a UNIX, Linux, or Windows environment. I code on a Unisys OS2200 large scale mainframe. I wrote my first program for a Unisys mainframe back when they were still Univac in 1970.

        Maybe you can help me with another question. I've written my own wordfiles. In some of the languages I use, variables and keywords can have $ and underscore as part of their names. I do not have these characters in the delimiters definition in the wordfile. How come when I double click on one of these, it always stops at the $ or underscore? I'd like to be able to select all of "next_one" or "next$one" by just double clicking.

        /Delimiters = ~!%^&()-+=|\/{}[]:;,.?'*

        Thanks,
        Dave

        P.S. I've been using UE since release 7.
        Greetings from Chicago!

        115
        Power UserPower User
        115

          Sep 09, 2014#4

          Dave,

          I coded on a Unisys 2200 system as recently as 6 years ago. Professionally, I started on punched cards on an IBM 360 in 1981 but I had been programming as a hobby since 1978.

          Okay, I can understand spell-checking comments. Advanced->Configuration->Spell Checker->Dictionary is where you can add lists of words. I haven't tried this since I don't have the dictionaries installed but it should work.
          You can use one of Mofi's wordfile macros to put the keywords from a wordfile one to a line. Then you can select them and paste them into the added words window. I don't know if you can add more than one word at a time but I would sure hope so. Save your work before you try just in case you crash UE.

          As for your question about variables/keywords with $ in them, when you doubleclick to highlight a word, it uses an internal rule to find the end of the word, not delimiters from your wordfile. That rule is include alphanumeric characters plus the underscore and stop when the condition is not met. So you can't get past the $ with double click. With CTRL-double click you can select the delimiters to start and stop with, on the menu Advanced->Configuration->Editor->Delimiters

          6,685587
          Grand MasterGrand Master
          6,685587

            Sep 10, 2014#5

            Spell checking is done using GNU Aspell installed with UltraEdit.

            At Advanced - Configuration - Spell Checker - Filters several filters can be activated for some languages supported built-in by Aspell. Aspell checks only words in comments and strings with such a filter used for example for C / C++. Unfortunately the C / C++ filter is not working as UltraEdit passes this filter option wrong to aspell6.dll since UE v16.00 as IDM Computer Solutions, Inc. updated aspell6.dll. I have reported this already 3 years ago, but still waiting for a fix of this issue. It looks like more users must report this issue to increase the priority of fixing this specific bug.

            You can use a single personal dictionary file with file extension pws. This file is a simple text file with a header line. The words are added to this dictionary file line by line with one word per line. You can select in which directory this personal dictionary file is stored which makes it possible to use several personal dictionaries by switching the directory in configuration.

            Run Edit - Spell Check and use button Add to create (on first time) this dictionary file and add selected word.

            To add a list of words it is of course easier to edit the *.pws file directly in the configured directory. Open this file in UltraEdit and add the keywords from the wordfile line by line. To do this select all lines of a color group, copy them to a new file, search for a space and replace it with ^p (regular expression option not checked), select everything in the new file using Ctrl+A and copy and paste the lines to *.pws file. Do the same steps also for the other color groups in the wordfile. It is not necessary to have the words sorted alphabetically in *.pws file, but this helps finding them on manually editing this file.

            Note: Aspell does not use the delimiter characters used for syntax highlighting. Words in *.pws should therefore contain only letters.

            Regading your other question about command Select Word, see Customize Select Word to include a dash, a dollar sign, or any other character as word char.
            Best regards from an UC/UE/UES for Windows user from Austria

            7

              Sep 10, 2014#6

              MickRC3- Thanks for the explanation. I'll see what I can do with the .pws file. It might just be easier to click "Add to dictionary" the first time each keyword shows up.

              Mofi- Thanks to you as well. I copied your macro, changing "-" to "$" and "^-" to "$". It works as advertised. I now have to remember the to use the hot-key combo I assigned to it. Still, it would be nice if I could assign a mouse/key combo to it.

              As a long time user of UltraEdit I don't like admitting it, but I've just started to learn how to use macros and scripts. It has been fun and I've come up with a few that I find useful.

              Regards,
              Dave
              Greetings from Chicago!