Name Index and Scripture Index

Get help using and writing Nisus Writer Pro macros.
Post Reply
Windsor
Posts: 46
Joined: 2008-04-28 22:10:11
Contact:

Name Index and Scripture Index

Post by Windsor » 2013-05-16 07:32:53

Can I have two macros? One for Name Index and another one for Scripture Index?
1. Name Index: to have names index that have first and last, or may be more (like Arabic names that go all the way to five or six generations). For locations, animals, plants, etc., the CompleteWordList macro is sufficient, since it lists in alphabetical order AND in uppercase/lowercase order. So, now I need person's name list, and let's call it Name Index.
This can be detected by commas. For example if there is a name and a comma, let the comma be the trigger to the macro to let it know that it is a one name, if there is no comma (or period) then any word with capital initial to be considered a complete name to be together in the list, of course WITHOUT the comma!. And the list the macro will generate to be as follows:
Name, how many times occurrs, on which pages.

2. Scripture Index. (this one is tricky). There are two ways to cite Scripture, the Western and the Armenian way. The Western uses English colon between chapter and verse, The Armenian colon looks like English period! and the period looks like English colon. So, if the macro detects both (for both languages), even better :)
A suggestion: how the macro to detect a Scripture citation, whether complete name or abbriviated? I think it should detect by looking at:
a. Capital initial of a word to which numbers are followed with colon (or period in the case of Armenian Scripture) in between them.
b. number:number (or for books with single chapter, number), whether single number or more, or even with different verses, like: 1,4,5-9,11
c. in the case of Armenian Scripture citation, the dividing character between chapter and verse is the "English" period, and the dividing character between chapters AND books is the "English" colon. Whereas the dividing character between chapters AND books in English is the semicolon! For example:
English: Exodus 1:2-10; 2:5.
Armenian: Ելից 1.2-10։ 2.5։
Where there is no book name, let the macro consider the numbers after the semicolon (E) or the "colon" (A) as part of the pervious book, so that, say, all the Exodus citings can be listed under Exodus with (of course) numeric order.
For different books, the Scripture citations are done this way: English: Genesis 1:1; Psalm 139:1. Armenian: Ծննդոց 1.1։ Սաղմոս 139.1։
When the issue comes to abbreviated book names, like Gn, or Gen for Genesis (Ծննդ. Armenian abreviation of Genesis), let the macro detect by the initial uppercase and chapter and verse numbers. And in case of more than one book of the same title, like I John, II John, III John, or 1 John, 2 John, 3 John, let the macro detect both the number (arabic or roman) and the initial uppercase of the word as a book title. And the list the macro will generate to be as follows:
Scripture citation, how many times occurrs, on which pages.

thanx,
Windsor

sardinops_99
Posts: 9
Joined: 2003-06-07 06:19:28

Re: Name Index and Scripture Index

Post by sardinops_99 » 2017-03-11 14:11:19

Hi
Did you get anywhere with this? I need to do a scripture index
Thanks

User avatar
phspaelti
Posts: 948
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Name Index and Scripture Index

Post by phspaelti » 2017-03-11 15:54:16

Hi sardinops,
Let's try to clarify what you are looking for. Basically Nisus has an indexing feature that allows you to make as many different indexes (or indices, if you prefer) as you like. Just set-up the index and apply the index style. You don't need any macro to create a scripture index.

However maybe you are looking for a way to index things automatically. Nisus provides a method for indexing from a word list. The problem with scripture references is that they include numbers, which can't be matched from a word list, since they range over thousands of possibilities. So if you want to match those, you would need a macro. But in that case it would be good to know more about the specific format your references take in the text. So please post a few samples, and then we can help you with that.

(Windsor's request is a bit old, and I don't know if he got any help with it. But at this point it's not clear whether it's worth answering that.)
philip

User avatar
phspaelti
Posts: 948
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Name Index and Scripture Index

Post by phspaelti » 2017-03-11 20:17:34

