[sword-devel] abbreviations.sh (was: Re: linking / testsuite )

Jonathan Marsden jmarsden at fastmail.fm
Wed Apr 22 22:42:04 MST 2009


Earlier, in response to Ben, I wrote:

> If I have time later tonight, once I have a sword 1.6.0RC2 package out
> for front end developers to test with, I'll see about creating the 198
> item single locale test and (if I succeed!) I'll contribute it to the
> SWORD codebase, just to demonstrate that creating such a test really is
> in fact doable :)

Here is abbreviations.sh.  I got an initial set of abbreviations from
the OSIS User Manual, by cut and paste, and then added (usually) two
more per book, that I just made up.

In the process of creating and testing it under 1.6.0RC2 I found a
surprises.  It may really be a bug, demonstrating to Ben and the team
the value of this kind of very simple regression test script... or it
may just reflect my lack of understanding of the intent and workings of
the SWORD library.

parsekey 1Ki   does not display I Kings, but I Samuel.  Likewise for 2Ki
and II Samuel.  Similar behavior is seen for 1Kin, 2Kin, 1King and
2King.  Intuitively, this feels incorrect to me.  As some mild degree of
justification for this, I offer:

  http://www.biblegateway.com/passage/?search=1Ki

which does what I would expect -- it displays I Kings.

(A test tool that compares the results of lookups on biblegateway.com
and using SWORD might be an interesting thing for someone to create, BTW!).

Observations: There are more abbreviations which I would like to work,
but which don't seem to, such as Gn for Genesis, SoS for Song of
Solomon, but I have no real idea if these are "legitimate"
abbreviations.  I do not claim to be a domain expert on abbreviations :)
 I am fairly confident that 1Ki *is* an abbreviation for I Kings that I
have seen and used before, not just on biblegateway.com.

Here is the (very simple!) script.  I've assigned copyright to
CrossWire.  It's a trivial for loop plus a list of abbreviations.  I can
 create a Jira item for it, and attach the script and a .good file for
it, if that would be preferred.

Jonathan


#!/bin/sh

#******************************************************************************

#

# $Id:$

#

# Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)

#       CrossWire Bible Society

#       P. O. Box 2528

#       Tempe, AZ  85280-2528

#

# This program is free software; you can redistribute it and/or modify
it
# under the terms of the GNU General Public License as published by the

# Free Software Foundation version 2.

#

# This program is distributed in the hope that it will be useful, but

# WITHOUT ANY WARRANTY; without even the implied warranty of

# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU

# General Public License for more details.

#

en_abbrevs="

Gen Genes Exod Ex Exo Lev Le Levi Num Nu Numb Deut Deu De Josh Jos Joshu

Judg Jdg Judge Ruth Ru Rut 1Sam 1Sa 1Samu 2Sam 2Sa 2Samu 1Kgs 1Ki 1King

2Kgs 2Ki 2King 1Chr 1Chron 1Ch 2Chr 2Chron 2Ch Ezra Ez Ezr Neh Ne Nehe

Esth Es Est Job Job  Ps Psa Psalm Prov Pr Pro Eccl Ec Ecc Song So Son
Isa Is Isai Jer Jere Je Lam La Lament Ezek Ez Eze Dan Dan Da Hos Hos
Hose Joel Joe Amos Am Amo Obad Ob Oba Jonah Jon Jona Mic Mi Mica Nah Na
Nahu Hab Haba Ha Zeph Ze Zep Hag Hagg Zech Ze Zecha Mal Mala



Matt Mt Mat Mark Mar Ma Luke Lk Luk John Joh Jn Acts Ac A Rom Ro Roma

1Cor 1Co 1Cori 2Cor 2Co 2Cori Gal Ga Gala Eph Ep Ephes Phil Phili Philip

Col Co Colo 1Thess 1Th 1Thes 2Thess 2Th 2Thes 1Tim 1Ti 1Timo
2Tim 2Ti 2Timo Titus Tit Titu Phlm Phi Phile Heb Hebrews Hebr
Jas James Jam 1Pet 1Pe 1Pete 2Pet 2Pe 2Pete 1John 1Jn 1J
2John 2Jn 2J 3John 3Jn 3J Jude Jud Ju Rev Re Reve
"
for i in $en_abbrevs
do
  ../parsekey $i en_US.UTF-8
done





More information about the sword-devel mailing list