huc-tapir 0.8.0

Text & Annotation Processor for Indexing Resources
huc-tapir-0.8.0 is not a library.

tapir -h

tapir

Text & Annotation Processor for Indexing Resources

Usage

Usage: tapir [OPTIONS]

Options:
  -i, --input <INPUT>                Input W3C Web Annotation file (in JSONL) [default: stdin]
  -o, --output <OUTPUT>              Output ElasticSearch index file (in JSON) [default: stdout]
  -b, --with-bib-ref <BIB_REFS>      Extract bibliography refs from Reference annotations having, e.g., body.subtype=='BibReference#vangogh'
  -d, --with-div-type <DIV_TYPES>    Extract text from Division with tei:type to a specific text field, e.g., 'original' to 'letterOriginalText'
  -n, --with-note-type <NOTE_TYPES>  Extract text from Note with subtype to a specific text field, e.g., "notes" | "typednotes" | "langnotes" to field letterNotesText"
  -f, --with-field <FIELDS>          Add field to index. Use 'key=value' for custom mapping, or 'key' to use the key as both field name and value
  -s, --sort-field <SORT_FIELDS>     Sort elements in this field, e.g. personId or correspondentLabel
  -p, --pretty                       Pretty print the generated ElasticSearch index file
  -q, --quiet                        Quiet mode
  -w, --workdir <WORKDIR>            Workdir containing extracted text files (in TXT) for <input> [default: ./work]
  -h, --help                         Print help
  -V, --version                      Print version

Example use in Makefile

work/%.index.json: work/%.webannotations.jsonl
	tapir \
		--with-field correspondent=participant \
		--with-field correspondentId=participantId \
		--with-field file=n \
		--with-field location \
		--with-field msId=identifier \
		--with-field period=namedPeriod \
		--with-field recipient \
		--with-field sender \
		--with-field title \
		--with-bib-ref journal=journals \
		--sort-field journals \
		--with-bib-ref vangogh=worksMentioned \
		--sort-field worksMentioned \
		--with-div-type original=letterOriginalText \
		--with-div-type translation=letterTranslatedText \
		--with-div-type about=introText \
		--with-note-type notes=letterNotesText \
		--with-note-type langnotes=letterNotesText \
		--with-note-type typednotes=letterNotesText \
		--sort-field artworkIds,artworksEN \
		--sort-field correspondent,correspondentId \
		--sort-field bibleRefs,bibleRefIds \
		--sort-field personIds,persons \
		--quiet \
		--input $< \
		--output $@