[jsword-devel] Lost in source

Joe Walker jsword-devel@crosswire.org
Mon, 15 Mar 2004 19:25:10 +0000


Hi,

One thing you do need to do is to checkout the latest code from CVS. 
There are instructions on how to do this on the website. You example you 
cite has changed:

    public void readPlainText() throws BookException, NoSuchVerseException
    {
        Passage ref = PassageFactory.createPassage("Mat 1 1");
        Book bible = 
Books.installed().getBookMetaData(BIBLE_NAME).getBook();

        BookData data = bible.getData(ref);
        String text = data.getPlainText();

        System.out.println("The plain text of Mat 1:1 is "+text);
    }

There are 2 main changes - firstly I changed Books to be a singleton 
(accessed using Books.installed) rather than the collection of static 
methods that it was previously.
This enabled us to have collections of Books that were other than the 
installed ones (useful for the book installation system)
Secondly I didn't like the way Defaults worked (or more accurately 
didn't work) so I added a method on the BookList interface to get a book 
by name.

I think you'll find the changes in the latest CSV are worth it.

Joe.


Norbert Plött wrote:

>Hello jsword fellows!
>
>I got the jsword sources because I want to check some word statistics that I 
>found and I thought that jsword together with the annotated KJV and Strong's 
>numbers would be just the thing to use.
>The API primer source example looked neat and simple so I got the sources. The 
>ant build runs without errors or warnings. Starting jsword works from the 
>shell command prompt. Wonderful.
>
>So I tried to run the following example, which is formed after the API primer 
>code:
>
>    public void readPlainText() throws BookException, NoSuchVerseException
>    {
>        Context.enter();   
>        Defaults.setBibleByName("GerSch");
>        
>        Passage ref = PassageFactory.createPassage("Mat 1 1");
>        Bible bible = Defaults.getBibleMetaData().getBible();
>
>        BookData data = bible.getData(ref);
>        String text = data.getPlainText();
>
>        System.out.println("The plain text of Mat 1:1 is "+text);
>    }
>
>Defaults.setBibleByName("GerSch") fails with an exception, apparently because 
>some resources are not found and some things are not initialised which should 
>be initialised. But frankly, I feel a little bit lost in source because I 
>lack some overview documentation on the prerequisites like which files must 
>be in which place for the infrastructure of jsword to work. It's probably 
>just a little trick ... Like a command line parameter when I start my test 
>application from the NetBeans 3.5 IDE?
>
>My environment is
>
>SuSE Linux 9.0, KDE desktop, Java 1.4.2 VM, NetBeans 3.5 as IDE.
>
>Can anybody give me a clue what to do next?
>
>Regards,
>
>
>Norbert
>
>_______________________________________________
>jsword-devel mailing list
>jsword-devel@crosswire.org
>http://www.crosswire.org/mailman/listinfo/jsword-devel
>  
>