summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Little <chrislit@crosswire.org>2013-08-02 13:10:47 +0000
committerChris Little <chrislit@crosswire.org>2013-08-02 13:10:47 +0000
commit7d28a0edb1ee2640fff6082e75a6fb35ce8561d9 (patch)
treecc268afb786a14921166e8f9f5370600d473f742
parenta427dd77c27c268851c8c49fc2ede4578a9f5e90 (diff)
downloadsword-tools-7d28a0edb1ee2640fff6082e75a6fb35ce8561d9.tar.gz
added new v11n analysis tool
git-svn-id: https://www.crosswire.org/svn/sword-tools/trunk@467 07627401-56e2-0310-80f4-f8cd0041bdcd
-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