From trent.jsword at trentonadams.ca Mon Mar 1 00:40:12 2010 From: trent.jsword at trentonadams.ca (Trenton D. Adams) Date: Mon, 1 Mar 2010 00:40:12 -0700 (MST) Subject: [jsword-devel] Nave's Topical Bible Reference linking In-Reply-To: <1674156078.521267427543151.JavaMail.root@zimbra> Message-ID: <440836465.551267429212134.JavaMail.root@zimbra> textPaneBookDataDisplay.refresh() Under the following line... String text = XMLUtil.writeToString(htmlsep); put.... if ("Nave".equals(bmd.getInitials())) { text = text.replaceAll("(#)(.+\\|)", "$1$2"); } 1. The Nave's is pretty much raw text, and the biblical references are not marked up as far as I can see. So, I figured a regex replacement with a link was the best way of doing it. 2. Used the convenience method replaceAll() as it's a single call, unless you want to cache a pre-compiled pattern matcher in some way? Any thoughts? Can we add this? Thanks. From trent.jsword at trentonadams.ca Mon Mar 1 01:18:47 2010 From: trent.jsword at trentonadams.ca (Trenton D. Adams) Date: Mon, 1 Mar 2010 01:18:47 -0700 (MST) Subject: [jsword-devel] Nave's Topical Bible Reference linking In-Reply-To: <440836465.551267429212134.JavaMail.root@zimbra> Message-ID: <1601733969.581267431527141.JavaMail.root@zimbra> Okay, this isn't working on every case. I think it's due to some book names not working with jsword. I'll look into it, and see if I need to do a search/replace on book names for those lines. Either way, something worth adding? Thanks. ----- "Trenton D. Adams" wrote: > From: "Trenton D. Adams" > To: "J-Sword Developers Mailing" > Sent: Monday, March 1, 2010 1:40:12 AM GMT -06:00 US/Canada Central > Subject: [jsword-devel] Nave's Topical Bible Reference linking > > textPaneBookDataDisplay.refresh() > > Under the following line... > String text = XMLUtil.writeToString(htmlsep); > > put.... > if ("Nave".equals(bmd.getInitials())) { > text = text.replaceAll("(#)(.+\\|)", "$1 href=\"bible://{$2}\">$2"); > } > > 1. The Nave's is pretty much raw text, and the biblical references are > not marked up as far as I can see. So, I figured a regex replacement > with a link was the best way of doing it. > 2. Used the convenience method replaceAll() as it's a single call, > unless you want to cache a pre-compiled pattern matcher in some way? > > Any thoughts? Can we add this? > > Thanks. > > _______________________________________________ > jsword-devel mailing list > jsword-devel at crosswire.org > http://www.crosswire.org/mailman/listinfo/jsword-devel From trent.jsword at trentonadams.ca Mon Mar 1 01:25:05 2010 From: trent.jsword at trentonadams.ca (Trenton D. Adams) Date: Mon, 1 Mar 2010 01:25:05 -0700 (MST) Subject: [jsword-devel] Nave's Topical Bible Reference linking In-Reply-To: <1601733969.581267431527141.JavaMail.root@zimbra> Message-ID: <1677059254.611267431905049.JavaMail.root@zimbra> It's due to line breaks like this...

#Jos 1:16-18; 2Sa 3:36,37; 15:23,30; 18:3; 21:17; 1Ch

12:38| So, even if I did fix it on the single line, it would miss the second line verses. I'll look into doing multiline mode tomorrow, and removing the extra

