[jsword-devel] JSword version and Indexing Jobs

Brian Fernandes infernalproteus at gmail.com
Sat Jan 26 20:41:10 MST 2008


DM Smith wrote:
> On Jan 26, 2008, at 1:03 AM, Brian Fernandes wrote:
>
>   
>> DM,
>>
>> 1) Is it possible to query the JSword version through API? I did try a
>> brief search but that drew a blank.
>>     
>
>
> Yes. It should be. I'm assuming that you mean a Lucene search rather  
> than a Sword lookup. Give me more to go on and and perhaps I can point  
> you in the right direction or work up and example.
>   
I actually did mean the JSword version (and not the Lucene version, 
sorry for confusing matters). I intend to allow users to hook the 
Firefox extension up to an existing JSword installation and when they do 
this, I should know what version of JSword that is for a compatibility 
check. For instance, I know the index progress text is going to be too 
long in JSword 1.0.7 and so I will either disallow that version or work 
around it.
>
>   
>> 2) I'm really impressed with the speed of Lucene's searching/indexing
>> already, am looking forward to the next version where it is so much  
>> faster.
>>     
>
>
> I reported that Lucene, just as a drop in is significantly faster.  
> Turns out that Lucene did not allow for fundamental object reuse (such  
> as Document and Token) but now does. I'm working on using it ant it is  
> even faster. Indexing a Plaintext Bible is almost instantaneous,  
> indicating that most of our time is spent parsing the document to hand  
> it to Lucene and drawing the progress bar.
>   
Hard to believe it is actually that fast, excellent news.
>> On to my problem...
>> In my extension, I add a WorkListener to the JobManager during  
>> indexing
>> so that I may monitor and report progress. In #workProgressed, I  
>> update
>> my progress bar with the section name from the job. This works  
>> perfectly.
>>
>> However, unlike BibleDesktop, my progress bar is small, perhaps 100
>> pixels wide. The job section names during indexing are something like
>> "Creating Index. Processing Genesis" and so on, sometimes the text
>> overflows out of the progress boundaries region depending on length of
>> the book name. I would probably display just "Indexing Genesis" for my
>> small progress bar.
>> This would be an easy mod if the text was always going to be "Creating
>> Index. Processing X", but since JSword is I18Ned, it is not so easy to
>> arrive at a generic solution.
>> Would it be possible to change the job section name to just "Genesis"
>> instead, the rest of the description to be managed by a UI element? I
>> realize that the job is not always in the "Creating Index" phase and  
>> it
>> could be Optimizing as well (and this would change the "complete"
>> description in the UI) but hopefully that phase can be ascertained by
>> looking at the completion percentage.
>>
>> Am open to any other suggestions you may have to deal with this issue.
>>     
>
> This is fine to me, I think that the other translators are all still  
> active and I'd like to see their response too.
>
> Perhaps, the book name is all that is needed, since the progress bar  
> has the immediate context of the user clicking on the "Create Index"  
> button.
>   
I agree it is pretty easy to follow in the context of the user having 
clicked the "Create Index" button; this really is the easiest solution 
which works well for me too. On the other hand, if people still want the 
whole descriptive text that it is now, it will require then changes I 
outlined above - will wait until we have more responses before proceeding.
> Also, we can use short Bible book names. This will be perfect for  
> small devices. (If we can ever migrate to midp 2.0!) Currently, we use  
> the user's preferred form of the book name.
>   
Good point.
Something that comes to mind is to add get/setSectionInfo methods to the 
Progress interface which would return an Object you could use to get 
more info about the current state of the job. The object would probably 
be a Key instance when indexing a particular book. The developer could 
then display the job state as he chooses while setSectionName still uses 
the same description it does currently.
>> Keep up the great work with  JSword, has been a real pleasure working
>> with it.
>>     
>
> After our discussions here, feel free to submit a patch.
>
> I'm looking forward to your contributions!
>   
Looking forward to contributing!

Brian.



More information about the jsword-devel mailing list