<div dir="ltr">So I was thinking of extracting the range... i.e. rewriting the query if the range isn't at the start.<div><br></div><div>I'm not sure that would take too much work. We would simply look for the range in the whole string and replace it with "".</div>
<div><br></div><div>It's now several times that I've had to debug some code to work out why a query wasn't parsing (poor logging on my side), but it shows that to the end user it's not obvious that the range has to be at the beginning (or at the end).</div>
<div><br></div><div>What do you think?</div><div>Chris</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 26 April 2014 13:54, DM Smith <span dir="ltr"><<a href="mailto:dmsmith@crosswire.org" target="_blank">dmsmith@crosswire.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">I think that "leading" is clear. It is also "a" range. Feel free to improve the comment.<div>
<br></div><div>The technical constraint is that it is not part of a general search and is applied after. Allowing it at the end would also be reasonable.<div><br></div><div>We don't allow for:</div><div>([GEN] Aaron) OR (([MATT] Jesus) AND ([MATT] Mary))</div>
<div>That would take a lot of work.</div><div><br></div><div>Which is get all the Aaron references from Genesis and the Matthew references that contain both Jesus and Mary.<br><div><br></div><div>We also allow one ~n (where n is a number). This will split the search into two parts and do a verse proximity search.</div>
<div>Aaron ~5 Moses means get all the verses containing Aaron that are within 5 of those mentioning Moses. </div><div>Basically ~5 Moses is converted to a range. The search result for Moses is blurred by 5 and then intersected with Aaron search results.</div>
<div><br></div><div>I might have the logic backward. It may be that Aaron ~5 is converted to the range.</div><div><br></div><div>But Aaron~0.5 Moses is a lucene search that applies fuzzy search to Aaron and boosts the search for Aaron.</div>
<div><br></div><div><div>In Him,</div><div><span style="white-space:pre-wrap">        </span>DM Smith</div><div><br><div><div><div class="h5"><div>On Apr 26, 2014, at 8:29 AM, Chris Burrell <<a href="mailto:chris@burrell.me.uk" target="_blank">chris@burrell.me.uk</a>> wrote:</div>
<br></div></div><blockquote type="cite"><div><div class="h5"><div dir="ltr">The code in question:<div><br></div><div>Matcher rangeMatcher = RANGE_PATTERN.matcher(sought);<br></div><div><br></div><div><div> /**</div><div>
* The pattern of a range. This is anything that is contained between a</div>
<div> * leading [] (but not containing a [ or ]), with a + or - optional prefix,</div><div> * perhaps surrounded by whitespace.</div><div> */</div><div> private static final Pattern RANGE_PATTERN = Pattern.compile("^\\s*([-+]?)\\[([^\\[\\]]+)\\]\\s*");</div>
</div><div><br></div><div>The comment doesn't seem to make clear it should be at the start... Not sure if there is a technical constraint...</div><div>Chris</div><div><br></div><div><br></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On 26 April 2014 13:28, Chris Burrell <span dir="ltr"><<a href="mailto:chris@burrell.me.uk" target="_blank">chris@burrell.me.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hello<div><br></div><div>Just wondering if there is any particular reason for the range pattern to be forced to be the starting block of the query...</div><div><br></div><div>i.e. </div><div><br></div><div>
+[Gen] Abraham (works)</div>
<div>Abraham +[Gen] (doesn't work).</div><span><font color="#888888"><div><br></div><div>Chris</div><div><br></div></font></span></div>
</blockquote></div><br></div></div></div><div class="">
_______________________________________________<br>jsword-devel mailing list<br><a href="mailto:jsword-devel@crosswire.org" target="_blank">jsword-devel@crosswire.org</a><br><a href="http://www.crosswire.org/mailman/listinfo/jsword-devel" target="_blank">http://www.crosswire.org/mailman/listinfo/jsword-devel</a><br>
</div></blockquote></div><br></div></div></div></div></div></blockquote></div><br></div>