home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume22 / bibleref / patch01 / 1.0-1.1
Encoding:
Text File  |  1991-08-17  |  24.1 KB  |  688 lines

  1. *** bibleref-1.0/Makefile.dist    Sun Jul 14 14:07:58 1991
  2. --- bibleref-new/Makefile.dist    Wed Jul 17 03:10:13 1991
  3. ***************
  4. *** 25,31 ****
  5.   # Name of your icon compiler and compiler flags.
  6.   #
  7.   ICONC = /usr/icon/v8/bin/icont
  8. ! IFLAGS = -Sc 200 -Sg 400 -Si 2000 -Sn 3000 -SF 30
  9.   
  10.   #
  11.   # Names of KJV files as packaged in the PC-SIG disk set (19 discs).
  12. --- 25,31 ----
  13.   # Name of your icon compiler and compiler flags.
  14.   #
  15.   ICONC = /usr/icon/v8/bin/icont
  16. ! IFLAGS = -Sc 400 -Sg 400 -Si 2000 -Sn 3000 -SF 30
  17.   
  18.   #
  19.   # Names of KJV files as packaged in the PC-SIG disk set (19 discs).
  20. ***************
  21. *** 51,56 ****
  22. --- 51,67 ----
  23.   # RAWFILES = ./kjv.Z
  24.   
  25.   #
  26. + # If, instead of the KJV, you have a CCAT RSV text, you can concatenate
  27. + # all the books for that text into one "kjv.rtv" file.  When done doing
  28. + # this, go to the "non-modifiable" section of this makefile, and change
  29. + # the line reading "CONVERTER = kjv2rtv" to "CONVERTER = rsv2rtv".  I
  30. + # personally have never tried doing this, and have no idea whether it
  31. + # will work.  The converter, rsv2rtv, though is included in this dis-
  32. + # tribution on a test basis.  If anyone tries to use it, please let me
  33. + # know (for better or worse).
  34. + #
  35. + #
  36.   # If you've compressed your KJV file(s), use zcat; otherwise use cat.
  37.   #
  38.   CAT = cat
  39. ***************
  40. *** 65,76 ****
  41.   
  42.   ###########################################################################
  43.   #
  44. ! #  Don't change anything below this line.
  45.   #
  46.   
  47.   RTVFILE = kjv.rtv
  48.   
  49.   CONVERTER = kjv2rtv
  50.   CONVERTSRC = $(CONVERTER).icn convertr.icn name2num.icn complete.icn
  51.   
  52.   INDEXER = makeind
  53. --- 76,89 ----
  54.   
  55.   ###########################################################################
  56.   #
  57. ! #  Don't change anything below this line unless you are absolutely and
  58. ! #  positively sure you know what you are doing.
  59.   #
  60.   
  61.   RTVFILE = kjv.rtv
  62.   
  63.   CONVERTER = kjv2rtv
  64. + # CONVERTER = rsv2rtv
  65.   CONVERTSRC = $(CONVERTER).icn convertr.icn name2num.icn complete.icn
  66.   
  67.   INDEXER = makeind
  68. *** bibleref-1.0/README    Sun Jul 14 14:07:58 1991
  69. --- bibleref-new/README    Wed Jul 17 03:10:14 1991
  70. ***************
  71. *** 71,77 ****
  72.   your login ID and default group ID).  Finally, check to be certain
  73.   that the correct names are used for your raw King James Bible file(s),
  74.   and that the target CAT is set to either "cat" or "zcat," depending on
  75. ! whether you have compressed the raw files or not.
  76.       Assuming you've modified the Makefile correctly, you can then
  77.   simply type "make."  After this, you might as well go off and have
  78.   dinner or something.  Better yet, go to bed.  The entire reformatting,
  79. --- 71,83 ----
  80.   your login ID and default group ID).  Finally, check to be certain
  81.   that the correct names are used for your raw King James Bible file(s),
  82.   and that the target CAT is set to either "cat" or "zcat," depending on
  83. ! whether you have compressed the raw files or not.  Note that you need
  84. ! not use all the KJV files.  Christians, for instance, will frequently
  85. ! want to comment out the Old Testament books, while Jews will normally
  86. ! want to do the reverse.  Bibleref doesn't care how many, or what KJV
  87. ! books, there are.  It doesn't really even care about the order (though
  88. ! for human readers' sake it's advisable to put them in some coherent,
  89. ! canonical order).
  90.       Assuming you've modified the Makefile correctly, you can then
  91.   simply type "make."  After this, you might as well go off and have
  92.   dinner or something.  Better yet, go to bed.  The entire reformatting,
  93. ***************
  94. *** 256,269 ****
  95.   these utilities are *not* geared solely for the KJV.  In fact, they
  96.   are set up so that they can be used with just about any text broken up
  97.   into hierarchically arranged divisions.  If, for instance, you don't
  98. ! like Renaissance English, and have a more modern Bible translation
  99. ! online, you can certainly use that instead.  All you'll need to do is
  100. ! copy the kjv2rtv.icn file to, say, kjv2rsv.icn, edit it to reflect the
  101. ! text you are using, run it on your text, and then index it as you
  102. ! would have done for the King James text.  You can tell Bibleref to use
  103. ! this text instead of the King James text either by modifying
  104. ! bibleref.icn to point to the new file, or by giving it a filename
  105. ! argument, a la "bibleref -f your.indexed.bible.text."
  106.       If you need help integrating a new biblical text into the
  107.   retrieve package, drop me a line.  If I'm not busy, and the job looks
  108.   to be one I can help you out with, I'll be glad to do so.  If nothing
  109. --- 262,277 ----
  110.   these utilities are *not* geared solely for the KJV.  In fact, they
  111.   are set up so that they can be used with just about any text broken up
  112.   into hierarchically arranged divisions.  If, for instance, you don't
  113. ! like Renaissance English, and have the more modern RSV translation
  114. ! online, you can certainly use that instead.  Actually, those of you
  115. ! who possess CCAT RSV texts could do me the great favor of playing
  116. ! guinea pig.  Read the makefile, do what it says with the CONVERTB
  117. ! target, then make.  If you have already indexed some other files, then
  118. ! you should clobber them (a la "make clobber"), and start over again.
  119. ! If you manage to index the RSV, please let me know.  I haven't got the
  120. ! disk space here to do it.  The whole procedure with RSV texts is
  121. ! wholly untested, and I fully expect it to blow up on anyone who tries
  122. ! it :-) 1/2.
  123.       If you need help integrating a new biblical text into the
  124.   retrieve package, drop me a line.  If I'm not busy, and the job looks
  125.   to be one I can help you out with, I'll be glad to do so.  If nothing
  126. ***************
  127. *** 275,293 ****
  128.   tested, or 3) that are likely to change.  For instance, the "d"
  129.   command can take a number argument, which causes it to display the
  130.   list whose position in the global list of lists corresponds to that
  131. ! number).  The "!" command can also pass its arguments to the shell
  132. ! (/bin/sh, or the value of your SHELL environment variable).  Also, if
  133. ! you type "f lord god" at the main prompt, and press return, you'll get
  134. ! a list of verses containing the words "lord" and "god" (i.e. Bibleref
  135. ! will, in other words, perform a verse-based, range 0 "and" on the
  136. ! respective hit lists for these two words).  While I don't want to hide
  137. ! the existence of these marginal features, I don't want to encourage
  138. ! anyone to expect their presence in later versions, or to suggest that
  139. ! they will work properly in the current one.  I'm particularly worried
  140. ! about the "f lord god" example above, as it might lead people to think
  141. ! that Bibleref has a concept of word order within verses.  In fact,
  142. ! this is just an alternate way of performing a set intersection on the
  143. ! hit lists for "lord" and "god."
  144.   
  145.   
  146.   --------
  147. --- 283,301 ----
  148.   tested, or 3) that are likely to change.  For instance, the "d"
  149.   command can take a number argument, which causes it to display the
  150.   list whose position in the global list of lists corresponds to that
  151. ! number).  On the top level, the "!" command can also pass arguments to
  152. ! a shell (/bin/sh, or the value of your SHELL environment variable).
  153. ! Also, if you type "f lord god" at the main prompt, and press return,
  154. ! you'll get a list of verses containing the words "lord" and "god"
  155. ! (i.e. Bibleref will, in other words, perform a verse-based, range 0
  156. ! "and" on the respective hit lists for these two words).  While I don't
  157. ! want to hide the existence of these marginal features, I don't want to
  158. ! encourage anyone to expect their presence in later versions, or to
  159. ! suggest that they will work properly in the current one.  I'm
  160. ! particularly worried about the "f lord god" example above, as it might
  161. ! lead people to think that Bibleref has a concept of word order within
  162. ! verses.  In fact, this is just an alternate way of performing a set
  163. ! intersection on the hit lists for "lord" and "god."
  164.   
  165.   
  166.   --------
  167. *** bibleref-1.0/README.rtv    Sun Jul 14 14:07:58 1991
  168. --- bibleref-new/README.rtv    Wed Jul 17 03:10:15 1991
  169. ***************
  170. *** 167,188 ****
  171.   the King James Version (KJV).  How might you invoke makeind to
  172.   accomplish this?  First you would need to determine the maximum field
  173.   value for your text.  In the case of the Christian English Bible, this
  174. ! is 176.  The English Bible (including Apocrypha) contains 73 books.
  175. ! The Protestant KJV contains 66.  The maximum number of chapters in any
  176. ! book is 150 (Psalms).  The maximum number of verses in any one chapter
  177. ! in any one book is 176 (Psalm 119).  176 would therefore be the
  178. ! maximum value any field would have to contain.  You would pass this
  179. ! information to makeind via the -m option.  The total number of fields
  180. ! is three, naturally (book, chapter, and verse).  This value would be
  181. ! passed using the -n option.  As noted above, in order to use relative
  182. ! locations you would need to tell makeind what field to record max
  183. ! values for.  In our hypothesized scenario, you would want makeind to
  184. ! store the max value for the verse field for every chapter of every
  185. ! book in the Bible.  The verse field (field #3), in other words, is
  186. ! your "rollover" field, and would be passed to makeind using the -l
  187. ! option.  Assuming "kjv" to be the name of your indexable biblical
  188. ! text, this set of circumstances would imply the following invocation
  189. ! for makeind:
  190.   
  191.       makeind -f kjv -m 176 -n 3 -l 3
  192.   
  193. --- 167,188 ----
  194.   the King James Version (KJV).  How might you invoke makeind to
  195.   accomplish this?  First you would need to determine the maximum field
  196.   value for your text.  In the case of the Christian English Bible, this
  197. ! is 176.  The English Bible (including Apocrypha) contains 84 books (at
  198. ! least in the RSV).  The Protestant KJV contains 66.  The maximum
  199. ! number of chapters in any book is 150 (Psalms).  The maximum number of
  200. ! verses in any one chapter in any one book is 176 (Psalm 119).  176
  201. ! would therefore be the maximum value any field would have to contain.
  202. ! You would pass this information to makeind via the -m option.  The
  203. ! total number of fields is three, naturally (book, chapter, and verse).
  204. ! This value would be passed using the -n option.  As noted above, in
  205. ! order to use relative locations you would need to tell makeind what
  206. ! field to record max values for.  In our hypothesized scenario, you
  207. ! would want makeind to store the max value for the verse field for
  208. ! every chapter of every book in the Bible.  The verse field (field #3),
  209. ! in other words, is your "rollover" field, and would be passed to
  210. ! makeind using the -l option.  Assuming "kjv" to be the name of your
  211. ! indexable biblical text, this set of circumstances would imply the
  212. ! following invocation for makeind:
  213.   
  214.       makeind -f kjv -m 176 -n 3 -l 3
  215.   
  216. *** bibleref-1.0/bibleref.src    Sun Jul 14 14:07:59 1991
  217. --- bibleref-new/bibleref.src    Wed Jul 17 03:09:52 1991
  218. ***************
  219. *** 6,12 ****
  220.   #
  221.   #    Author:     Richard L. Goerwitz
  222.   #
  223. ! #    Version: 1.18
  224.   #
  225.   ############################################################################
  226.   #
  227. --- 6,12 ----
  228.   #
  229.   #    Author:     Richard L. Goerwitz
  230.   #
  231. ! #    Version: 1.19
  232.   #
  233.   ############################################################################
  234.   #
  235. ***************
  236. *** 133,141 ****
  237.       fail
  238.       }
  239.   
  240. !     msg := "\"Bibleref\" - a King James Bible browser _
  241. !            by Richard Goerwitz"
  242. !     short_message := "\"Bibleref,\" by Richard Goerwitz"
  243.   
  244.       clear()
  245.       status_line(msg, short_message, "c") &
  246. --- 133,140 ----
  247.       fail
  248.       }
  249.   
  250. !     msg := "\"Bibleref\" - a Bible browser by Richard Goerwitz"
  251. !     short_message := "\"Bibleref,\" by RG"
  252.   
  253.       clear()
  254.       status_line(msg, short_message, "c") &
  255. ***************
  256. *** 191,197 ****
  257.       #
  258.       local capname
  259.   
  260. !     every capname := ("li","co","ce","so") do {
  261.       getval(capname) | {
  262.           quit("check_features",
  263.            "terminal lacks "||capname||" capability", 2)
  264. --- 190,196 ----
  265.       #
  266.       local capname
  267.   
  268. !     every capname := ("li","co","ce") do {
  269.       getval(capname) | {
  270.           quit("check_features",
  271.            "terminal lacks "||capname||" capability", 2)
  272. *** bibleref-1.0/convertb.icn    Sun Jul 14 14:07:59 1991
  273. --- bibleref-new/convertb.icn    Wed Jul 17 03:09:53 1991
  274. ***************
  275. *** 7,13 ****
  276.   #
  277.   #    Author:     Richard L. Goerwitz
  278.   #
  279. ! #    Version: 1.3
  280.   #
  281.   ############################################################################
  282.   #
  283. --- 7,13 ----
  284.   #
  285.   #    Author:     Richard L. Goerwitz
  286.   #
  287. ! #    Version: 1.4
  288.   #
  289.   ############################################################################
  290.   #
  291. ***************
  292. *** 67,73 ****
  293.       local names, n
  294.       static num_table
  295.       initial {
  296. !     names     := ["Gen", "Exod", "Lev", "Num", "Deut", "Josh",
  297.                 "Judg", "Ruth", "1Sam", "2Sam", "1Kgs", "2Kgs",
  298.                 "1Chr", "2Chr", "Ezra", "Neh", "Esth", "Job",
  299.                 "Pss", "Prov", "Qoh", "Cant", "Isa", "Jer",
  300. --- 67,73 ----
  301.       local names, n
  302.       static num_table
  303.       initial {
  304. !     names := [    "Gen", "Exod", "Lev", "Num", "Deut", "Josh",
  305.                 "Judg", "Ruth", "1Sam", "2Sam", "1Kgs", "2Kgs",
  306.                 "1Chr", "2Chr", "Ezra", "Neh", "Esth", "Job",
  307.                 "Pss", "Prov", "Qoh", "Cant", "Isa", "Jer",
  308. ***************
  309. *** 78,87 ****
  310.                 "Eph", "Phil", "Col", "1Thess", "2Thess",
  311.                 "1Tim", "2Tim", "Titus", "Phlm", "Heb", "Jas",
  312.                 "1Pet", "2Pet", "1John", "2John", "3John",
  313. !               "Jude", "Rev", "Tob", "Jdt", "Wis", "Sir",
  314. !               "Bar", "1Macc", "2Macc"]
  315.           num_table :=  table()
  316. !     every n := 1 to 73 do
  317.           insert(num_table, n, get(names))
  318.       }
  319.   
  320. --- 78,90 ----
  321.                 "Eph", "Phil", "Col", "1Thess", "2Thess",
  322.                 "1Tim", "2Tim", "Titus", "Phlm", "Heb", "Jas",
  323.                 "1Pet", "2Pet", "1John", "2John", "3John",
  324. !               "Jude", "Rev", "1Esdr", "2Esdr", "Tob", "Jdt",
  325. !               "Addest", "Wis", "Sirp", "Sir", "Letjer",
  326. !               "Prazar", "Suz", "Bar", "Prman", "1Macc",
  327. !               "2Macc", "3Macc", "4Macc", "Ps 151"]
  328.           num_table :=  table()
  329. !     every n := 1 to 84 do
  330.           insert(num_table, n, get(names))
  331.       }
  332.   
  333. *** bibleref-1.0/name2num.icn    Sun Jul 14 14:08:01 1991
  334. --- bibleref-new/name2num.icn    Wed Jul 17 03:09:53 1991
  335. ***************
  336. *** 6,12 ****
  337.   #
  338.   #    Author:     Richard L. Goerwitz
  339.   #
  340. ! #    Version: 1.3
  341.   #
  342.   ############################################################################
  343.   #
  344. --- 6,12 ----
  345.   #
  346.   #    Author:     Richard L. Goerwitz
  347.   #
  348. ! #    Version: 1.5
  349.   #
  350.   ############################################################################
  351.   #
  352. ***************
  353. *** 40,47 ****
  354.                 "2thessalonians", "1timothy", "2timothy",
  355.                 "titus", "philemon", "hebrews", "james",
  356.                 "1peter", "2peter", "1john", "2john", "3john",
  357. !               "jude", "revelation", "tobit", "judith", "wisdom",
  358. !               "sirach", "baruch", "1maccabees", "2maccabees",
  359.   
  360.                 "gen", "exod", "lev", "num", "deut", "josh",
  361.                 "judg", "ruth", "1sam", "2sam", "1kgs", "2kgs",
  362. --- 40,46 ----
  363.                 "2thessalonians", "1timothy", "2timothy",
  364.                 "titus", "philemon", "hebrews", "james",
  365.                 "1peter", "2peter", "1john", "2john", "3john",
  366. !               "jude", "revelation",
  367.   
  368.                 "gen", "exod", "lev", "num", "deut", "josh",
  369.                 "judg", "ruth", "1sam", "2sam", "1kgs", "2kgs",
  370. ***************
  371. *** 54,61 ****
  372.                 "eph", "phil", "col", "1thess", "2thess",
  373.                 "1tim", "2tim", "titus", "phlm", "heb", "jas",
  374.                 "1pet", "2pet", "1john", "2john", "3john",
  375. !               "jude", "rev", "tob", "jdt", "wis", "sir",
  376. !               "bar", "1macc", "2macc",
  377.   
  378.                 "dt", "jdg", "jg", "rth", "sa1", "sa2", "ki1",
  379.                 "ki2", "ch1", "ch2", "jl", "mt", "mk", "lk",
  380. --- 53,59 ----
  381.                 "eph", "phil", "col", "1thess", "2thess",
  382.                 "1tim", "2tim", "titus", "phlm", "heb", "jas",
  383.                 "1pet", "2pet", "1john", "2john", "3john",
  384. !               "jude", "rev",
  385.   
  386.                 "dt", "jdg", "jg", "rth", "sa1", "sa2", "ki1",
  387.                 "ki2", "ch1", "ch2", "jl", "mt", "mk", "lk",
  388. ***************
  389. *** 63,76 ****
  390.                 "phm", "pe1", "pe2", "jo1", "jo2", "jo3", "1jn",
  391.                 "2jn", "3jn",
  392.   
  393. !               "son", "solomon", "ecclesiasticus", "ecclus"]
  394.   
  395.           abbrevtbl := table()
  396.       tmp_names := copy(names)
  397. !     every i := (1 to 73) | (1 to 73) |
  398.           5|7|7|8|9|10|11|12|13|14|29|40|41|42|43|46|
  399.           47|52|53|54|55|57|60|61|62|63|64|62|63|64|
  400. !         22|22|70|70
  401.       do {
  402.           insert(abbrevtbl, get(tmp_names), i)
  403.       }
  404. --- 61,94 ----
  405.                 "phm", "pe1", "pe2", "jo1", "jo2", "jo3", "1jn",
  406.                 "2jn", "3jn",
  407.   
  408. !               "1esdras", "2esdras", "tobit", "judith",
  409. !               "additions to esther", "wisdom of solomon",
  410. !               "sirach prologue", "sirach", "letter of _
  411. !               jeremiah", "prayer of azariah", "susanna",
  412. !               "baruch", "prayer of manasseh", "1maccabees",
  413. !               "2maccabees", "3maccabees", "4maccabees",
  414. !               "ps151",
  415. !               "1esdr", "2esdr", "tob", "jdt", "addesth",
  416. !               "wis", "sirp", "sir", "letjer", "prazar", "suz",
  417. !               "bar", "prman", "1macc", "2macc", "3macc",
  418. !               "4macc", "151",
  419. !               "song of songs", "solomon", "song of solomon",
  420. !               "3ezra", "4ezra", "3esdras", "4esdras",
  421. !               "adesth", "prologue", "ecclesiasticus",
  422. !               "ecclus", "epjer", "epistle of jeremiah",
  423. !               "song of three", "song of 3", "s of 3 y",
  424. !               "manasseh", "pss151"]
  425.   
  426.           abbrevtbl := table()
  427.       tmp_names := copy(names)
  428. !     every i := (1 to 66) | (1 to 66) |
  429.           5|7|7|8|9|10|11|12|13|14|29|40|41|42|43|46|
  430.           47|52|53|54|55|57|60|61|62|63|64|62|63|64|
  431. !         (67 to 84) | (67 to 84) | 22|22|22|
  432. !         67|68|67|68|71|73|74|74|75|75|76|76|76|79|84
  433.       do {
  434.           insert(abbrevtbl, get(tmp_names), i)
  435.       }
  436. *** bibleref-1.0/passutil.icn    Sun Jul 14 14:08:01 1991
  437. --- bibleref-new/passutil.icn    Wed Jul 17 03:09:55 1991
  438. ***************
  439. *** 1,6 ****
  440.   ############################################################################
  441.   #
  442. ! #    Name:     1.15
  443.   #
  444.   #    Title:     utilities for displaying passages
  445.   #
  446. --- 1,6 ----
  447.   ############################################################################
  448.   #
  449. ! #    Name:     1.17
  450.   #
  451.   #    Title:     utilities for displaying passages
  452.   #
  453. ***************
  454. *** 70,77 ****
  455.   
  456.       message("Locating text in main file...")
  457.           # Now check to see if the passage is present in the indexed text.
  458. !     text := bitmap_2_text(bitmap, kjv_filename) | fail
  459.           # Rewrap passage to width characters per line; put them into a list.
  460.       d_list := []
  461.       every put(d_list, rewrap(text, width))
  462. --- 70,79 ----
  463.   
  464.       message("Locating text in main file...")
  465.           # Now check to see if the passage is present in the indexed text.
  466. !     text := bitmap_2_text(bitmap, kjv_filename) | {
  467. !         err_message("No such passage in " || kjv_filename || ".")
  468. !         fail
  469. !     }
  470.           # Rewrap passage to width characters per line; put them into a list.
  471.       d_list := []
  472.       every put(d_list, rewrap(text, width))
  473. ***************
  474. *** 224,230 ****
  475.   
  476.       next_bitmap := NextBitmap(lastone, kjv_filename) | {
  477.       err_message(convertb(lastone, kjv_filename) || " has no successor.")
  478. !     fail
  479.       }
  480.       return next_bitmap
  481.   
  482. --- 226,232 ----
  483.   
  484.       next_bitmap := NextBitmap(lastone, kjv_filename) | {
  485.       err_message(convertb(lastone, kjv_filename) || " has no successor.")
  486. !     return lastone
  487.       }
  488.       return next_bitmap
  489.   
  490. ***************
  491. *** 239,245 ****
  492.   
  493.       prev_bitmap := PrevBitmap(lastone, kjv_filename) | {
  494.       err_message(convertb(lastone, kjv_filename) || " has no predecessor.")
  495. !     fail
  496.       }
  497.       return prev_bitmap
  498.   
  499. --- 241,247 ----
  500.   
  501.       prev_bitmap := PrevBitmap(lastone, kjv_filename) | {
  502.       err_message(convertb(lastone, kjv_filename) || " has no predecessor.")
  503. !     return lastone
  504.       }
  505.       return prev_bitmap
  506.   
  507. *** bibleref-1.0/ref2bmap.icn    Sun Jul 14 14:08:01 1991
  508. --- bibleref-new/ref2bmap.icn    Wed Jul 17 03:09:52 1991
  509. ***************
  510. *** 62,69 ****
  511.       s ? {
  512.   
  513.       # Find book name, convert it to an integer.
  514. !     bookname ||:= tab(any('1234'));    tab(many(' '))
  515. !     bookname ||:= tab(many(&letters)) | fail
  516.       # Fail if the user gives us just a single letter...
  517.       *bookname > 1 | fail
  518.       # ...otherwise, convert book name into the correct value for
  519. --- 62,75 ----
  520.       s ? {
  521.   
  522.       # Find book name, convert it to an integer.
  523. !     bookname ||:= tab(any('1234')) | {
  524. !         (="first",  "1") |
  525. !         (="second", "2") |
  526. !         (="third",  "3") |
  527. !         (="fourth", "4")
  528. !     }
  529. !     tab(many(' '))
  530. !     bookname ||:= trim(tab(many(&letters ++ ' '))) | fail
  531.       # Fail if the user gives us just a single letter...
  532.       *bookname > 1 | fail
  533.       # ...otherwise, convert book name into the correct value for
  534. *** bibleref-1.0/rsv2rtv.icn    Wed Jul 17 02:07:18 1991
  535. --- bibleref-new/rsv2rtv.icn    Wed Jul 17 03:10:16 1991
  536. ***************
  537. *** 0 ****
  538. --- 1,111 ----
  539. + ############################################################################
  540. + #
  541. + #    Name:     rsv2rtv.icn
  542. + #
  543. + #    Title:     RSV -> retrieve format converter
  544. + #
  545. + #    Author:     Richard L. Goerwitz
  546. + #
  547. + #    Version: 1.3
  548. + #
  549. + ############################################################################
  550. + #
  551. + #  Program for converting CCAT RSV biblical texts into retrieve
  552. + #  format.  Reads standard input.  Writes reformatted text to standard
  553. + #  output.  Assumes the specific TLG betacode format for the input
  554. + #  file(s).  If you have an RSV text that has been "tampered" with,
  555. + #  this program may not work correctly.  Note that this program will
  556. + #  probably work for any betacode-based biblical text (though I can't
  557. + #  imagine what good it would be for anything but the RSV).
  558. + #
  559. + ############################################################################
  560. + #
  561. + #  Links: complete.icn ./convertr.icn ./name2num.icn
  562. + #
  563. + ############################################################################
  564. + # link snapshot          # for debugging purposes
  565. + procedure main()
  566. +     local line, verse, firstline
  567. +     # Go to first tilde-initial line.
  568. +     match("~", firstline := !&input)
  569. +     # While you can read lines from stdin...
  570. +     every line := firstline | !&input do {
  571. +     # ...scan them for betacode level-marker lines (which begin
  572. +     # with a tilde).
  573. +     trim(line, '\x09\x0D ') ? {
  574. +         # Housekeeping.
  575. +         tab(many('\t '))    # tab past whitespace (if present)
  576. +         pos(0) & next    # skip past empty lines
  577. +         # If we have a betacode level marker line, then flush the
  578. +         # verse buffer.
  579. +         if ="~" then {
  580. +         tab(many(~&letters))
  581. +         write(trim(\verse))
  582. +         rtvcode := beta2rtv(tab(0)) |
  583. +             stop("rsv2rtv:  Can't parse ", &subject, ".")
  584. +         write("::", \rtvcode)
  585. +         verse := ""
  586. +         }
  587. +         else verse ||:= tab(0) || " "
  588. +     }
  589. +     }
  590. +     write(trim(verse))
  591. +     exit(0)
  592. + end
  593. + procedure beta2rtv(s)
  594. +     local offset, nextfield, nextoffset
  595. +     static location, fields, offsets
  596. +     initial {
  597. +     location := ["","","",0,0]
  598. +     fields   := "abcxy"
  599. +     offsets  := "12345"
  600. +     }
  601. +     s ? {
  602. +     while offset := map(move(1), fields, offsets) do {
  603. + #           # for debugging purposes
  604. + #        snapshot()
  605. +         nextoffset := offset+1
  606. +         nextfield  := fields[nextoffset] | &null
  607. +         location[offset] := {
  608. +         if pos(0) then integer(location[offset])+1 | fail
  609. +         else {
  610. +             case &subject[&pos] of {
  611. +             "\""      : 2(="\"", tab(find("\"")), ="\"")
  612. +             nextfield : integer(location[offset])+1
  613. +             default   : integer(tab(find(\nextfield) | 0))
  614. +             }
  615. +         }
  616. +         } | fail
  617. +         # If the current field is "y" and its value is "t" then
  618. +         # snarf the next input line, and set this field to 0.
  619. +         # The next input line contains a title (the "t").
  620. +         if any('xyz',fields,offset) & location[offset] === "t" then {
  621. +         read(&input)
  622. +         location[offset] := 0
  623. +         return &null
  624. +         }
  625. +         every location[nextoffset to 5] := 1
  626. +         every location[nextoffset to 3] := ""
  627. + #        snapshot()
  628. +     }
  629. +     }
  630. +     pos(0) &
  631. +     return convertr(location[3] ||" "|| location[4] ||":"|| location[5])
  632. + end
  633. *** bibleref-1.0/version.icn    Sun Jul 14 14:08:02 1991
  634. --- bibleref-new/version.icn    Wed Jul 17 03:09:56 1991
  635. ***************
  636. *** 6,12 ****
  637.   #
  638.   #    Author:     Richard L. Goerwitz
  639.   #
  640. ! #    Version: 1.1
  641.   #
  642.   ############################################################################
  643.   #
  644. --- 6,12 ----
  645.   #
  646.   #    Author:     Richard L. Goerwitz
  647.   #
  648. ! #    Version: 1.2
  649.   #
  650.   ############################################################################
  651.   #
  652. ***************
  653. *** 15,19 ****
  654.   ############################################################################
  655.   
  656.   procedure _version()
  657. !     return "Bibleref, version 1.0, patchlevel 0"
  658.   end
  659. --- 15,19 ----
  660.   ############################################################################
  661.   
  662.   procedure _version()
  663. !     return "Bibleref, version 1.0, patchlevel 1"
  664.   end
  665.