as it's not needed, because the '|' appears to be the reference ending indicator. ----- "Trenton D. Adams" wrote: > From: "Trenton D. Adams" > To: "Trenton D. Adams" , "J-Sword Developers Mailing List" > Sent: Monday, March 1, 2010 2:18:47 AM GMT -06:00 US/Canada Central > Subject: Re: [jsword-devel] Nave's Topical Bible Reference linking > > Okay, this isn't working on every case. I think it's due to some book > names not working with jsword. I'll look into it, and see if I need > to do a search/replace on book names for those lines. > > Either way, something worth adding? > > Thanks. > > ----- "Trenton D. Adams" wrote: > > > From: "Trenton D. Adams" > > To: "J-Sword Developers Mailing" > > Sent: Monday, March 1, 2010 1:40:12 AM GMT -06:00 US/Canada Central > > Subject: [jsword-devel] Nave's Topical Bible Reference linking > > > > textPaneBookDataDisplay.refresh() > > > > Under the following line... > > String text = XMLUtil.writeToString(htmlsep); > > > > put.... > > if ("Nave".equals(bmd.getInitials())) { > > text = text.replaceAll("(#)(.+\\|)", "$1 > href=\"bible://{$2}\">$2"); > > } > > > > 1. The Nave's is pretty much raw text, and the biblical references > are > > not marked up as far as I can see. So, I figured a regex > replacement > > with a link was the best way of doing it. > > 2. Used the convenience method replaceAll() as it's a single call, > > unless you want to cache a pre-compiled pattern matcher in some > way? > > > > Any thoughts? Can we add this? > > > > Thanks. > > > > _______________________________________________ > > jsword-devel mailing list > > jsword-devel at crosswire.org > > http://www.crosswire.org/mailman/listinfo/jsword-devel From dmsmith at crosswire.org Mon Mar 1 05:39:23 2010 From: dmsmith at crosswire.org (DM Smith) Date: Mon, 1 Mar 2010 07:39:23 -0500 Subject: [jsword-devel] Nave's Topical Bible Reference linking In-Reply-To: <440836465.551267429212134.JavaMail.root@zimbra> References: <440836465.551267429212134.JavaMail.root@zimbra> Message-ID: I think there's a beta for it. Are you using that? -- DM On Mar 1, 2010, at 2:40 AM, Trenton D. Adams wrote: > textPaneBookDataDisplay.refresh() > > Under the following line... > String text = XMLUtil.writeToString(htmlsep); > > put.... > if ("Nave".equals(bmd.getInitials())) { > text = text.replaceAll("(#)(.+\\|)", "$1$2"); > } > > 1. The Nave's is pretty much raw text, and the biblical references are not marked up as far as I can see. So, I figured a regex replacement with a link was the best way of doing it. > 2. Used the convenience method replaceAll() as it's a single call, unless you want to cache a pre-compiled pattern matcher in some way? > > Any thoughts? Can we add this? > > Thanks. > > _______________________________________________ > jsword-devel mailing list > jsword-devel at crosswire.org > http://www.crosswire.org/mailman/listinfo/jsword-devel From trent.jsword at trentonadams.ca Mon Mar 1 22:09:43 2010 From: trent.jsword at trentonadams.ca (trent.jsword at trentonadams.ca) Date: Mon, 1 Mar 2010 22:09:43 -0700 (MST) Subject: [jsword-devel] Nave's Topical Bible Reference linking In-Reply-To: <1444190357.361267506148614.JavaMail.root@zimbra> Message-ID: <1321940730.381267506583652.JavaMail.root@zimbra> Sorry for the delay in replying, I was busy with the wife and kids all day. We went bowling and what not, lot's of fun. Nope, wasn't aware of that new beta, I'll check for that next time I work on changes related to an existing module. I'll have to fix up my XSL that I gave you previously. The "otherwise" may need to just be removed, and replaced with something else, like checking for non-existent attributes, depending, as it conflicts with the TEI stuff in the new Nave's. But, the replace I gave you is almost right, I just have to make it work with multi-line mode. I'll make the replacement check for version 1.0 as well, and that way the new Nave's in beta will be completely ignored. Does that sound like a good way of doing this? Should the code somehow be marked for removal at a later date? Or should we keep it around for quite awhile after the new Nave's is moved to production? I'd imagine, so we don't affect users too much, we may just want to leave it, eh? Anyhow, I'm going to work on some of the XSL, and test a bit. I'm seeing some issues with the new Nave's, cause it doesn't appear to be marked up properly in some cases, in which case I should probably report it. Thanks. ----- "DM Smith" wrote: > From: "DM Smith" > To: "Trenton D. Adams" , "J-Sword Developers Mailing List" > Sent: Monday, March 1, 2010 6:39:23 AM GMT -06:00 US/Canada Central > Subject: Re: [jsword-devel] Nave's Topical Bible Reference linking > > I think there's a beta for it. > Are you using that? > -- DM > > On Mar 1, 2010, at 2:40 AM, Trenton D. Adams wrote: > > > textPaneBookDataDisplay.refresh() > > > > Under the following line... > > String text = XMLUtil.writeToString(htmlsep); > > > > put.... > > if ("Nave".equals(bmd.getInitials())) { > > text = text.replaceAll("(#)(.+\\|)", "$1 href=\"bible://{$2}\">$2"); > > } > > > > 1. The Nave's is pretty much raw text, and the biblical references > are not marked up as far as I can see. So, I figured a regex > replacement with a link was the best way of doing it. > > 2. Used the convenience method replaceAll() as it's a single call, > unless you want to cache a pre-compiled pattern matcher in some way? > > > > Any thoughts? Can we add this? > > > > Thanks. > > > > _______________________________________________ > > jsword-devel mailing list > > jsword-devel at crosswire.org > > http://www.crosswire.org/mailman/listinfo/jsword-devel From trent.jsword at trentonadams.ca Wed Mar 3 03:07:15 2010 From: trent.jsword at trentonadams.ca (Trenton D. Adams) Date: Wed, 3 Mar 2010 03:07:15 -0700 (MST) Subject: [jsword-devel] pilgrims progress not working on trunk Message-ID: <1485406391.911267610835610.JavaMail.root@zimbra> Hi Guys, It works with 1.6, but does not with the trunk. Try installing it, and opening PART 1, and any of the stages. I copied my trunk to trunk-test locally, reverted all my code, and tried it, just to make sure it wasn't my code messing it up. Thanks. From trent.jsword at trentonadams.ca Wed Mar 3 13:48:50 2010 From: trent.jsword at trentonadams.ca (trent.jsword at trentonadams.ca) Date: Wed, 3 Mar 2010 13:48:50 -0700 (MST) Subject: [jsword-devel] Nave's Topical Bible Reference linking In-Reply-To: <297690383.91267649235842.JavaMail.root@zimbra> Message-ID: <1223456715.111267649330564.JavaMail.root@zimbra> Hi DM, Sorry this is a bit long. I hope I got things working right this time. If you have an issues with some code, because it doesn't fit the jsword model in some way, or whatever, let me know. I don't have a problem with the new beta Nave's. My new XSL works fine with it. H H G G I tried both the StrongsHebrew and StrongsGreek modules in beta, as well as the "Strong" module in beta, and they all work with the above XSL. Unfortunately, they are marked up differently, hence the more complex XSL fragment. I highly recommend that we change all PROTOCOL handling to case insensitive matching, according to the HTTP specification (3.2.3 http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html). If we do, an osisRef of Bible:John.3.16 will just work. Desktop.java:567 if (BIBLE_PROTOCOL.equalsIgnoreCase(protocol)) { If the above, at least, is not done, Easton's Bible Dictionary, among many others I'm sure, will not work with the XSL. The alternative is to parse out "Bible:" using substring-after, from within the XSL. But, I think it's reasonable to make all protocols case-insensitive, unless I'm missing something! Yes/no? At least the following modules have linked text to the bible, after putting in the above XSL... - Easton's Bible Dictionary (production) - Nave's Topical Reference (beta) However, the production Nave's required a bit of hacking, because it's text (not TEI) and because it sometimes spans multiple lines between # and |, which it really shouldn't. And, what happens then is that it becomes difficult to replace "

" and the new lines with nothing, because you don't want it to do it through the whole file. I was trying a bit of regular expressions, but couldn't seem to get it. An example of the problem text is below.

-Inspiration of

#Ex 12:1; Le 10:8; 11:1; 13:1; 15:1; Nu 2:1; 4:1,17; 18:1;

19:1; 20:12| The regex I tried, to remove the br tags and new lines, was variations of this one... text = text.replaceAll("(?m)(?s)(

#.*?)$(?:(?:^

)(.*?)$)*(\|)", "$1$2$3"); But, that would be very difficult to debug, if we ever found a problem anyhow. So, I drafted some code to process this using a BufferedReader, by marking beginning (

#) and ending (|) references. I then remove "

" from the beginning of the line, if scripture references were already started by #. The caveat of this is that if "

" is ever removed, it will break. However, it will fail-safe to no link processing, and just leaving the raw text with the "

" in place. It may be worth while throwing this in a method. TextPaneBookDataDisplay.refresh() if ("Nave".equals(bmd.getInitials()) && "1.1".equals(bmd.getProperties().get("Version"))) { final BufferedReader reader = new BufferedReader(new StringReader(text)); try { String curLine = null; final StringBuffer sBuffer = new StringBuffer(); final Pattern refStart = Pattern.compile("

