Hi,
I use Dict OS X all the time but it was missing a few features I
really need/like:
- ability to search for Czech words without knowing the exact
accents
- services support (like the old NeXT dictionary)
Plus the search history wasn't working
Plus the small tab-stops in the results made words run together too
much.
Plus the "Hide" didn't work
Plus I didn't like the way that the window hid itself when the app
was not at the front (makes it hard to compare things side by side
with other applications).
So I fixed all the above, and I have appended a file with the new
source. I had to make changes to the nibs as well, so I have sent
this as complete source tree rather than diffs.
I like the way I did the searching-without-accents: as the
dictionaries are read in at the beginning, a copy of each word is
constructed without any Czech accents (I think I got them all), so
the master NSDictionary is keyed by accent-less word. When the
user enters a word, the accents are removed from that one too by
the same method, before the search is done. Voila -- picks them
all up now.
Doing this takes more time on app startup (unfortunately) so I put
in some other optimisations, like a faster getc routine to do
buffered file reads. Even with the optimisations, the fact that the
search-without-accents code is in there means that the overall
startup time is about the same as before (maybe slightly slower,
about 10 seconds on my TiBook 667).
The service support is quite good too-- after installing in /
Applications, log out and in again to get the effect. Now from any
app supporting Services, you can press command-= (or select
from the Services menu) and the currently highlighted word will be
defined in the dictionary. You can even do that from within Dict
OSX, though due to a bug in OSX you sometimes have to manually
click on the Services submenu before the key combo works. I
would like to fix that...
Have fun!
Stephen Brandon
http://www.clanbrandon.co.uk
A bunch of changes