<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Yes, in both getPassage and getVerse it is better to use getOsisID
    rather than getName.<br>
    You can also use getOsisRef, which will result in a more compact
    representation than getOsisID for ranges. So I actually recommend
    getOsisRef over getOsisID (but test it first).<br>
    <br>
    And it would be good to make the change also in the exception block,
    too. That way errors are reported against what was parsed.<br>
    <br>
    -- DM<br>
    <br>
    On 02/09/2012 02:24 PM, Martin Denham wrote:
    <blockquote
cite="mid:CAJ30_OO+FUx2djaR9PJ_zoTrGbrngAvDbSXHeR3YSN5y_rRU+w@mail.gmail.com"
      type="cite">Thanks for that DM.  I was hoping to get by without
      your code change because an And Bible release is coming up but I
      had to use it to fix another localisation search problem in Thai.
       When Thai is selected searching for 'John' in ESV only had 83
      hits instead of 132.  I peered at the Thai localisation but I
      could see no obvious issues - 
      it is quite an amazing language.
      <div><br>
      </div>
      <div>This seems quite an important fix.  I notice that the
        getVerse method in KeyUtil also uses getName instead of
        getOsisID.  Should getVerse be changed too.</div>
      <div>I also see that the AV11N version in svn uses getName instead
        of getOsisID - will that have the same problem? </div>
      <div><br>
      </div>
      <div>...A bit later - after more testing...</div>
      <div><br>
      </div>
      <div>While testing the Thai localisation I noticed that I could
        not display 1 Thess in BWE, EMTV, Murdock but other modules like
        KJV, ESV, GodsWord worked.  There was an error message:</div>
      <div>
        <div>        Key can't be a verse: 1เธสะโลนิกา 1</div>
      </div>
      <div>which seems to come from the getVerse method I mentioned at
        the top of this e-mail.  So I changed getName to getOsisID in
        the getVerse method too and that seems to fix that.  Could you
        confirm that it is correct to use getOsisID in both methods?</div>
      <div><br>
      </div>
      <div>Thanks</div>
      <div>Martin</div>
      <div><br>
        <br>
        <div class="gmail_quote">On 8 February 2012 20:44, DM Smith <span
            dir="ltr"><<a moz-do-not-send="true"
              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 bgcolor="#FFFFFF" text="#000000"> The simplest fix
              (though not right in an av11n context) is to change<br>
              KeyUtil.getPassage(Key)<br>
              from<br>
                      try {<br>
                          ref = keyf.getKey(key.getName());<br>
                      } catch (NoSuchKeyException ex) {<br>
                          log.warn("Key can't be a passage: " +
              key.getName());<br>
                          ref = keyf.createEmptyKeyList();<br>
                      }<br>
              to<br>
                      try {<br>
                          ref = keyf.getKey(key.getOsisID());<br>
                      } catch (NoSuchKeyException ex) {<br>
                          log.warn("Key can't be a passage: " +
              key.getName());<br>
                          ref = keyf.createEmptyKeyList();
              <div>
                <div><br>
                          }<br>
                  <br>
                  On 02/08/2012 03:14 PM, DM Smith wrote: </div>
              </div>
              <blockquote type="cite">
                <div>
                  <div> On 02/08/2012 03:05 PM, Martin Denham wrote:
                    <blockquote type="cite">I found the problem:
                      <div>
                        <div>Rev.Full = Johannes\u2019 openberring</div>
                      </div>
                      <div><br>
                      </div>
                      <div>\u0219 is an apostrophe and so it was
                        matching Johannes' openberring 22:8 but stopping
                        at the apostrophe which of course matched the
                        whole of John.</div>
                      <div><br>
                      </div>
                      <div>Best regards</div>
                      <div>Martin</div>
                    </blockquote>
                    <br>
                    That's part of it. I just looked at it and the
                    bigger, other part is that KeyUtil.getPassage(Key)
                    tries to cast a Key to a passage. It should not be
                    called on a Verse or a VerseRange. As it gets the
                    locale version of the Verse and tries to convert
                    that to a Passage.<br>
                    <br>
                    It didn't need to convert the verse to Norwegian,
                    and then re-parse it, incorrectly into a passage. It
                    had everything it needed in the Verse.<br>
                    <br>
                    I've got to think about that for a bit to figure out
                    the best way to fix it and where. Fixing it will be
                    a performance improvement in general.<br>
                    <br>
                    The apostrophe in the name will cause other problems
                    in JSword. Likewise for other "punctuation". But
                    that is another problem.<br>
                    <br>
                    In Him,<br>
                        DM<br>
                    <br>
                    <blockquote type="cite">
                      <div><br>
                        <br>
                        <div class="gmail_quote">On 8 February 2012
                          19:23, Martin Denham <span dir="ltr"><<a
                              moz-do-not-send="true"
                              href="mailto:mjdenham@gmail.com"
                              target="_blank">mjdenham@gmail.com</a>></span>
                          wrote:<br>
                          <blockquote class="gmail_quote"
                            style="margin:0 0 0 .8ex;border-left:1px
                            #ccc solid;padding-left:1ex">
                            <div>I have just noticed that I have not
                              fixed the problem.  I am now getting an
                              error on the final hit 'Key can't be a
                              passage' - I don't know what that means:</div>
                            <div>
                              <div>02-08 19:05:34.105:
                                I/System.out(22191): 129 found:Johannes’
                                openberring 1:1 docid=30681 docbase=0
                                key.card:1 res.card=129</div>
                              <div>02-08 19:05:34.105:
                                I/System.out(22191): 130 found:Johannes’
                                openberring 1:4 docid=30684 docbase=0
                                key.card:1 res.card=130</div>
                              <div>02-08 19:05:34.105:
                                I/System.out(22191): 131 found:Johannes’
                                openberring 1:9 docid=30689 docbase=0
                                key.card:1 res.card=131</div>
                              <div>02-08 19:05:34.145:
                                I/System.out(22191): JSword:Key can't be
                                a passage: Johannes’ openberring 22:8</div>
                              <div>02-08 19:05:34.155:
                                I/System.out(22191): 132 found:Johannes’
                                openberring 22:8 docid=31071 docbase=0
                                key.card:1 res.card=131</div>
                              <div><br>
                              </div>
                              <div>To log the cardinality I just added a
                                println in the VerseCollector as below:</div>
                              <div>
                                <div>            Key key =
                                  VerseFactory.fromString(doc.get(LuceneIndex.FIELD_KEY));</div>
                                <div>            results.addAll(key);</div>
                                <div>           
                                  System.out.println(++count + " found:"
                                  +key.getName()+ " docid="+docId+"
                                  docbase="+docBase+"
                                  key.card:"+key.getCardinality()+"
                                  res.card="+results.getCardinality());</div>
                              </div>
                              <div><br>
                              </div>
                              <div>The problem is I can't see the bug on
                                Windows, only when running on my Android
                                phone, so I am not sure anybody without
                                an Android will be able to reproduce the
                                problem easily.<span><font
                                    color="#888888"><br>
                                  </font></span></div>
                              <span><font color="#888888">
                                  <div><br>
                                  </div>
                                  <div>Martin</div>
                                </font></span>
                              <div>
                                <div><br>
                                  <div class="gmail_quote">On 8 February
                                    2012 19:04, DM Smith <span
                                      dir="ltr"><<a
                                        moz-do-not-send="true"
                                        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 bgcolor="#FFFFFF"
                                        text="#000000"> I've been trying
                                        to get to it, but haven't be
                                        able to do so. I'd be interested
                                        in your code to log the
                                        cardinality.<span><font
                                            color="#888888"><br>
                                            -- DM</font></span>
                                        <div>
                                          <div><br>
                                            <br>
                                            On 02/08/2012 01:54 PM,
                                            Martin Denham wrote:
                                            <blockquote type="cite">
                                              <div>I don't know what is
                                                going on but I have done
                                                more analysis and found
                                                a fix for Nynorsk, but I
                                                think it is affecting
                                                other locales like
                                                Japanese which I can't
                                                explain.</div>
                                              <div><br>
                                              </div>
                                              <div>Test: search for
                                                'John' in NT in And
                                                Bible with locale set to
                                                nn</div>
                                              <div>Result: 1389 hits
                                                including every verse in
                                                the gospel of John </div>
                                              <div>Observation: I logged
                                                the cardinality of the
                                                results var in
                                                VerseCollector and you
                                                can see that it jumps
                                                from 131 to 1389 on the
                                                last hit in Rev.22.8:</div>
                                              <div>02-08 18:18:15.895:
                                                I/System.out(21945): 127
                                                found:Apostelgjerningane
                                                19:4 docid=27575
                                                docbase=0 key.card:1
                                                res.card=127</div>
                                              <div>
                                                <div>02-08 18:18:15.905:
                                                  I/System.out(21945):
                                                  128 found:Galatarane
                                                  2:9 docid=29073
                                                  docbase=0 key.card:1
                                                  res.card=128</div>
                                                <div>02-08 18:18:15.905:
                                                  I/System.out(21945):
                                                  129 found:Johannes’
                                                  openberring 1:1
                                                  docid=30681 docbase=0
                                                  key.card:1
                                                  res.card=129</div>
                                                <div>02-08 18:18:15.915:
                                                  I/System.out(21945):
                                                  130 found:Johannes’
                                                  openberring 1:4
                                                  docid=30684 docbase=0
                                                  key.card:1
                                                  res.card=130</div>
                                                <div>02-08 18:18:15.915:
                                                  I/System.out(21945):
                                                  131 found:Johannes’
                                                  openberring 1:9
                                                  docid=30689 docbase=0
                                                  key.card:1
                                                  res.card=131</div>
                                                <div>02-08 18:18:15.965:
                                                  I/System.out(21945):
                                                  132 found:Johannes’
                                                  openberring 22:8
                                                  docid=31071 docbase=0
                                                  key.card:1
                                                  res.card=1389</div>
                                              </div>
                                              <div><br>
                                              </div>
                                              <div>Other words in Rev 22
                                                seem to have the same
                                                effect e.g. month,
                                                behold, am,... </div>
                                              <div><br>
                                              </div>
                                              <div>The fix for nn was to
                                                change </div>
                                              <div>
                                                <div>   Rev.Short=Op</div>
                                              </div>
                                              <div>to</div>
                                              <div>   Rev.Short=JoOp </div>
                                              <div><br>
                                              </div>
                                              <div>Any idea what is
                                                happening?  I tried to
                                                write a junit on my pc
                                                but couldn't get it to
                                                fail on Windows.</div>
                                              <div><br>
                                              </div>
                                              <div>I am using revision
                                                2195 of JSword, which is
                                                before the AV changes.</div>
                                              <div><br>
                                              </div>
                                              <div>Thanks</div>
                                              <div>Martin</div>
                                              <div><br>
                                                <br>
                                                <div class="gmail_quote">On
                                                  2 February 2012 11:20,
                                                  DM Smith <span
                                                    dir="ltr"><<a
                                                      moz-do-not-send="true"
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
                                                      bgcolor="#FFFFFF">
                                                      <div>I'm trying to
                                                        see what is
                                                        happening. It
                                                        doesn't make
                                                        sense to me
                                                        either. <br>
                                                        <br>
                                                        Cent from my
                                                        fone so theer
                                                        mite be tipos.
                                                        ;)</div>
                                                      <div>
                                                        <div>
                                                          <div><br>
                                                          On Jan 27,
                                                          2012, at 9:44
                                                          AM, Martin
                                                          Denham <<a
