LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-03-2014, 09:20 AM   #1
linustalman
Senior Member
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 10 (Buster) x64
Posts: 3,795

Rep: Reputation: 401Reputation: 401Reputation: 401Reputation: 401Reputation: 401
Question Auto copy Firefox words in persdict.dat to other word files.


Hi.

I add custom words in Firefox to this file: ~/.mozilla/firefox/XXXXXXXX.default/persdict.dat

I'd like a command to auto copy those persdict.dat words to these 2 files:
~/.config/enchant/en.dic
~/.thunderbird/YYYYYYYY.default/persdict.dat'

Thanks.
 
Old 07-04-2014, 02:09 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590
What's the format of these files? Plain text, Mork, sqlite3 database or?..
 
Old 07-04-2014, 05:05 AM   #3
linustalman
Senior Member
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 10 (Buster) x64
Posts: 3,795

Original Poster
Rep: Reputation: 401Reputation: 401Reputation: 401Reputation: 401Reputation: 401
Post

Quote:
Originally Posted by unSpawn View Post
What's the format of these files? Plain text, Mork, sqlite3 database or?..

Hi unSpawn.

Using the file command:
.mozilla...persdict.dat: C++ source, UTF-8 Unicode text
.thunderbird...persdict.dat: ASCII text
.config/enchant/en.dic: C++ source, UTF-8 Unicode text
 
Old 07-04-2014, 02:24 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590
No idea what char sequences make it say "C++ source" but for me (FF 30.0 here) the "persdict.dat" appears to be plain text. I don't have any .config/enchant/ dictionaries in use. http://www.abisource.com/enchant/ says enchant isn't a spell checking library at all but requires backends like aspell. Could you read one of your ~/.config/enchant/*.dic files to see what it contains?
 
Old 07-05-2014, 09:55 AM   #5
linustalman
Senior Member
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 10 (Buster) x64
Posts: 3,795

Original Poster
Rep: Reputation: 401Reputation: 401Reputation: 401Reputation: 401Reputation: 401
Post

Quote:
Originally Posted by unSpawn View Post
No idea what char sequences make it say "C++ source" but for me (FF 30.0 here) the "persdict.dat" appears to be plain text. I don't have any .config/enchant/ dictionaries in use. http://www.abisource.com/enchant/ says enchant isn't a spell checking library at all but requires backends like aspell. Could you read one of your ~/.config/enchant/*.dic files to see what it contains?
I ran this on a test Linux Mint 17 MATE VirtualBox VM in ~/.mozilla: file persdict.dat persdict.dat: ASCII text

The en.dic file in ~/.config/enchant/ contains words I've added manually overtime.
 
Old 07-06-2014, 07:20 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590
OK, so basically both are ASCII text files. You could (should) make backups and $(sort -u $EACH_FILE) and create a central source from which to populate those three files (inotify CLOSE_WRITE trigger?) but I'm not sure if those changes will stick while the application is running. Only one way to find out ;-p
 
Old 07-06-2014, 01:54 PM   #7
linustalman
Senior Member
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 10 (Buster) x64
Posts: 3,795

Original Poster
Rep: Reputation: 401Reputation: 401Reputation: 401Reputation: 401Reputation: 401
Quote:
Originally Posted by unSpawn View Post
OK, so basically both are ASCII text files. You could (should) make backups and $(sort -u $EACH_FILE) and create a central source from which to populate those three files (inotify CLOSE_WRITE trigger?) but I'm not sure if those changes will stick while the application is running. Only one way to find out ;-p
Could you elaborate on that? Giving a step by step process?
 
Old 07-08-2014, 03:34 PM   #8
linustalman
Senior Member
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 10 (Buster) x64
Posts: 3,795

Original Poster
Rep: Reputation: 401Reputation: 401Reputation: 401Reputation: 401Reputation: 401
Post

The most important bit is to copy (with a single command to add to an alias) all the contents of the .mozilla persdict.dat file to the .thunderbird persdict.dat file. I can manually update the en.dic file.
 
Old 07-08-2014, 05:52 PM   #9
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590
I think I'm making this too difficult ;-p If all three dictionaries are plain text files containing only the words you add one per line then why not simply symlink two to the one you always edit?
 
Old 07-09-2014, 09:43 AM   #10
linustalman
Senior Member
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 10 (Buster) x64
Posts: 3,795

Original Poster
Rep: Reputation: 401Reputation: 401Reputation: 401Reputation: 401Reputation: 401
Thumbs up

Quote:
Originally Posted by unSpawn View Post
I think I'm making this too difficult ;-p If all three dictionaries are plain text files containing only the words you add one per line then why not simply symlink two to the one you always edit?
The perfect solution. Cheers unSpawn.

I used the Firefox persdict.dat as the main file and linked from it with the same name to .thunderbird and changed link name to 'en.dic' for the file in .config/enchant/ which is used by Pluma, etc.
 
Old 08-04-2014, 05:00 AM   #11
linustalman
Senior Member
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 10 (Buster) x64
Posts: 3,795

Original Poster
Rep: Reputation: 401Reputation: 401Reputation: 401Reputation: 401Reputation: 401
Question

Can I also use this with LibreOffice spellcheck?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] how to copy the words after a particular word in a line bal_nair1 Linux - General 2 06-06-2012 08:17 AM
I'm unable to copy the *.dat files from VCD's sajinsj Linux - General 9 11-10-2011 09:53 AM
Can not copy .DAT files from CD to my hard a.dehqan Linux - Software 1 11-22-2008 12:04 PM
copy files containing specific words in a specified line abenmao Linux - Newbie 5 08-28-2008 10:04 AM
Copy standard video cd's : Avseq01.dat, Avseq02.dat... Hitboxx Fedora 6 02-03-2007 09:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration