ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE. Software > Clipboard Help+Spell

Sharing a custom spelling dictionary between applications

<< < (3/3)

I use the Addict Spell Check library to manage all of the spelling stuff.... more about it ... here:

... it may only make those available for read-access as additional dictionaries, and insist that the actually modifications be done in an exclusive dictionary file -- or it may let you then choose a dictionary in that directory to use as the one to add to, I'm just not sure.
-mouser (August 23, 2013, 02:05 AM)
--- End quote ---

This is an issue of write-locking granularity. The file system only write locks with file-level granularity (all or nothing); whereas, the monitor system (like in a database) locks with record-level granularity. In this case, each word would be in a different database record.

If you don't write lock at some level (file level or record level), then one writer (which doesn't know about an earlier update by another writer) may replace the primary copy with its stale copy of the dictionary. So a writer must first close the file (or record) for read access, then open it again for write lock access (just before making a change) so it gets a fresh copy of the dictionary just before it writes. Now if it's doing this with file-level granularity, it should release that write lock immediately so it plays well with other apps that may want to write.

Databases and operating systems use the monitor approach (write locking at the resource [or record] level) so several independent processes can write lock (or allocate) resources (under monitor arbitration) at the same time.

I'm thinking the monitor approach is an overkill here because several apps (or process threads) wouldn't be wanting to write to custom.adu simultaneously on a personal computer. But if an apps doesn't play well and continually write locks custom.adu, then we have a problem.

I'm hoping apps would (1) close the read open custom.adu, (2) re-open custom.adu with a write lock thereby getting a fresh master copy of custom.adu from disk, (3) write the new word into it, (4) close the file to flush the new word (disk cluster) out to disk, (5) then re-open custom.adu again for reading.  But this is only a "hope". I really don't know how it works.

... this [dictionary program] can READ the Microsoft Office dictionary, [but] it will not modify it.
-mouser (August 23, 2013, 02:05 AM)
--- End quote ---

That's because Microsoft Office is using a dictionary monitor that's dictionary program doesn't know about. They kind of have to do that because not all Windows users have MS Office installed. What would be nice is (1) for Microsoft to publish hooks into its dictionary monitor so third-party apps could write to it, and (2) employed those hooks for write updating.

What would really be nice is if Microsoft simply included the dictionary monitor as part of a Windows service included in the OS so everyone had it (not just Office users). But I guess that would be reaching.  :D


[0] Message Index

[*] Previous page

Go to full version