index using word list

Get help using and writing Nisus Writer Pro macros.
Post Reply
feat
Posts: 105
Joined: 2004-01-29 04:17:10
Location: Paris, FR

index using word list

Post by feat »

I need to index a number of Nisus documents, using the index as scheme, where the words to be indexed are variants of some French words, like homogène, homogénéité, hétérogène, hétérogénéité, along with their plural form and their capitalized form as well, and sometimes their masculine and feminine form — which means processing 4 to 8 times the theoretical number of words to index.

Obviously, this cannot be done automatically using the index using word list feature as is, and is certainly tedious to do manually. In fact I could use an extension to the index using word list feature that would work with the index as mode instead.

Is there a way this could be done using Nisus macros to process lists of assorted words?

I've been reading the Nisus macros reference but can't find any satisfactory answer... except perhaps using the Menu command, but I failed to realize how to:
  1. use a list variable to select all occurrences of one item, at once, in the text
  2. index these occurrences using a topic string from some scalar variable
  3. proceed with the next item in the list for the same topic
  4. proceed with the next list of items to be indexed under a different topic
In fact, I cannot imagine how to put up the data structure that would be needed for processing a whole document — then do the exactly the same for some other document... Can anybody help?
User avatar
Hamid
Posts: 777
Joined: 2007-01-17 03:25:42

Re: index using word list

Post by Hamid »

feat wrote: Obviously, this cannot be done automatically using the index using word list feature as is, and is certainly tedious to do manually.
'Word list' is a misnomer. What you actually need is a concordance file having two columns. The first column is what you want to find in your document followed by a tab and then how you want what was found to appear in the index. The concordance file would look like this:

homogène homogénéité
homogènes homogénéité
homogénéité homogénéité
hétérogène hétérogénéité
hétérogènes hétérogénéité
hétérogénéité hétérogénéité

An easy way to create a concordance file from a world list is to run a macro like this:

Code: Select all

Find and Replace '^.+$', '\0\t\0', 'Ea'
Then make any modifications to it to take care of all possible variant forms of the topic.
feat
Posts: 105
Joined: 2004-01-29 04:17:10
Location: Paris, FR

Re: index using word list

Post by feat »

Thanks, Hamid, but even if I built such a concordance table by hand — and of course, I did — it wouldn't solve the basic problem: how do I use that data to invoke the index as menu command?

The best solution would indeed be an extension of the index using word list command that would work as the index as menu command does...

Yet I'm stuck, since I don't have the source code for any of these processes to begin with.
User avatar
Hamid
Posts: 777
Joined: 2007-01-17 03:25:42

Re: index using word list

Post by Hamid »

Indexing using a concordance file does not give you the possibility of applying character styles to the topic even when they are defined in the second column. That is a shortcoming. However, you still have the possibility of indexing subtopics by using the separator ':' for example:
lion animaux:lion
âne animaux:âne
feat
Posts: 105
Joined: 2004-01-29 04:17:10
Location: Paris, FR

Re: index using word list

Post by feat »

Neat, Hamid: this tip definitely solves my problem! The documentation is rather terse on that particular subject.
Post Reply