Skip to content
mtdunstan edited this page Aug 3, 2020 · 4 revisions

ami section

Splits a CTree fulltext.xml into sections dictated by the markup (e.g. JATS-XML)

picocli help:

ami section --help
Usage: ami section [OPTIONS]
Splits all divisions in XML files into sections <using XPath.
`front` and `back` uses JATS markup; `body` uses HTML. Main elements are `div` and `p`. Titles are heuristic: `@class`,
`./<title>` `@id` are all used. Sometimes leading bold sentences  or phrases can be used.Creates names from titles of
sections (or 'elem<num>.xml' if cannot)
optionally writes HTML (slow) using specified stylesheet
examples:
    --sections ALL --html nlm2html
         //not sure this works    --sections ABSTRACT ACK_FUND --write false

    --forcemake --extract table fig --summary figure table         // this seems to create sections OK, use this?

Wiki Documentation: https://github.com/petermr/ami3/wiki/ami-section

Options
=======
      --boldsections      convert paras with bold first sentence/phrase into subsections.
                          e.g. <sec id='s2.1'><p><bold>Extraction of Oils.</bold>. more text...</p></sec>
                          =>  <sec id='s2.1'><sec id='s2.1.1'><title>Extraction of Oils.</title>. <p>more text...
                            </p></sec>

      --extract=<extractList>
                          extract float elements to subdirectory,default table, fig, supplementary)
                            Default: [table, fig, supplementary]
  -h, --help              Show this help message and exit.
      --html=<xsltName>   convert sections to HTML using stylesheet (convention as in --transform). recommend:
                            nlm2html; if omitted defaults to no HTML currently 201909 very slow since XSLT seems to be
                            slow,  seems to be size related (references can take 1 sec)
      --hypertree=<String=String>
                          create hypertree from
                            Default: {}
      --sections=<sectionTagList>...
                          sections to extract (uses JATSSectionTagger)
                          if none, lists Tagger tags
                          ALL selects all tags in Tagger
                          AUTO creates hierchical tree based on JATS and heuristics (default)
                          ,
                            Default: [AUTO]
      --sectiontype=<sectionType>
                          Type of section (XML or HTML) default XML. Probably only used in development
                            Default: XML
      --summary=<summaryList>...
                          create summary files for sections (all, fig, results, supplementary, table)
                            Default: []
  -V, --version           Print version information and exit.
      --write             write section files (may be customised later);

Issues:

When I run the recommended command in the help, it doesn't work (I am trying to replicate what has already been done in ami3/target/battery10):

ami -p liion section --forcemake --extract table fig --summary figure table
Expected parameter for option '--extract' but found 'table'
Usage: ami section [OPTIONS]```
Try 'ami section --help' for more information.
Clone this wiki locally