Link to home
Start Free TrialLog in
Avatar of binkzz
binkzz

asked on

Aspell custom dictionary special characters

Hi,

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?
ASKER CERTIFIED SOLUTION
Avatar of pjedmond
pjedmond
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of binkzz
binkzz

ASKER

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.
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.

HTH:)



Avatar of binkzz

ASKER

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.