#"); final Pattern refEnd = Pattern.compile("\\|"); boolean inReferences = false; boolean endRef = false; boolean processed = false; do { curLine = reader.readLine(); if (curLine != null) { if (!inReferences) { // # indicates start of references, check for it final Matcher matcher = refStart.matcher(curLine); inReferences = matcher.find(); if (inReferences) { // start of link, needs new line sBuffer.append("

"); } } if (inReferences) { // | indicates end of references, check for it final Matcher matcher = refEnd.matcher(curLine); endRef = matcher.find(); } if (inReferences) { // delete "

" inside of reference sBuffer.append( curLine.replaceAll("^.*?

*", "")); } else { sBuffer.append(curLine); } if (endRef || ! inReferences) { sBuffer.append('\n'); } if (endRef) { inReferences = false; endRef = false; processed = true; // processed one or more } } } while (curLine != null); text = sBuffer.toString(); if (processed) { // only add links if processing went okay text = text.replaceAll("(?s)(?m)(

+)#(.+?)\\|", "$1$2"); } } catch (IOException e) { e.printStackTrace(); // should we ignore this, it's a string, not a real IO stream???? } } The above solution is much easier to debug, seeing you can step through it. Every entry I've tried works with the above code. Even this long one from "FAMINE"...

-Sent as a judgment

#Le 26:19-29; De 28:23,24,38-42; 1Ki 17:1; 2Ki 8:1; 1Ch

21:12; Ps 105:16; 107:33,34; Isa 3:1-8; 14:30; Jer 19:9;

14:15-22; 29:17,19; La 5:4,5,10; Eze 4:16,17; 5:16,17;

14:13; Joe 1:15,16; Am 4:6-9; 5:16,17; Hag 1:10,11; Mt 24:7;

Lu 21:11; Re 6:5-8| The code is kind of ugly, but so is the text that is being processed. The processing, on my machine, is showing 0ms-1ms processing time; so it's extremely fast. Is this worth including, or should we direct people to just use the TEI beta version? Either way you want it works for me; I just thought that the average person might not know to try the beta repo. Besides, one thing I REALLY like about the Java code, is it loads all the verses in one swoop when you click, where as you can't do that with the TEI, because every single verse/verse-range is a followed by