moz-do-not-send="true" href="mailto:mjdenham@gmail.com" target="_blank">mjdenham@gmail.com</a>>



                                                          wrote:<br>
                                                          <br>
                                                          </div>
                                                          <blockquote
                                                          type="cite">
                                                          <div>Hi,
                                                          <div> <br>
                                                          </div>
                                                          <div>I have
                                                          received this <a
moz-do-not-send="true"
                                                          href="http://code.google.com/p/and-bible/issues/detail?id=87"
target="_blank">error report for And Bible</a> which has confused me.  I
                                                          would be
                                                          grateful for
                                                          any
                                                          suggestions
                                                          wrt what might
                                                          be happening.</div>
                                                          <div><br>
                                                          </div>
                                                          <div>A simple
                                                          test I have
                                                          tried:</div>
                                                          <div>
                                                          <ul>
                                                          <li>Set locale
                                                          to de or en</li>
                                                          <li>Search for
                                                          'John' in ESV</li>
                                                          <li>Works fine</li>
                                                          <li>Set locale
                                                          to nn (Norsk
                                                          Nynorsk)</li>
                                                          <li>Search for
                                                          'John' in ESV
                                                          </li>
                                                          <li>Every
                                                          verse of John
                                                          is returned in
                                                          the result
                                                          list</li>
                                                          </ul>
                                                          <div>Thanks</div>
                                                          </div>
                                                          <div>Martin<br>
                                                          </div>
                                                          </div>
                                                          </blockquote>
                                                        </div>
                                                      </div>
                                                    </div>
                                                  </blockquote>
                                                </div>
                                              </div>
                                            </blockquote>
                                          </div>
                                        </div>
                                      </div>
                                    </blockquote>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </blockquote>
                        </div>
                      </div>
                    </blockquote>
                    <br>
                    <br>
                    <fieldset></fieldset>
                    <br>
                  </div>
                </div>
                <div>
                  <pre>_______________________________________________
jsword-devel mailing list
<a moz-do-not-send="true" href="mailto:jsword-devel@crosswire.org" target="_blank">jsword-devel@crosswire.org</a>
<a moz-do-not-send="true" href="http://www.crosswire.org/mailman/listinfo/jsword-devel" target="_blank">http://www.crosswire.org/mailman/listinfo/jsword-devel</a>
</pre>
                </div>
              </blockquote>
              <br>
            </div>
            <br>
            _______________________________________________<br>
            jsword-devel mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:jsword-devel@crosswire.org" target="_blank">jsword-devel@crosswire.org</a><br>
            <a moz-do-not-send="true"
              href="http://www.crosswire.org/mailman/listinfo/jsword-devel"
              target="_blank">http://www.crosswire.org/mailman/listinfo/jsword-devel</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
jsword-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:jsword-devel@crosswire.org">jsword-devel@crosswire.org</a>
<a class="moz-txt-link-freetext" href="http://www.crosswire.org/mailman/listinfo/jsword-devel">http://www.crosswire.org/mailman/listinfo/jsword-devel</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>