LinuxQuestions.org
Help answer threads with 0 replies.
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, 08:20 AM   #1
linustalman
LQ Guru
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 12 Bookworm
Posts: 5,944

Rep: Reputation: 489Reputation: 489Reputation: 489Reputation: 489Reputation: 489
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, 01:09 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,417
Blog Entries: 55

Rep: Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622
What's the format of these files? Plain text, Mork, sqlite3 database or?..
 
Old 07-04-2014, 04:05 AM   #3
linustalman
LQ Guru
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 12 Bookworm
Posts: 5,944

Original Poster
Rep: Reputation: 489Reputation: 489Reputation: 489Reputation: 489Reputation: 489
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, 01:24 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,417
Blog Entries: 55

Rep: Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622
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, 08:55 AM   #5
linustalman
LQ Guru
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 12 Bookworm
Posts: 5,944

Original Poster
Rep: Reputation: 489Reputation: 489Reputation: 489Reputation: 489Reputation: 489
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, 06:20 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,417
Blog Entries: 55

Rep: Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622
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, 12:54 PM   #7
linustalman
LQ Guru
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 12 Bookworm
Posts: 5,944

Original Poster
Rep: Reputation: 489Reputation: 489Reputation: 489Reputation: 489Reputation: 489
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, 02:34 PM   #8
linustalman
LQ Guru
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 12 Bookworm
Posts: 5,944

Original Poster
Rep: Reputation: 489Reputation: 489Reputation: 489Reputation: 489Reputation: 489
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, 04:52 PM   #9
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,417
Blog Entries: 55

Rep: Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622
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, 08:43 AM   #10
linustalman
LQ Guru
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 12 Bookworm
Posts: 5,944

Original Poster
Rep: Reputation: 489Reputation: 489Reputation: 489Reputation: 489Reputation: 489
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, 04:00 AM   #11
linustalman
LQ Guru
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 12 Bookworm
Posts: 5,944

Original Poster
Rep: Reputation: 489Reputation: 489Reputation: 489Reputation: 489Reputation: 489
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 07:17 AM
I'm unable to copy the *.dat files from VCD's sajinsj Linux - General 9 11-10-2011 08:53 AM
Can not copy .DAT files from CD to my hard a.dehqan Linux - Software 1 11-22-2008 11:04 AM
copy files containing specific words in a specified line abenmao Linux - Newbie 5 08-28-2008 09:04 AM
Copy standard video cd's : Avseq01.dat, Avseq02.dat... Hitboxx Fedora 6 02-03-2007 08:22 AM

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

All times are GMT -5. The time now is 06:09 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
Open Source Consulting | Domain Registration