, etc, etc. So, without a bunch of extra XSL work, applying templates in certain cases, and only with certain books, etc, etc, it would take more time to do. Ah well, it was fun either way; but then I get cheap thrills too, lol. Thanks. ----- "trent jsword" wrote: > From: "trent jsword" > To: "DM Smith" > Cc: "J-Sword Developers Mailing List" > Sent: Monday, March 1, 2010 11:09:43 PM GMT -06:00 US/Canada Central > Subject: Re: [jsword-devel] Nave's Topical Bible Reference linking > > Sorry for the delay in replying, I was busy with the wife and kids all > day. We went bowling and what not, lot's of fun. > > Nope, wasn't aware of that new beta, I'll check for that next time I > work on changes related to an existing module. > > I'll have to fix up my XSL that I gave you previously. The > "otherwise" may need to just be removed, and replaced with something > else, like checking for non-existent attributes, depending, as it > conflicts with the TEI stuff in the new Nave's. > > But, the replace I gave you is almost right, I just have to make it > work with multi-line mode. I'll make the replacement check for > version 1.0 as well, and that way the new Nave's in beta will be > completely ignored. Does that sound like a good way of doing this? > > Should the code somehow be marked for removal at a later date? Or > should we keep it around for quite awhile after the new Nave's is > moved to production? I'd imagine, so we don't affect users too much, > we may just want to leave it, eh? > > Anyhow, I'm going to work on some of the XSL, and test a bit. I'm > seeing some issues with the new Nave's, cause it doesn't appear to be > marked up properly in some cases, in which case I should probably > report it. > > Thanks. > > ----- "DM Smith" wrote: > > > From: "DM Smith" > > To: "Trenton D. Adams" , "J-Sword > Developers Mailing List" > > Sent: Monday, March 1, 2010 6:39:23 AM GMT -06:00 US/Canada Central > > Subject: Re: [jsword-devel] Nave's Topical Bible Reference linking > > > > I think there's a beta for it. > > Are you using that? > > -- DM > > > > On Mar 1, 2010, at 2:40 AM, Trenton D. Adams wrote: > > > > > textPaneBookDataDisplay.refresh() > > > > > > Under the following line... > > > String text = XMLUtil.writeToString(htmlsep); > > > > > > put.... > > > if ("Nave".equals(bmd.getInitials())) { > > > text = text.replaceAll("(#)(.+\\|)", "$1 > href=\"bible://{$2}\">$2"); > > > } > > > > > > 1. The Nave's is pretty much raw text, and the biblical > references > > are not marked up as far as I can see. So, I figured a regex > > replacement with a link was the best way of doing it. > > > 2. Used the convenience method replaceAll() as it's a single > call, > > unless you want to cache a pre-compiled pattern matcher in some > way? > > > > > > Any thoughts? Can we add this? > > > > > > Thanks. > > > > > > _______________________________________________ > > > jsword-devel mailing list > > > jsword-devel at crosswire.org > > > http://www.crosswire.org/mailman/listinfo/jsword-devel > > _______________________________________________ > jsword-devel mailing list > jsword-devel at crosswire.org > http://www.crosswire.org/mailman/listinfo/jsword-devel From trent.jsword at trentonadams.ca Wed Mar 17 13:15:45 2010 From: trent.jsword at trentonadams.ca (trent.jsword at trentonadams.ca) Date: Wed, 17 Mar 2010 14:15:45 -0600 (MDT) Subject: [jsword-devel] show strongs issues In-Reply-To: <163185281.251268856943915.JavaMail.root@zimbra> Message-ID: <1968164628.271268856945359.JavaMail.root@zimbra> Hi Guys, I couldn't help but notice that when I have multiple windows open, the show strongs link item on the view menu works on each individual window, but the state in the menu is global, no matter which window has the focus. This results in me needing to hit it twice for another window, to toggle the state of the showing of strongs in that window. Should I put this in as a bug? Thanks. From dmsmith at crosswire.org Wed Mar 17 14:41:10 2010 From: dmsmith at crosswire.org (DM Smith) Date: Wed, 17 Mar 2010 17:41:10 -0400 Subject: [jsword-devel] show strongs issues In-Reply-To: <1968164628.271268856945359.JavaMail.root@zimbra> References: <1968164628.271268856945359.JavaMail.root@zimbra> Message-ID: <4BA14C76.3090702@crosswire.org> On 03/17/2010 04:15 PM, trent.jsword at trentonadams.ca wrote: > Hi Guys, > > I couldn't help but notice that when I have multiple windows open, the show strongs link item on the view menu works on each individual window, but the state in the menu is global, no matter which window has the focus. This results in me needing to hit it twice for another window, to toggle the state of the showing of strongs in that window. > > Should I put this in as a bug? > Please do. In Him, DM From christopher at burrell.me.uk Wed Mar 31 12:15:30 2010 From: christopher at burrell.me.uk (Chris Burrell) Date: Wed, 31 Mar 2010 20:15:30 +0100 Subject: [jsword-devel] Mavenized Jsword question Message-ID: Hi guys I'm having trouble building from the root of jsword using the POMs. I think the issue is that i can't access any non-http traffic from where I am and the distribution section in the pom specifies a SCP pom? Is that correct? and if so, is there a way around it? For e.g. while building bibledesktop, it complains that it can't find org.crosswire:jlfgr:jar:1.0 Cheers Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: