[sword-svn] r467 - trunk/versification

chrislit at crosswire.org chrislit at crosswire.org
Fri Aug 2 06:10:48 MST 2013


Author: chrislit
Date: 2013-08-02 06:10:47 -0700 (Fri, 02 Aug 2013)
New Revision: 467

Added:
   trunk/versification/v11n_subsets.py
Modified:
   trunk/versification/v11nmax.py
Log:
added new v11n analysis tool

Added: trunk/versification/v11n_subsets.py
===================================================================
--- trunk/versification/v11n_subsets.py	                        (rev 0)
+++ trunk/versification/v11n_subsets.py	2013-08-02 13:10:47 UTC (rev 467)
@@ -0,0 +1,34 @@
+#!/usr/bin/env python
+
+import re, sys, os
+
+if len(sys.argv) < 3:
+    print 'Usage: ' + sys.argv[0] + ' <v11n name> <canon.h-style file(s)>'
+    print
+    print 'This script relies on v11nmax.py being present in the same location.'
+    print
+    print 'This utility takes a number of canon_*.h-style v11n definitions and'
+    print '  generates canon.h-style files for each input file combining all'
+    print '  of the verses from every file /other than/ the file in question.'
+    print
+    print 'This is used (via a diff program) to discover when a high maximum'
+    print '  verse count is contributed by a single input v11n table.'
+    print
+    print 'For example, to create the versification system "Max" from the'
+    print '  files contained in the directory ./canon, you might invoke:'
+    print '      ' + sys.argv[0] + ' Max ./canon/canon*.h'
+    print
+    exit()
+
+v11n = sys.argv[1]
+files = set(sys.argv[2:])
+
+os.system('python ./v11nmax.py ' + ' '.join(sys.argv[1:]))
+
+for f in files:
+    of = re.sub(r'^.+/', '', f)
+    of = re.sub(r'^canon_?', '', of)
+    of = re.sub(r'.h$', '', of)
+    of = sys.argv[1]+'-'+of
+    cl = 'python ./v11nmax.py ' + of + ' ' + ' '.join(files-set([f]))
+    os.system(cl)


Property changes on: trunk/versification/v11n_subsets.py
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Modified: trunk/versification/v11nmax.py
===================================================================
--- trunk/versification/v11nmax.py	2013-08-02 10:49:56 UTC (rev 466)
+++ trunk/versification/v11nmax.py	2013-08-02 13:10:47 UTC (rev 467)
@@ -13,7 +13,7 @@
     print '  constituent v11ns. Book order is determined by the order in which'
     print '  the script encounters each Bible book.'
     print
-    print 'For example, want to create the versification system "Max" from the'
+    print 'For example, to create the versification system "Max" from the'
     print '  files contained in the directory ./canon, you might invoke:'
     print '      ' + sys.argv[0] + ' Max ./canon/canon*.h'
     print




More information about the sword-cvs mailing list