+ Reply
Results 1 to 12 of 12

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: Add Words to iPhone Dictionary File

is a discussion within the

File Mods

forums, a part of the

iPhone Modding

section;
Add words to the iPhone's built-in dictionary file. This script requires Perl to be installed. Add the CoreDev repo to Cydia to install Perl. Code: #!/usr/local/bin/perl # This program will
...
  1. #1
    Green Apple
    Join Date
    Feb 2009
    Location
    Atlanta, GA
    Posts
    48
    Thanks
    4
    Thanked 6 Times in 6 Posts

    Default Add Words to iPhone Dictionary File
    Add words to the iPhone's built-in dictionary file.

    This script requires Perl to be installed. Add the CoreDev repo to Cydia to install Perl.

    Code:
    #!/usr/local/bin/perl
    
    # This program will add words to the iPhone word database.
    # Created by tatum, 04/02/2009
    
    ###############
    # Define vars #
    ###############
    
    $file = "/private/var/mobile/Library/Keyboard/dynamic-text.dat";
    
    #########
    # Usage #
    #########
    
    # If no args given, or "-h", print usage
    
    if (@ARGV == 0 or $ARGV[0] eq '-h') {
    	&usage;
    }
    
    sub usage {
    
    print <<EOF;
    
    Usage:
    
      dic -a <word> <another word>...	- Adds <words> to iPhone dictionary file
      dic -h							 - Displays this message
    
    EOF
    	exit 1;
    }
    
    ########
    # Code #
    ########
    
    if (($ARGV[0] eq "-a") && (@ARGV >= 2)) {
    	open(DICT, ">>$file") or die "Unable to open '$file': $!\n";
    	binmode DICT;
    	@current = <DICT>;
    	shift (@ARGV);
    	foreach $word (@ARGV) {
    		unless (grep(/^$word$/, @current)) {
    			print DICT $word;
    		} else { 
    			die "\n'$word' already exists in '$file'.\n"; 
    		}
    	}
    close(DICT);
    
    } else {
    &usage;
    }

    Example:

    dic -a word1 word2 word3

  2. The Following User Says Thank You to tatum For This Useful Post:

    maelcum (10-09-2009)

  3. #2
    Livin the iPhone Life NeoNightmareX's Avatar
    Join Date
    Dec 2008
    Location
    2814
    Posts
    1,564
    Thanks
    50
    Thanked 437 Times in 269 Posts

    Could this also be used to change "LOL" to "lol"?
    If I helped you, then hit the "Thanks!" button please.

    Quote Originally Posted by Soodeh View Post
    I can't find Cydia on app store

  4. #3
    Green Apple
    Join Date
    Feb 2009
    Location
    Atlanta, GA
    Posts
    48
    Thanks
    4
    Thanked 6 Times in 6 Posts

    Quote Originally Posted by NeoNightmareX View Post
    Could this also be used to change "LOL" to "lol"?
    No. Try "haha" instead.

  5. #4
    What's Jailbreak?
    Join Date
    Oct 2008
    Posts
    19
    Thanks
    1
    Thanked 5 Times in 5 Posts

    well this is something I would like BUT, I want to know if I can change the chinese handwriting dictionary to english?? Is that possible??

  6. #5
    Green Apple
    Join Date
    Feb 2009
    Location
    Atlanta, GA
    Posts
    48
    Thanks
    4
    Thanked 6 Times in 6 Posts

    Quote Originally Posted by BrandonandMaria View Post
    well this is something I would like BUT, I want to know if I can change the chinese handwriting dictionary to english?? Is that possible??
    I am not sure. Sorry.

  7. #6
    Green Apple shoohorn0plenty's Avatar
    Join Date
    Mar 2009
    Location
    Cypress, TX
    Posts
    59
    Thanks
    5
    Thanked 2 Times in 2 Posts

    I would really like to teach my iPhone naughty words, but this method is way over my head.

    Telling someone to duck off is getting be almost as embarrassing as telling one of my buddies that I have to go take a shot.
    Isnít it enough to see that a garden is beautiful without having to believe that there are fairies at the bottom of it too?
    -- Douglas Adams

  8. The Following User Says Thank You to shoohorn0plenty For This Useful Post:

    c-dude (05-04-2009)

  9. #7
    What's Jailbreak?
    Join Date
    Jun 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    hey i was looking at this for a potential iphone i might be getting but i have one quick question, couldnt you just edit the dynamic-text.dat file in
    %user/private/var/mobile/Library/Keyboard ? i am assuming that its jailbroken and you can ssh into the iphone.

  10. #8
    iPhoneaholic
    Join Date
    Dec 2008
    Posts
    385
    Thanks
    64
    Thanked 27 Times in 20 Posts

    Quote Originally Posted by shoohorn0plenty View Post
    I would really like to teach my iPhone naughty words, but this method is way over my head.

    Telling someone to duck off is getting be almost as embarrassing as telling one of my buddies that I have to go take a shot.
    I found away around that in a post on lifehacker.com Just create a new contact named Bad Words and in the last name add all the words you want to keep the iphone from correcting, I also added stuff like "FTW WTF ROFL AFAIK FWIW" etc... and of course a superflous amount of foul language. Works for me!

  11. The Following 2 Users Say Thank You to phreakwenci For This Useful Post:

    Shavon (06-07-2011), shoohorn0plenty (05-24-2009)

  12. #9
    Super Duper Moderator blkcadi's Avatar
    Join Date
    Aug 2008
    Location
     Valley of the Sun, ARIZONA ♥♥♥
    Posts
    30,235
    Thanks
    3,651
    Thanked 9,513 Times in 5,840 Posts

    Quote Originally Posted by phreakwenci View Post
    I found away around that in a post on lifehacker.com Just create a new contact named Bad Words and in the last name add all the words you want to keep the iphone from correcting, I also added stuff like "FTW WTF ROFL AFAIK FWIW" etc... and of course a superflous amount of foul language. Works for me!
    Very cool. Auto correct is more that just a minor inconvenience for me but for people that can't handle it , this rox. Nice job.

  13. #10
    Green Apple shoohorn0plenty's Avatar
    Join Date
    Mar 2009
    Location
    Cypress, TX
    Posts
    59
    Thanks
    5
    Thanked 2 Times in 2 Posts

    Quote Originally Posted by phreakwenci View Post
    I found away around that in a post on lifehacker.com Just create a new contact named Bad Words and in the last name add all the words you want to keep the iphone from correcting, I also added stuff like "FTW WTF ROFL AFAIK FWIW" etc... and of course a superflous amount of foul language. Works for me!
    This works!
    Thanks!
    Isnít it enough to see that a garden is beautiful without having to believe that there are fairies at the bottom of it too?
    -- Douglas Adams

  14. #11
    iPhone? More like MyPhone West-'s Avatar
    Join Date
    Aug 2008
    Location
    Michigan
    Posts
    156
    Thanks
    46
    Thanked 72 Times in 37 Posts

    Quote Originally Posted by shoohorn0plenty View Post
    This works!
    Thanks!

    I know this post is old, but I came across it and wanted to let people know it works if you just do it in Notes too!

  15. #12
    What's Jailbreak?
    Join Date
    Sep 2009
    Location
    Europe
    Posts
    9
    Thanks
    4
    Thanked 1 Time in 1 Post
    Hey,

    could it be that the file format changed in any of the firware updates?
    When I look at the file I'll see a format like this:
    ^@wordA^@wordB^@wordC^@wordD
    Between any word there is a delimiter "^@".

    When I call up the perl-Script and add some words, they show up right after each other, no delimiter, like:
    wordAwordBwordCwordD

    Any insight?

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