summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--versification/v11n_subsets.py34
-rwxr-xr-xversification/v11nmax.py2
2 files changed, 35 insertions, 1 deletions
diff --git a/versification/v11n_subsets.py b/versification/v11n_subsets.py
new file mode 100644
index 0000000..c3fc507
--- /dev/null
+++ b/versification/v11n_subsets.py
@@ -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)
diff --git a/versification/v11nmax.py b/versification/v11nmax.py
index 74b48ec..99b2e20 100755
--- a/versification/v11nmax.py
+++ b/versification/v11nmax.py
@@ -13,7 +13,7 @@ if len(sys.argv) < 3:
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