Posted: Wed Jul 08, 2009 11:53 am Post subject: Custom Dictionary cut and paste into NeoOffice prefrences?
According to this thread; So if I put all my words on one line then what do I do with this code to make it all noticable by NeoOffice and then have it work? Want to set my own custom dictionary or edit a full custom dictionary existing one that may or may not be corrupt. Do I cut and past this script into my dictionary word text? Do I continue by starting with a text doc or neooffice odt or txt or what?
#/usr/bin/perl -w
use strict;
# This script 'split_to_dict'
# 1. Reads standard input or a list of files specified on the command line
# line by line in text mode, so it will automatically account for
# unicode double byte where it (and perl) can.
# 2. It splits the lines into strings based on whitespace or
# null (zero) characters
# 3. It removes all control characters from the strings and
# 4. Outputs the strings to STDOUT separated by zero (null) characters.
#
# Usage: perl split_to_dict inputfile1 inputfile2 > targetfile
#
# The inputfiles could be standard.dic OSX or Open Office dict or a list
# of words one per line or whitespace separated.
#
# The targetfile is suitable for pasting into ~/Library/Spelling/ dictionaries:
# cat targetfile >> ~/Library/Spelling/targetDictionary
#
# should do it where targetDictionary is "en" or "GB_en" or whatever.
# based on ideas from Cameron Hayne (macdev@hayne.net) June 2005
# version 1 Mark Kaehny March 2009
#
# released under the same license as the standard perl distribution:
# GPL version 2 or later (See the Free Software Foundation Websitei) or
# Artistic license version 2.
#
my $line;
my $word;
while ($line = <>) {
# split on whitespace or NULL (0 valued) character
foreach $word (split(/[\s\x00]/, $line)) {
next if $word =~ /WBSWG6/; # skip standard.dic header
# add manually if needed.
$word =~ s/[\cA-\cZ]//g; # junk all control chars (i.e. 1-26 ascii)
print $word, "\x00" if ($word); # add null & skip blank words
}
}
All times are GMT - 7 Hours Goto page Previous1, 2
Page 2 of 2
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum