Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Sony Reader > Sony Reader Dev Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 05-21-2008, 05:01 PM   #46
spooky69
Stats:
spooky69 can extract oil from cheesespooky69 can extract oil from cheesespooky69 can extract oil from cheesespooky69 can extract oil from cheesespooky69 can extract oil from cheesespooky69 can extract oil from cheesespooky69 can extract oil from cheesespooky69 can extract oil from cheesespooky69 can extract oil from cheese
 
spooky69's Avatar
 
Posts: 233
Karma: 1189
Join Date: Nov 2007
Device: Sony PRS-505
Quote:
Originally Posted by Clemenseken View Post
@spooky69:
But anyway I don't mind anybody using my code so far as base for an application of their own.
So there's still hope for you: Just go ahead!

It may take another week or two until I have results for my tests. It might take a little longer, then...
( I will ask my product marketing team next time what they think I should promise or announce...)
Sorry about the flood of suggestions! I really think the button switching is essential since it would make a lot more sense to have the page turn buttons act as the cursor on the 505 and would make typing about 75% less awkward. That would be my #1 change I would make for better usability. I'm not a programmer but I'd love to see other people take a crack at this thing once you've got it to where you want it.
Quote:
Originally Posted by =X= View Post
@spooky69

If you notice the sequential search would have taken us 10 reads to find "J". The "binary search" algorithm only took 3 reads.

The real hard part is SONY's API since it is not published I don't know if there is a way to jump to line numbers.
This is pretty similar to what I would have suggested as a search algorithm, though I think there's a way of programming slightly smarter "jumping" in a set of data this large and of this type. If we can figure out a way to get it to jump to a line, then I'll give my best shot at describing one.
spooky69 is offline   Reply With Quote
Old 05-22-2008, 06:07 AM   #47
Clemenseken
eWriter
Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.
 
Clemenseken's Avatar
 
Posts: 267
Karma: 175607
Join Date: May 2007
Location: Frankfurt, FRG
Device: PB-IQ / Sony PRS-500
readline-problem

Hi!
I did -some time ago- try to get "readline" to jump to a specific line - w/o success.
If anyone finds a working way, THAT would be the most elegant solution IMHO...

In order to make search faster anyway, I looked into some general javascript docu and found/tested "match"; that works a lot faster but did not "like" larger dictionary files (that ran with the original "readline" w/o problems). Hmmmm.

So here's the altered code from my function "getDict":
Code:
{try {var stream = new Stream.File(dPath);
var binSea =  String(stream);
var aaa = eval("/\\n"+this.cNum+".*/");
var Ergebnis = binSea.match(aaa)+"";
if (Ergebnis != null)	found=1; [...]
If anybody is experienced or has time on his hands the "readline" jumping certainly would be a "major breakthrough" in relation to larger files...

Thanks for any help / proactive development!
Clemenseken is offline   Reply With Quote
Advert
Old 05-22-2008, 07:40 AM   #48
Bube
Junior Member
Bube began at the beginning.
 
Posts: 4
Karma: 10
Join Date: May 2008
Location: Spires - Germany
Device: PSR 505
Hi,

at first a big greeting from germany to germany :-)
I just tried your dicitionary and it's a really useful enhancement to the reader.
I will use it more intensivly if I find a good dicitionary (and when I read my next english book of course )
I hope that the problem with the long searchtime is solved soon. If there is no way to jump to a specific position in the file, it would be although possible to use several files instead of just one (e.g. one foreach letter, this would speed up the search by a factor of up to 26)
Another improvement would be to change the input method and to one similiar to cellular phones:
press 1 once for A, twice for B and three times for C
if you want to write letters which are nearby, (e.g AB, EF, ...) it would be necessary to use a timer
or to press another button to indicate that one letter is finished and you want to type another one.

But this would be of course just a nice addon feature, the improved search is for sure much more important.

So have a nice holiday
Greetings Bube
Bube is offline   Reply With Quote
Old 05-22-2008, 08:12 PM   #49
igorsk
Wizard
igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.
 
Posts: 3,442
Karma: 300001
Join Date: Sep 2006
Location: Belgium
Device: PRS-500/505/700, Kindle, Cybook Gen3, Words Gear
To read a line in middle you first need to determine all line ends before that. And to do that you need to read all the data up to that point, so it kinda defeats the purpose. You could try to use byte-granular binary search I guess... but why not just use grep as it's fast enough?
igorsk is offline   Reply With Quote
Old 05-23-2008, 04:45 AM   #50
Clemenseken
eWriter
Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.
 
Clemenseken's Avatar
 
Posts: 267
Karma: 175607
Join Date: May 2007
Location: Frankfurt, FRG
Device: PB-IQ / Sony PRS-500
Quote:
Originally Posted by igorsk View Post
You could try to use byte-granular binary search I guess... but why not just use grep as it's fast enough?
Hi igorsk,
how would I invoke grep from a .js file? And doesn't "match" (which uses regular expressions) do the same, basically?
(I have only a vague knowledge of Unix/Linux; sorry.)
Clemenseken is offline   Reply With Quote
Advert
Old 05-23-2008, 05:06 AM   #51
igorsk
Wizard
igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.
 
Posts: 3,442
Karma: 300001
Join Date: Sep 2006
Location: Belgium
Device: PRS-500/505/700, Kindle, Cybook Gen3, Words Gear
I linked to the alternate dictionary implementation above, why not have a look at it?
Anyway, here's the line which does the lookup:
Quote:
this.runCommandResult("/bin/grep '^"+target.word+" =' /Data/database/media/books/lenru.txt");
Where the text file has lines of the following format:
Code:
abbacy = n должность или звание аббата  
abbe = n фр. церк.  1) аббат;  2) отец (обращение к священнику)      
abbess = n настоятельница монастыря, аббатиса
igorsk is offline   Reply With Quote
Old 05-23-2008, 03:43 PM   #52
Clemenseken
eWriter
Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.
 
Clemenseken's Avatar
 
Posts: 267
Karma: 175607
Join Date: May 2007
Location: Frankfurt, FRG
Device: PB-IQ / Sony PRS-500
Quote:
Originally Posted by igorsk View Post
I linked to the alternate dictionary implementation above, why not have a look at it?
Thanks for your help, igorsk.
I DID look up the link when you posted it some time ago - but the site for me only has a lot of question marks (no Russian fonts here on my HD) and a further-going link did not work with me...

BUT: I will try your code example below asap!
Quote:
this.runCommandResult("/bin/grep '^"+target.word+" =' /Data/database/media/books/lenru.txt");
Clemenseken is offline   Reply With Quote
Old 05-23-2008, 04:36 PM   #53
scottsan
Connoisseur
scottsan began at the beginning.
 
scottsan's Avatar
 
Posts: 98
Karma: 10
Join Date: Apr 2008
Device: sony prs 505
xxxxx

Last edited by scottsan; 05-23-2008 at 04:54 PM. Reason: reposted the message
scottsan is offline   Reply With Quote
Old 05-23-2008, 04:51 PM   #54
scottsan
Connoisseur
scottsan began at the beginning.
 
scottsan's Avatar
 
Posts: 98
Karma: 10
Join Date: Apr 2008
Device: sony prs 505
Pardon my ignorance, but what is version .05? I have a prs505; which file do I use and where do I put the dictionary. I tried DictioLauncher05_505_SP1.zip (544.3 KB, 203 views), placed the dictionary (.txt) in the software folder, but when I inserted the sd card into the device nothing happened. I'm just hoping that if SONY ever releases a firmware update it will have a dictionary function.

Keep up the good work.
Scott
scottsan is offline   Reply With Quote
Old 05-23-2008, 05:30 PM   #55
lisak
Member
lisak doesn't litterlisak doesn't litter
 
