webOS Nation Forums > webOS apps and software > webOS development > Autoreplace Upgrade
1 2 3 4 5 6 7 8 9 
Member: dimfeld
at: 04:08 PM 06/30/2009
That sounds likely. Now that I think of it, my newline handling is lazy, just chopping off the last character, whereas on Linux newlines are two characters. I'll get this fixed either tonight or tomorrow. In the meantime, you can do a quick fix by changing most of the occurrences of -1 to -2 in the file when it's reading in word lists.
Reply
Member: diomark
at: 04:09 PM 06/30/2009
Originally Posted by dimfeld:
That sounds likely. Now that I think of it, my newline handling is lazy, just chopping off the last character, whereas on Linux newlines are two characters. I'll get this fixed either tonight or tomorrow. In the meantime, you can do a quick fix by changing most of the occurrences of -1 to -2 in the file when it's reading in word lists.
This fixed it for me -
sed -e 's/^M//g' new_autoreplace > fixed_autoreplace

(note - for ^M, it's control-V, Control-M)
-mark
Reply
Member: diomark
at: 04:17 PM 06/30/2009
working now, but having issues with duplicates...

i.e. both of these are in there -

dont|don't
dont|font


and when I type dont, it takes the second one (translating to font)

another example was i - it got translated to u.

(EDIT - I think this was also because of the line handling.. the original autoreplace file wasn't being read correctly (?) editing the python script and changing -1 to -2 fixed the issue for me)

-mark
Reply
Member: stubbs
at: 04:17 PM 06/30/2009
great work guys, this is the kind of stuff we need. I'm impressed!
Reply
Member: stubbs
at: 04:24 PM 06/30/2009
Originally Posted by diomark:
working now, but having issues with duplicates...

i.e. both of these are in there -

dont|don't
dont|font


and when I type dont, it takes the second one (translating to font)

another example was i - it got translated to u.

-mark
Just an idea, but a different usage model to fix that problem would be to have auto-correct symbols typed with a period:

don.t|don't

(replace the apostrophe with a period, which has a dedicated key)
That's how the T-9 works on my Nokia, and I think it's a handy feature. Of course, if you can think of another way to do it, that's welcome too.
Reply
Member: dimfeld
at: 04:28 PM 06/30/2009
Hmm, I'm not seeing duplicates in my files. The script takes some steps to avoid having duplicates, so I'll have to look into this more. I wonder if this is perhaps related to the newline issues screwing up duplicate word detection when the words come from separate files with differing newline styles.

The period->apostrophe option sounds nice, but unfortunately I think it won't work on the Pre since typing a period triggers the autoreplace.
Reply
Member: diomark
at: 11:56 AM 07/02/2009
My typing is much more accurate with this hack, but using the googwords, browser card takes an extra 15 seconds to open, and emails an extra 25 seconds

Has anyone found a smaller list with better results?
Reply
Member: wprater
at: 11:59 AM 07/02/2009
Originally Posted by diomark:
My typing is much more accurate with this hack, but using the googwords, browser card takes an extra 15 seconds to open, and emails an extra 25 seconds

Has anyone found a smaller list with better results?
Yeah.. my emails are _very_ slow to load up.
Reply
Member: dimfeld
at: 12:29 PM 07/02/2009
That long? How large is the autoreplace file you're using? When I did the first, much larger iteration of the file, I was seeing delays more similar to what you're reporting. But with a file of about 1.2MB, I see a 4-5 second delay in loading emails and I haven't noticed a delay in loading the browser.
Reply
Member: diomark
at: 01:08 PM 07/02/2009
Originally Posted by dimfeld:
That long? How large is the autoreplace file you're using? When I did the first, much larger iteration of the file, I was seeing delays more similar to what you're reporting. But with a file of about 1.2MB, I see a 4-5 second delay in loading emails and I haven't noticed a delay in loading the browser.
My file (built using the googwords.txt) is 2707177

The command I used to generate this is

python generate_autoreplace.py ../text-edit-autoreplace googwords.txt extra_words.txt new_autoreplace

Are you doing something different?

mhr@jukebox:~/webos$ wc -l googwords.txt
14762 googwords.txt
mhr@jukebox:~/webos$ wc -l extra_words.txt
69 extra_words.txt
mhr@jukebox:~/webos$ wc -l new_autoreplace
168177 new_autoreplace
mhr@jukebox:~/webos$


cheers,
-mark
Reply
Member: diomark
at: 01:10 PM 07/02/2009
Originally Posted by diomark:
My typing is much more accurate with this hack, but using the googwords, browser card takes an extra 15 seconds to open, and emails an extra 25 seconds

Has anyone found a smaller list with better results?
btw - to be specific -

browser card opens immediately. actually using a site (bookmark or search) takes an extra ~15 seconds. (confirmed by replacing w/ the original autoreplace file)

Email header comes up asap. But the body takes an extra 25 seconds unusable as it is..
-mark
Reply
Member: diomark
at: 01:11 PM 07/02/2009
I'm going to try a quick test based on this list (500 words) - will post the result here.

THE MOST COMMON WORDS IN ENGLISH

-mark
Reply
Member: dimfeld
at: 01:12 PM 07/02/2009
Hmm, so our command lines look the same, but your output file has twice as many lines as mine. I'm going to have to try this on Linux and see what happens...
Reply
Member: diomark
at: 01:26 PM 07/02/2009
Originally Posted by dimfeld:
Hmm, so our command lines look the same, but your output file has twice as many lines as mine. I'm going to have to try this on Linux and see what happens...
line handling issues still?

While looking at the top500 words, I'm finding some weirdness in here.. specifically, words in the extra_words.txt are showing up weird like this -
yesterday's in here -


testerdatesterday|yesterday
testerday|yesterday
uesterdauesterday|yesterday
uesterday|yesterday
yeaterday|yesterday
yeaterdayeaterday|yesterday
yedterday|yesterday
yedterdayedterday|yesterday
yesrerday|yesterday
yesrerdayesrerday|yesterday
yesteeday|yesterday
yesteedayesteeday|yesterday
yesterdat|yesterday
yesterdau|yesterday
yesterdayesterdat|yesterday
yesterdayesterdau|yesterday
yesterdsy|yesterday
yesterdsyesterdsy|yesterday
yesterfay|yesterday
yesterfayesterfay|yesterday
yestersay|yesterday
yestersayestersay|yesterday
yestetday|yesterday
yestetdayestetday|yesterday
yestrrday|yesterday
yestrrdayestrrday|yesterday
yestwrday|yesterday
yestwrdayestwrday|yesterday
yesyerday|yesterday
yesyerdayesyerday|yesterday
yrsterday|yesterday
yrsterdayrsterday|yesterday
ywsterday|yesterday
ywsterdaywsterday|yesterday


Any ideas?

cheers,
-mark
Reply
Member: dimfeld
at: 01:26 PM 07/02/2009
Ok, so I tried it on Linux and the output file is still the same size as on Windows for me. I'm not sure offhand what the problem might be, but here's an updated script that uses the rstrip function to get rid of newlines. Maybe that will help some?
New Autoreplace Script

Also, when you pass in the existing text-edit-autoreplace to the script, is that the original Pre autoreplace file that's around 46KB, or is it the new large one? I'm using the original 46KB file there.

EDIT: Just saw your last post after posting this. Does the same thing happen with the new script? That should solve all newline handling issues.
Reply
Member: diomark
at: 01:29 PM 07/02/2009
Your new script seems to work better in linux.. I can confirm that the problem I reported above (with yesterday and other words in extra_words.txt) doesn't exist, and the file is only 1183928 (vs 2.7mb's..)

will test this on the pre.
-mark
Reply
Member: diomark
at: 01:30 PM 07/02/2009
Originally Posted by dimfeld:
Also, when you pass in the existing text-edit-autoreplace to the script, is that the original Pre autoreplace file that's around 46KB, or is it the new large one? I'm using the original 46KB file there.
46kb as well here.
-m
Reply
Member: diomark
at: 01:31 PM 07/02/2009
Is there a way to test this on the device without rebooting the pre?
-m
Reply
Member: dimfeld
at: 01:32 PM 07/02/2009
Originally Posted by diomark:
Is there a way to test this on the device without rebooting the pre?
-m
There might be, but as far as I know you have to reboot.
Reply
Member: diomark
at: 01:41 PM 07/02/2009
(My gmail 24hour sync decided to syncup while I was testing this.. will wait for it to finish (I get ~500 messages /day in that box) before doing anything else)
Reply
Tagsautoreplace
1 2 3 4 5 6 7 8 9 
webOS Nation Forums > webOS apps and software > webOS development > Autoreplace Upgrade