Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

Commit

Permalink
New minor release 4.5.14
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkroorda committed Feb 29, 2016
1 parent 9c9e640 commit df9d65e
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 11 deletions.
Binary file removed dist/laf-fabric-4.5.13.tar.gz
Binary file not shown.
Binary file added dist/laf-fabric-4.5.14.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
project = u'LAF Fabric'
copyright = u'2013, Dirk Roorda'
version = '4.5'
release = '4.5.13'
release = '4.5.14'
exclude_patterns = ['_build']
add_function_parentheses = True
add_module_names = False
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py.bck
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ master_doc = 'index'
project = u'LAF Fabric'
copyright = u'2013, Dirk Roorda'
version = '4.5'
release = '4.5.12'
release = '4.5.13'
exclude_patterns = ['_build']
add_function_parentheses = True
add_module_names = False
Expand Down
36 changes: 30 additions & 6 deletions docs/texts/ETCBC-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,39 +98,51 @@ and say in your load instructions::

'prepare': prepare
Then you can use the following functions::
Then you can use the following functions

.. code-block:: python
T.node_of(book, chapter, verse)
Yields the verse node of the passage specified by `book`, `chapter` and `verse`.
Yields `None` if there is no such verse.::
Yields `None` if there is no such verse.

.. code-block:: python
T.formats()
This yields a dictionary of all formats that the ``T`` API is capable to deliver.
The keys are acronymns for the formats, the values are tuples
``(desc, method)``
where ``desc`` is a short description of the format, and ``method`` is a Python function that delivers that representation given a single word node.:
where ``desc`` is a short description of the format, and ``method`` is a Python function that delivers that representation given a single word node.

.. code-block:: python
T.words(word_nodes, fmt='ha')
Give the plain text belonging to a series of words in format ``fmt``.
Default format is ``ha``, i.e. fully pointed Hebrew Unicode, where ketivs have been replaced by
fully pointed qeres.
The ``word_nodes`` can be any iterable of nodes carrying ``otype = 'word'``.
They do not have to correspond to consecutive words in the bible.:
They do not have to correspond to consecutive words in the bible.

.. code-block:: python
T.verse(book, chapter, verse, fmt='ha', html=True, verse_label=True, format_label=True)
Give the plain text of the indicated verse in format ``fmt``.
You can choose wether to include a verse label (like ``Genesis 3:7``) and a format label
(like ``hebrew accent``).
If ``html`` is ``True`` then the result is formatted as a html table, with the right style characteristics.
You can still tweak the styles a bit, see the function ``T.style()`` later on.:
You can still tweak the styles a bit, see the function ``T.style()`` later on.

.. code-block:: python
T.whole(fmt='ha', verse_labels=False)
Give the plain text of the whole Bible in format ``fmt``.:
Give the plain text of the whole Bible in format ``fmt``.

.. code-block:: python
T.style(params=None, show_params=False)
Expand All @@ -144,6 +156,18 @@ You can also set the widths of the label columns.

You only have to pass the parameters that you want to give a non-default value.

.. code-block:: python
T.books(lang='la')
Lists the books in the ETCBC order but with names according to `lang`.
If `lang` is `la` (latin), the book names are exactly as used in the ETCBC database.

Supported languages:

* en = English
* la = Latin (default).

.. _node_order:

Node order
Expand Down
5 changes: 5 additions & 0 deletions docs/texts/release-notes.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Release Notes
#############
4.5.14
==========
The ETCBC API ``T`` is enriched with a function `books(lang=...)` that delivers the names of the books
in English and Latin.

4.5.13
==========
The text forms generated by ETCBC API ``T`` for consonantal representations, suppress the special final forms of
Expand Down
2 changes: 1 addition & 1 deletion emdros2laf/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import argparse

NAME = 'LAF-Fabric'
VERSION = '4.5.13'
VERSION = '4.5.14'
APIREF = 'http://laf-fabric.readthedocs.org/en/latest/texts/API-reference.html'
DEFAULT_DATA_DIR = 'laf-fabric-data'
MAIN_CFG = 'laf-fabric.cfg'
Expand Down
48 changes: 48 additions & 0 deletions etcbc/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,59 @@ def get_orig_p(w):
('pf', ('phono full', lambda w: get_orig_p(w).replace('*',''))),
('ps', ('phono simple', lambda w: Transcription.ph_simplify(get_orig_p(w)))),
))
self.booknames_en = tuple('''
Genesis
Exodus
Leviticus
Numbers
Deuteronomy
Joshua
Judges
1_Samuel
2_Samuel
1_Kings
2_Kings
Isaiah
Jeremiah
Ezekiel
Hosea
Joel
Amos
Obadiah
Jonah
Micah
Nahum
Habakkuk
Zephaniah
Haggai
Zechariah
Malachi
Psalms
Job
Proverbs
Ruth
Song_of_songs
Ecclesiastes
Lamentations
Esther
Daniel
Ezra
Nehemiah
1_Chronicles
2_Chronicles
'''.strip().split())

def node_of(self, book, chapter, verse): return self._verses.get(book, {}).get(chapter, {}).get(verse, None)

def formats(self): return self._transform

def books(self, lang='la'):
F = self.lafapi.api['F']
if lang == 'la':
return tuple(F.book.v(b) for b in F.otype.s('book'))
elif lang == 'en':
return self.booknames_en

def words(self, wnodes, fmt='ha'):
reps = []
fmt = fmt if fmt in self._transform else 'ha'
Expand Down
2 changes: 1 addition & 1 deletion laf/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .timestamp import Timestamp

NAME = 'LAF-Fabric'
VERSION = '4.5.13'
VERSION = '4.5.14'
APIREF = 'http://laf-fabric.readthedocs.org/en/latest/texts/API-reference.html'
FEATDOC = 'https://shebanq.ancient-data.org/static/docs/featuredoc/texts/welcome.html'
MAIN_CFG = 'laf-fabric.cfg'
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
package_data = {
'emdros2laf': ['templates/*', 'xml/*'],
},
version='4.5.13',
version='4.5.14',
description='''Processor for Linguistic Annotation Framework ISO 24612:2012), applied to Biblical Hebrew''',
author='Dirk Roorda',
author_email='shebanq@ancient-data.org',
Expand Down

0 comments on commit df9d65e

Please sign in to comment.