Aspell custom dictionary special characters

Posted on 2006-06-04
Medium Priority
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
  • 2
  • 2
LVL 22

Accepted Solution

pjedmond earned 2000 total points
ID: 16827796
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:



Author Comment

ID: 16827851
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

ID: 16828650
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.



Author Comment

ID: 16828758
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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses
Course of the Month16 days, 8 hours left to enroll

864 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