<aname="L2"></a><ttclass="py-lineno"> 2</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># This file is part of pybliographer</tt></tt>
<aname="L7"></a><ttclass="py-lineno"> 7</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># This program is free software; you can redistribute it and/or</tt></tt>
<aname="L8"></a><ttclass="py-lineno"> 8</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># modify it under the terms of the GNU General Public License</tt></tt>
<aname="L9"></a><ttclass="py-lineno"> 9</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># as published by the Free Software Foundation; either version 2 </tt></tt>
<aname="L10"></a><ttclass="py-lineno"> 10</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># of the License, or (at your option) any later version.</tt></tt>
<aname="L12"></a><ttclass="py-lineno"> 12</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># This program is distributed in the hope that it will be useful,</tt></tt>
<aname="L13"></a><ttclass="py-lineno"> 13</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># but WITHOUT ANY WARRANTY; without even the implied warranty of</tt></tt>
<aname="L14"></a><ttclass="py-lineno"> 14</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</tt></tt>
<aname="L15"></a><ttclass="py-lineno"> 15</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># GNU General Public License for more details. </tt></tt>
<aname="L17"></a><ttclass="py-lineno"> 17</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># You should have received a copy of the GNU General Public License</tt></tt>
<aname="L18"></a><ttclass="py-lineno"> 18</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># along with this program; if not, write to the Free Software</tt></tt>
<aname="L19"></a><ttclass="py-lineno"> 19</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.</tt></tt>
</div><divid="Reader-collapsed"style="display:none;"pad="+++"indent="++++"></div><divid="Reader-expanded"><aname="L71"></a><ttclass="py-lineno"> 71</tt><ttclass="py-line"><ttclass="py-comment"># The official channel in which messages must be sent</tt></tt>
</div><divid="Reader.person_add-collapsed"style="display:none;"pad="+++"indent="++++++++"></div><divid="Reader.person_add-expanded"><aname="L106"></a><ttclass="py-lineno">106</tt><ttclass="py-line"><ttclass="py-docstring">''' Parse a stream of tokens as a series of person names '''</tt></tt>
<aname="L108"></a><ttclass="py-lineno">108</tt><ttclass="py-line"><ttclass="py-comment"># The first level of the parsing is of interest, as non-person</tt></tt>
<aname="L109"></a><ttclass="py-lineno">109</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># names can be written for instance:</tt></tt>
<aname="L110"></a><ttclass="py-lineno">110</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># author = "{Name of a Company} and {Another One}"</tt></tt>
<aname="L115"></a><ttclass="py-lineno">115</tt><ttclass="py-line"><ttclass="py-comment"># ...and expand the low-level text in fragment split on "," "." and space</tt></tt>
<aname="L135"></a><ttclass="py-lineno">135</tt><ttclass="py-line"><ttclass="py-comment"># These high-level groups are separated by 'and' keywords</tt></tt>
<aname="L155"></a><ttclass="py-lineno">155</tt><ttclass="py-line"><ttclass="py-comment"># Ensure the stream is a sequence of complete words (ie,</tt></tt>
<aname="L156"></a><ttclass="py-lineno">156</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># concatenate successive text parts and space parts). The</tt></tt>
<aname="L157"></a><ttclass="py-lineno">157</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># comma must remain on its own, as it serves as a separator.</tt></tt>
<aname="L158"></a><ttclass="py-lineno">158</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># The dot is always appended to the previous word.</tt></tt>
<aname="L192"></a><ttclass="py-lineno">192</tt><ttclass="py-line"><ttclass="py-docstring">""" For each element of the string, return a list that</tt></tt>
<aname="L193"></a><ttclass="py-lineno">193</tt><ttclass="py-line"><ttclass="py-docstring"> indicates if the corresponding element is :</tt></tt>
<aname="L194"></a><ttclass="py-lineno">194</tt><ttclass="py-line"><ttclass="py-docstring"> - I : an initial</tt></tt>
<aname="L195"></a><ttclass="py-lineno">195</tt><ttclass="py-line"><ttclass="py-docstring"> - L : a lower case word</tt></tt>
<aname="L196"></a><ttclass="py-lineno">196</tt><ttclass="py-line"><ttclass="py-docstring"> - N : a name</tt></tt>
<aname="L257"></a><ttclass="py-lineno">257</tt><ttclass="py-line"><ttclass="py-comment"># As a fallback, consider that the last name is the last component</tt></tt>
<aname="L263"></a><ttclass="py-lineno">263</tt><ttclass="py-line"><ttclass="py-comment"># Handle the case of a final . after the author's name</tt></tt>
</div><divid="Reader.comment_add-collapsed"style="display:none;"pad="+++"indent="++++++++"></div><divid="Reader.comment_add-expanded"><aname="L290"></a><ttclass="py-lineno">290</tt><ttclass="py-line"><ttclass="py-comment"># by default, we drop comments</tt></tt>
</div><divid="Reader.string_add-collapsed"style="display:none;"pad="+++"indent="++++++++"></div><divid="Reader.string_add-expanded"><aname="L294"></a><ttclass="py-lineno">294</tt><ttclass="py-line"><ttclass="py-comment"># by default, we drop strings</tt></tt>
</div><divid="Reader.preamble_add-collapsed"style="display:none;"pad="+++"indent="++++++++"></div><divid="Reader.preamble_add-expanded"><aname="L298"></a><ttclass="py-lineno">298</tt><ttclass="py-line"><ttclass="py-comment"># by default, we drop the preamble</tt></tt>
</div><divid="Reader.type_add-collapsed"style="display:none;"pad="+++"indent="++++++++"></div><divid="Reader.type_add-expanded"><aname="L302"></a><ttclass="py-lineno">302</tt><ttclass="py-line"><ttclass="py-comment"># by default, we drop the document type informatio</tt></tt>
</div><divid="Reader.record_dispatch-collapsed"style="display:none;"pad="+++"indent="++++++++"></div><divid="Reader.record_dispatch-expanded"><aname="L317"></a><ttclass="py-lineno">317</tt><ttclass="py-line"><ttclass="py-comment"># Dispatch by name, on do_<fieldname> methods</tt></tt>
<aname="L350"></a><ttclass="py-lineno">350</tt><ttclass="py-line"><ttclass="py-comment"># Add the document type at the end, as it might have been</tt></tt>
<aname="L351"></a><ttclass="py-lineno">351</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># modified during parsing.</tt></tt>
<aname="L392"></a><ttclass="py-lineno">392</tt><ttclass="py-line"><ttclass="py-comment"># The official channel in which messages must be sent</tt></tt>
<aname="L420"></a><ttclass="py-lineno">420</tt><ttclass="py-line"><ttclass="py-comment"># Use the 'C' name by default, as it is easier to parse</tt></tt>
<aname="L436"></a><ttclass="py-lineno">436</tt><ttclass="py-line"><ttclass="py-comment"># by default, new lines and multiple spaces are not significant in bibtex fields</tt></tt>
<aname="L444"></a><ttclass="py-lineno">444</tt><ttclass="py-line"><ttclass="py-comment"># by default, new lines and multiple spaces are not significant in bibtex fields</tt></tt>
<aname="L447"></a><ttclass="py-lineno">447</tt><ttclass="py-line"><ttclass="py-comment"># If the text contains capitals that are not at the beginning</tt></tt>
<aname="L448"></a><ttclass="py-lineno">448</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># of a sentence, protect these capitals. Similarly for</tt></tt>
<aname="L449"></a><ttclass="py-lineno">449</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># lowercase letters at the beginning.</tt></tt>
<aname="L535"></a><ttclass="py-lineno">535</tt><ttclass="py-line"><ttclass="py-name">v</tt><ttclass="py-op">=</tt><ttclass="py-string">' and '</tt><ttclass="py-op">.</tt><ttid="link-253"class="py-name"><atitle="Pyblio.Format.DSL.join
<aname="L575"></a><ttclass="py-lineno">575</tt><ttclass="py-line"><ttclass="py-docstring">""" Write a result set to a given file descriptor """</tt></tt>
<aname="L604"></a><ttclass="py-lineno">604</tt><ttclass="py-line"><ttclass="py-comment"># Fully support the (bad) case where there is no key in</tt></tt>
<aname="L605"></a><ttclass="py-lineno">605</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># the record, in order to support bad behaved applications</tt></tt>
<aname="L606"></a><ttclass="py-lineno">606</tt><ttclass="py-line"><ttclass="py-comment"></tt><ttclass="py-comment"># that use it.</tt></tt>