<div dir="ltr"><div>If you know that you have a reference (e.g. if you&#39;re not looking for references within random blocks of text) then you can use something like our Python bindings to pass strings into it and ask our engine to generate the OSIS id. This is probably the best route to take as our Engine has rather sophisticated code to account for a large range of ways to describe a reference and convert it to and OSIS id. I believe that Peter has written a script to do something like this in the past.</div><div><br></div><div>In short, the process is more complicated than a simple grep or sed regex can be. Some of the OSIS abbreviations are non-obvious and not easy to generate directly from the book name.</div><div><br></div><div>--Greg<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Feb 1, 2020 at 6:39 PM Cyrille &lt;<a href="mailto:lafricain79@gmail.com">lafricain79@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div>
    What are you doing exactly? If you try to convert the ref to osisRef
    Dominique wrote an awk script which works pretty good.<br>
    See the attached file.<br>
    <br>
    <div>Le 01/02/2020 à 18:06, Maxwell Murunga
      a écrit :<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr"><span style="background-color:rgb(255,255,255)"><font face="tahoma, sans-serif" color="#000000">Greetings
            Saints,</font></span>
        <div><font face="tahoma, sans-serif" color="#000000"><span style="background-color:rgb(255,255,255)"><br>
            </span></font>
          <div><font style="background-color:rgb(255,255,255)" face="tahoma, sans-serif" color="#000000">I&#39;m processing
              an OSIS Commentary in InDesign using GREP:<br>
            </font></div>
          <div><font style="background-color:rgb(255,255,255)" face="tahoma, sans-serif" color="#000000"><br>
            </font></div>
          <div><font style="background-color:rgb(255,255,255)" face="monospace" color="#000000"><b>Find: </b>((\d+
              )?(\w+?.? \d+[:]\d+)(.\d+)?([, \d]+(.\d+)?)*)</font></div>
          <div><font style="background-color:rgb(255,255,255)" face="monospace" color="#000000"><b>Replace:</b> &lt;reference
              osisRef=&quot;$1&quot;&gt;$1&lt;/reference&gt;</font></div>
          <div><font style="background-color:rgb(255,255,255)" face="tahoma, sans-serif" color="#000000"><br>
            </font></div>
          <div><font style="background-color:rgb(255,255,255)" face="tahoma, sans-serif" color="#000000">It partially
              accomplishes the task, but does not automatically convert
              the book names to the standard OSIS abbreviations. I also
              need help in figuring out how to add looking for Arabic
              and Roman numerals (1-2 instances of the letter &quot;I&quot;; or
              simply &quot;1&quot; or &quot;2&quot; ) to cover instances of something like I
              Corinthians or II Corinthians; 1 Corinthians or 2
              Corinthians.</font></div>
          <div><font style="background-color:rgb(255,255,255)" face="tahoma, sans-serif" color="#000000"><br>
            </font></div>
          <div><font style="background-color:rgb(255,255,255)" face="tahoma, sans-serif" color="#000000">Could anyone be
              so kind enough as to provide a <b>grep</b> or <b>sed</b>
              script to <span style="font-weight:bold;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">auto</span> convert
              any kind of Bible <span style="font-weight:bold;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">reference</span> into
              this format:<br>
            </font></div>
          <div><font style="background-color:rgb(255,255,255)" face="tahoma, sans-serif" color="#000000"><br>
              &lt;<span style="font-weight:bold;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">reference</span> osisRef=&quot;Gen.1.1&quot;&gt;Genesis
              1:1&lt;/<span style="font-weight:bold;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">reference</span>&gt;<br>
            </font></div>
          <div><font style="background-color:rgb(255,255,255)" face="tahoma, sans-serif" color="#000000">&lt;<span style="font-weight:bold;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">reference</span> osisRef=&quot;2Chr.1.1&quot;&gt;2 Chronicles 1:1&lt;/<span style="font-weight:bold;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">reference</span>&gt;</font></div>
          <div><font style="background-color:rgb(255,255,255)" face="tahoma, sans-serif" color="#000000">&lt;<span style="font-weight:bold;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">reference</span> osisRef=&quot;2Chr.1.1&quot;&gt;II
              Chronicles 1:1&lt;/<span style="font-weight:bold;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">reference</span>&gt;<br>
              <br>
            </font></div>
          <div><font style="background-color:rgb(255,255,255)" face="tahoma, sans-serif" color="#000000">In Christ Alone,<br>
            </font></div>
          <div><font style="background-color:rgb(255,255,255)" face="tahoma, sans-serif" color="#000000"><br>
            </font></div>
          <div><font style="background-color:rgb(255,255,255)" face="tahoma, sans-serif" color="#000000">Maxwell.</font></div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <pre>_______________________________________________
sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org" target="_blank">sword-devel@crosswire.org</a>
<a href="http://www.crosswire.org/mailman/listinfo/sword-devel" target="_blank">http://www.crosswire.org/mailman/listinfo/sword-devel</a>
Instructions to unsubscribe/change your settings at above page</pre>
    </blockquote>
    <br>
  </div>

_______________________________________________<br>
sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org" target="_blank">sword-devel@crosswire.org</a><br>
<a href="http://www.crosswire.org/mailman/listinfo/sword-devel" rel="noreferrer" target="_blank">http://www.crosswire.org/mailman/listinfo/sword-devel</a><br>
Instructions to unsubscribe/change your settings at above page</blockquote></div>