I just realized that I had already written a macro to do this kind of thing. This was for someone who had used abbreviations in the text and wanted to index them with full book names in the index. I'm posting it here with a mock test file, to show what it would look like.
Attachments
Bible Verse Indexing Test.rtf
(24.21 KiB) Downloaded 117 times
Index Bible Chapters.nwm
(5.8 KiB) Downloaded 88 times
philip

Windsor
Posts: 46
Joined: 2008-04-28 22:10:11
Contact:

Re: Name Index and Scripture Index

Post by Windsor » 2017-03-11 20:54:45

Thanks everyone for looking into my request. I totally forgot about this because I didn't get any feedback soon enough. I posted it in 2013! Wow!
Anyway. I am inclined toward using Nisus' index feature, rather than having a macro, for Scripture indexing.

User avatar
phspaelti
Posts: 948
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Name Index and Scripture Index

Post by phspaelti » 2017-03-11 22:19:19

Windsor wrote:Thanks everyone for looking into my request. I totally forgot about this because I didn't get any feedback soon enough. I posted it in 2013! Wow!
Anyway. I am inclined toward using Nisus' index feature, rather than having a macro, for Scripture indexing.
Well, these two things are not in any way in conflict. In fact the macro I posted, just automates the indexation. But it is still using the Nisus index feature.

The point of using the macro is to more quickly, and more consistently index a complex document. So taking what you write above, if you have scripture references in both Armenian and English, and you would like to have both the Armenian and English combined, so that you can look up in the index "Genesis X:Y" and be directed to both the Armenian and the English, you will have to index using the "Index As" feature. If you do this by hand, you will need to, each time, select the reference, choose "Index As" and type the correct index topic into the dialog. If you have hundreds of references, this is going to be a lot of work, with a lot of opportunity to make mistakes. This is why Nisus has the "Index Using Word List" feature.

And here is the problem with using that feature. Bible references have a structure [Book Chapter:Verse] and there are about 31,000 verses. So you can't list them all. If you enter only the books into your list, then all Genesis references will be put together under one topic. So you can really only do this with a macro (or by hand.)
There are indeed other problems. If you look into my sample you will see that my index lists all Genesis references together, but with the chapters as sub-topics and the verses as sub-sub-topics. To do that you will need to be careful about how you use "Index As". They are also in numerical order (so chapter "7" is before chapter "11"). You will not get this result as a default case. To get this result, you need to "pad" the numbers. That is you need to enter chapter 7 as " 7" with a preceding space. This is because the Nisus indexing feature sorts the entries alphabetically (treating numbers as text). Since "1" is before "7", "11" is before "7" as well.
So if this problem is still relevant for you, I'd encourage you to take a look at the macro I posted. If it doesn't meet your exact situation it could probably be adjusted. Let me know.
philip

sardinops_99
Posts: 9
Joined: 2003-06-07 06:19:28

Re: Name Index and Scripture Index

Post by sardinops_99 » 2017-03-12 05:14:55

Hello Philip
Thanks for your response. I am still using your Japanese macros from way back! I couldn't get the macro to do anything. I edited it to reflect the abbreviations I use (e.g. Gen, Ex... Matt, Mark, John, Acts, Rom etc) but still no index produced. Not sure what I'm doing wrong.
Rod

User avatar
phspaelti
Posts: 948
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Name Index and Scripture Index

Post by phspaelti » 2017-03-12 07:44:41

Hello Rod,
you say you couldn't get it to do anything, and also that you modified it. Let's start with that first. So you changed the code:

Code: Select all

