clic.db.book: Fetch/store book dicts to DB

clic.db.book.get_book(cur, book_id_name, content=False, regions=False)

Get book from DB, specifying what details are required

clic.db.book.put_book(cur, book)

Import a book object:

  • name: The shortname of the book
  • content: The full book string, as per instructions in the corpora repository
  • An entry for each rclass, e.g. “chapter.text”: See /schema/10-rclass.sql. A list of… - off_start: Character offset for start of this region - off_end: Character offset for end of this region, non-inclusive - rvalue: rvalue, e.g. chapter number (see /schema/10-rclass.sql)

The book contents / regions will be imported into the database, and any “chapter.text” region will be tokenised.