Posts: 20
Karma: 140
Join Date: Apr 2008
Device: Sony PRS-505
Quote:
Originally Posted by Clemenseken View Post
BUT: I will try your code example below asap!
Please note that you also have to include the definitions of all support functions (originaly taken form universal flasher utility, I think) & addon library libfskLoad.so as well - getComandResult is not a native javascript function.

I did a few tests and it should be fairly easy to reuse that code, but so far I didn't have the chance to get it running properly.
lisak is offline   Reply With Quote
Old 05-24-2008, 02:18 AM   #56
lisak
Member
lisak doesn't litterlisak doesn't litter
 
Posts: 20
Karma: 140
Join Date: Apr 2008
Device: Sony PRS-505
Quote:
Originally Posted by lisak View Post
I did a few tests and it should be fairly easy to reuse that code, but so far I didn't have the chance to get it running properly.
Ok, it is working now - rather crudely, but the concept is clear, I think. Seeking time is approx. 4 sec for first search due to load of supporting library, next searches are quicker (14MB dictionary).

Clemenseken, let me know whether you intend to release a new version with this feature (I can provide you with my code, if you'd like to use it) or if you're busy so I shall continue with the tweaking. Some things will have to be reworked (eg. previous/next buttons), but it shouldn't be a big problem, I think.

Last edited by lisak; 05-24-2008 at 04:35 PM. Reason: grammar...
lisak is offline   Reply With Quote
Old 05-24-2008, 10:05 AM   #57
=X=
Wizard
=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.
 
=X='s Avatar
 
Posts: 3,671
Karma: 12205348
Join Date: Mar 2008
Device: Galaxy S, Nook w/CM7
@igorsk
That's why you da man! Yes calling a binary to do the search would be way faster than having an interpreted language do all of the work.

@clemente
If you already know this please ignore. But you will have to get rid of the '=' sign form igorsk original post for the search to work, since the dictionaries do not have an '=' after the definition word.

Quote:
this.runCommandResult("/bin/grep '^"+target.word+" =' /Data/database/media/books/lenru.txt");
change to
Quote:
this.runCommandResult("/bin/grep '^"+target.word+" ' /Data/database/media/books/lenru.txt");

Last edited by =X=; 05-24-2008 at 10:07 AM. Reason: updated grammer
=X= is offline   Reply With Quote
Old 05-25-2008, 02:32 PM   #58
Clemenseken
eWriter
Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.
 
Clemenseken's Avatar
 
Posts: 267
Karma: 175607
Join Date: May 2007
Location: Frankfurt, FRG
Device: PB-IQ / Sony PRS-500
Exclamation

Quote:
Originally Posted by lisak View Post
Ok, it is working now - rather crudely...
[...]Clemenseken, let me know whether you intend to release a new version with this feature (I can provide you with my code, if you'd like to use it) or if you're busy so I shall continue with the tweaking. Some things will have to be reworked (eg. previous/next buttons), but it shouldn't be a big problem, I think.
Hi lisak,
well, I'm afraid it would be best (for us all) if I accept your offer to let you (and maybe others...) do the further "tweaking".
I think it would make sense if you post your version here, and I place a link (or your original file) on the starting page of this thread. Then, I'd prefer it (from sentimental reasons) that you somehow give your "code" an - at least slightly - different name. (Especially as this may be the start of an "open project" among members here at mobileread...)
I am busy with other things now and then; I will probably understand your code rather well - but might not be able to implement it myself very easily.
Clemenseken is offline   Reply With Quote
Old 05-30-2008, 03:13 PM   #59
=X=
Wizard
=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.
 
=X='s Avatar
 
Posts: 3,671
Karma: 12205348
Join Date: Mar 2008
Device: Galaxy S, Nook w/CM7
PRS-505 Speed Hack

@lisak
The first time I read your post, I didn't realize you had it working. Would have saved me several hours.


Hi Clement/All,
Since you mentioned you did not have much time to work on the speed issue,
I spent some time updating the Dictionary to work using the 'grep' tool. This has speed up the search from ~45sec to ~1 sec. (there is a 10sec hit for the first search).
Clement feel free to merge what you like from the code and discard what you do not like.

NOTE: The changes where only tested on the PRS-505. PRS-500 users please let me know if you have any issues.

INSTALL STEPS
Unzip the file in the
<Card >\Sony Reader\software
folder this will create a "Dictionary" sub folder
<Card >\Sony Reader\software\Dictionary

Copy the autorun.* files up one directory
copy autorun.* <Card >\Sony Reader\software\

Create a directory 'dict' sub directory under
<SONY>\database\
and place the dictioanry *.txt files in that new directory
copy <Card>\Sony Reader\software\dictonary\*.txt <SONY>\database\dict


CHANGES
  • Quick Search: Uses ‘grep’ to find word, speed increased. First search is approx 10sec, 1 sec after that.
  • Quick clear: The mark(bookmark) now clears the word entry field
  • Quick word type: Prev/Next keys remapped to move the keyboard left right. -Previously the user had to type the word with one hand. Now the user can use on thumb for navigation left/right and the other thumb for the text selection.
  • Changed the default dictionary from loading ‘ita.txt’ to ‘dictionary.txt’
    NOTE: Dictionary location has changed. To ‘/Data/dictionary/dict’ of from the windows world ‘<your drive>\dictionary\dict


BROKEN
Next/Prev word does not work as before. Now the next/prev word will start from the beginning of the dictionary

=X=
Attached Files
File Type: zip Dictionary_7b-Xmods.zip (5.02 MB, 571 views)

Last edited by =X=; 05-30-2008 at 03:16 PM. Reason: updated text for clarification
=X= is offline   Reply With Quote
Old 05-31-2008, 09:36 AM   #60
Clemenseken
eWriter
Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.Clemenseken can program the VCR without an owner's manual.
 
Clemenseken's Avatar
 
Posts: 267
Karma: 175607
Join Date: May 2007
Location: Frankfurt, FRG
Device: PB-IQ / Sony PRS-500
Smile Than=X=!

Quote:
Originally Posted by =X= View Post
Hi Clemens/All,
Since you mentioned you did not have much time to work on the speed issue,
I spent some time updating the Dictionary to work using the 'grep' tool. This has sped up the search from ~45sec to ~1 sec. (there is a 10sec hit for the first search).
Clemens feel free to merge what you like from the code and discard what you do not like.
Hi =X=
I just downloaded your improved ***speed version*** of the dictionary software but did not have time, yet, to look into your code...
I AM REALLY GLAD, YOU DID THE IMPLEMENTATION as I'm totally inexperienced with linux/grep. And I learned that even minor faults with syntax can take you hours/days to get it running...

I just yesterday finished a game I was doing for sony-PRSs and will have time from coming week on to get your code mixed into my "older version".
But I will put a link to this your previous post on page 1 of this thread right away!

Than=X= again! (& pardon the pun,) Clemens
Clemenseken is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Christmas gift: MahJonG game (starting from SD card via autorun) Clemenseken Sony Reader Dev Corner 19 05-06-2011 04:09 PM
Code to launch autorun from SD without pullin the card out mkaluza Sony Reader Dev Corner 1 08-12-2008 12:05 PM
PRS-500 Dictionary for Sony PRS500/5 (autorun from SD card) with onscreen keyboard Clemenseken Sony Reader Dev Corner 3 07-05-2008 08:33 AM
Dictionary for Sony PRS500/5 - new version next week ... Clemenseken Sony Reader Dev Corner 1 04-15-2008 07:42 AM
Dictionary for Sony PRS500/5 (runs from SD card) Clemenseken Sony Reader 0 03-27-2008 05:58 PM


All times are GMT -4. The time now is 07:52 AM.


MobileRead.com is a privately owned, operated and funded community.