$bibleChaps = Hash.new ('Ge','Genesis','Ex','Exodus',…
to

Code: Select all

$bibleChaps = Hash.new ('Gen','Genesis','Ex','Exodus',
etc.
I'll take that as a yes :)

So now you ran it on your file, and nothing happened. No, error message? Did it select something? (If there is anything suitable in the file, it should end with the last instance selected.)
Note that the macro will not create any index, it will only index suitable items. So you won't see any actual change, unless you have your Appearance Preferences set so that Marked Text: Index As is visible. The actual effect of the macro will only be obvious after you insert or update your index. Also remember to make sure you have selected the correct index before you run the macro, if you have more than one index.

If it is not indexing anything, then perhaps there is an issue with the format of your references. Aside from the matching abbreviations, the abbreviations must be followed by a space and then at least one number. Verse numbers should be separated from the chapter number by either a period or a colon. I guess I should have included some code to report to the user how many items were indexed, or whether nothing was found.

So just to be clear, the procedure to use with the indexing macro above is:
  1. Check and make sure you have properly configured your index (Tools > Index > Configure Index Styles…)
  2. Make sure the desired index is selected (Tools > Index > √MyScriptureIndex)
  3. Run the macro
  4. Place the selection at the location where you want your index to appear in your document
  5. Tools > Index > Insert Index… (or Rebuild Index… if one already exists at that location)
philip

sardinops_99
Posts: 9
Joined: 2003-06-07 06:19:28

Re: Name Index and Scripture Index

Post by sardinops_99 » 2017-03-12 16:10:09

Many thanks indeed! I got it to work. I need to edit it a bit to get the results I want. I'll probably need your help again!
Rod

sardinops_99
Posts: 9
Joined: 2003-06-07 06:19:28

Re: Name Index and Scripture Index

Post by sardinops_99 » 2017-03-14 01:03:22

Hi Philip
If I have a list of references like this

John 3:11, 34, 8:28, 12:49, 14:10, 24, 17:8
John 8:51, 12:47
Matt. 12:19

The Index comes out like this (where the 1 is the page number)

John
 3
11... 1
 8
51... 1
Matthew
12
19... 1

The first reference in the list is the only one indexed. The others are ignored. (I know why but don't know if there is a work-around). Also the chapters and verses need to be separate by colons. I'm trying to get this

John
  3:11.... 1
  3:34.... 1
8:28.... 1
8:51.... 1
10:24.... 1
12:47.... 1
12:49.... 1
14:10.... 1
17: 8.... 1
Matthew
12:19.... 1

Eventually the book headings need to be in scriptural not alphabetic order but I can do that by hand as it is only done once. Don't stress about it. It is a 230 page book but it still might be easier to do it by hand!

Thanks
Rod

User avatar
phspaelti
Posts: 948
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Name Index and Scripture Index

Post by phspaelti » 2017-03-14 02:17:53

Hello Rod,

To get the macro to work for strings of references like yours will require some changes to the macro. Essentially the macro will have to find the whole string, and then index each reference separately, copying the book information to each reference. So this will need a more sophisticated macro.

One problem with listing things like "3:11" is that the colon is the separator for subtopics. So Nisus' index feature will split such topics automatically. I don't know enough about this to see if there is a way around this. I'll look into it.
As for the scripture order. I remember having done this before, so I probably have a macro around to do this. Of course you can do it, by hand, but if you ever try to update the index Nisus will immediately go back to alphabetical order. One subtle point here, I'm not a bible scholar myself, but aren't there different orders for some of the books in different traditions?

Considering all these problems, in the end it might be best to write a macro to do the whole scripture index and not bother with the Nisus index feature.
philip

NisusUser
Posts: 258
Joined: 2011-01-12 05:32:38

Re: Name Index and Scripture Index

Post by NisusUser » 2017-03-20 11:27:08

phspaelti wrote:Considering all these problems, in the end it might be best to write a macro to do the whole scripture index and not bother with the Nisus index feature.
Rod, Philip has very unselfishly helped me a lot with similar macros. Kudos to him!

I agree with Philip that probably the best thing is to do a separate macro that just puts in a new section in the document with all the data. It would be helpful for me sometimes to also have a macro like this, particularly if it's possible to tweak the abbreviations of Bible book names (or, better yet, expand them so that, for example, "Ge", "Gen", "Gen." and even "G." all sort to Genesis. That way one would not need to change the macro each time some text with a different abbreviation conventions.

Post Reply