Aspell custom dictionary special characters

Posted on 2006-06-04
Last Modified: 2008-01-09

I'm having some trouble creating a custom dictionary in Aspell. I'm trying to create a custom dictionary with phrases, but aspell is complaining about the spaces and other special characters. I'd be happy to replace the spaces with underscores. I'd like Aspell to recognize special characters such as underscores or hyphens as if they were normal characters.

I've looked into creating a custom character set, but looking at the examples I can't seem to make head nor tail on how to progress.

Has anyone overcome this problem with a special dictionary?
Question by:binkzz
    LVL 22

    Accepted Solution

    If you look at:

    under "Things I would like to get done", you will see that exactly what you are after is something that the authors would like to implement.

    When creating custom dictionaries, Aspell strips all spaces and non word chars. The exception to this is the hyphen, so I guess if it's a phrase, you might just about get away with using hyphens for your phrases, then save document, and then do a search and replace for your hyphens to spaces prior to 'publishing' the document? See here for more info on custom wordlists:

    LVL 4

    Author Comment

    Thanks for the quick reply.

    The problem with using hyphens is that you can only have one in a row; some of my phrases contain several hyphens in a row. Replacing spaces with hyphens could be done, but converting them back to spaces would be a problem because there are phrases which carry hyphens by default. That's why I wanted to replace spaces with underscores instead.

    The problem with that is that Aspell doesn't allow me to have two non-character items in a row, which is what I'm trying to overcome.
    LVL 22

    Expert Comment

    You've highlighted the potential problems there. Another possibility is to replace spaces with qq as another workaround, and then replace the qq with spaces. (This is because qq doesn't exist as a char combination in the English language - /me waits for examples!)

    I've thought about adding another 'special char' to be counted as a valid text char. If you are a reasonable C++ programmer, the char filtering is in filter_char.hpp. Unfortunately, I'm not really a C++ programmer, so I can't help directly, and there's also the probability that there'll be other glitches somewhere else if you modified this.

    Otherwise I thing that the issues that you have highlighted are exactly those that the writers of aspell appreciate are the shortcomings of the program.


    LVL 4

    Author Comment

    Thanks for your suggestion. I ended up using characters with accents to replace the special characters.The problem with using qq would be that the length of the words in relation to other words would differ, and aspell would return different results than if the length had stayed the same.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
    SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now