Rules definition file ===================== In this section describes the xml file that contains struct with regular expression patterns and definition of these, to automatic tagging of journals. * `Main struct`_ * `Journal element struct`_ Main struct ----------- The main element is ```` that contains one or more ```` elements to define rules (regular expressions patterns) .. code-block:: xml :linenos: /* * */ ... ... ... ... Journal element struct ---------------------- .. code-block:: xml :linenos: ... /* * * */ /* * */ Journal name /* * */ other /* * */ (...+) /* * */ /* * * */ /* * */ /* * */ /* * */ /* * */ /* * */ /* * */ (...+) /* /* * */ ... * */ /* * */ ... * **journal** .- This element requires attribute issn to identify each of these in XML file. .. code-block:: xml :linenos: ... ... ... * **name** .- The element contains the canonical name of journal .. code-block:: xml :linenos: ... Archivos de cardiologĂ­a de MĂ©xico ... * **norm** .- In this element is specified "norm" of references in journal (other, apa, vancouv, iso690) .. code-block:: xml :linenos: ... other ... * **regex** .- This contains an regular expression pattern to tag reference. .. code-block:: xml :linenos: ... (....+) ... * **struct** .- In this node appear all tags to markup reference or group in regular expression pattern. * **tagname** .- This is a generic name to this element, really can take all tag names in the norm (other, apa, vancouv, iso690) or generic name if assumes this is only a container. If this tag need appear in tagging is required put attribute **tag="true"** like: .. code-block:: xml :linenos: ... ... ... * **tagname** .- You can put hierarchy of tags contains inner tags .. code-block:: xml :linenos: ... ... ... * **attr** .- This element contains attributes of tag if require put default value in these. * **attrname** .- Is a generic name to element, this take name of attributes of tag like [oauthor **role="nd"**] is represented: .. code-block:: xml :linenos: ... nd ... ... * **prevalue** .- Contains backreference of group in regular expression pattern and print the value before tag. * **value** .- Contains backreference of group in regular expression pattern and print the value in middle of tag. * **postvalue** .- Contains backreference of group in regular expression pattern and print the value after tag. .. code-block:: xml :linenos: ... /* * Example string and regex * ...; Castillo, G. F.; ... * (.+?;\s)(Castillo, G. F.)(;\s.+) * Group 1: ...; * Group 2: Castillo, G. F. * Group 3: ; ... */ ... $1 $2 $3 ... /* * Result * ...; [oauthor]Castillo, G. F.[/oauthor]; ... */ * **regex** .- This element used when value of tag contains child tags, if this tag is used you need put **struct** element and inner tags .. code-block:: xml :linenos: ... /* * Example string and regex * ...; Castillo, G. F.; ... * (.+?;\s)(Castillo, G. F.)(;\s.+) * Group 2: Castillo, G. F. * Group 2 contains surname and fname and can parse with this regex * (Castillo)(,\s)(G\.\sF\.) */ ... $1 $2 (Castillo)(,\s)(G\.\sF\.) $1 $2 $3 $3 ... /* * Result * ...; [oauthor][surname]Castillo[/surname], [fname]G. F.[/fname][/oauthor]; ... */ * **multiple** .- In case the value element can parsed by more than one regular expression, use this element and put each pattern in sub element **option** * **option** .- This element contains each **regex** pattern and **struct** of these. .. code-block:: xml :linenos: ... /* * Example strings and regex * ...; Castillo, G. F.; ... * ...; G. F., Castillo; ... * (.+?;\s)(.+?)(;\s.+) * Group 2: Castillo, G. F. * Group 2: G. F., Castillo * Group 2 can parsed with these regex * (Castillo)(,\s)(G\.\sF\.) * (G\.\sF\.)(,\s)(Castillo) */ ... $1 $2 $3 ... /* * Results * ...; [oauthor][surname]Castillo[/surname], [fname]G. F.[/fname][/oauthor]; ... * ...; [oauthor][surname]G. F.[/surname], [fname]Castillo[/fname][/oauthor]; ... */