Hello Nobumi,

Let me just say first, that I don’t really have as much experience with indexing as I am pretending to have here ;-)

On Oct 24, 2015, at 8:33 , Nobumi Iyanaga <[log in to unmask]> wrote:

Hello Philip,

Thank you for your reply.

On Oct 23, 2015, at 4:38 PM, spaelti <[log in to unmask]> wrote:

...

It’s true that the word list method--and the same is true for using indexing using the find dialog—wont help you to index places where the specific word or words are not used.

But for the specific case you mention it will work fine. The word list is an “Index as” method. The first column is the item that should be indexed, and the second is the “Index as” term. So you would put the following in your list:

authenticity authenticity
authentic authenticity

Yes, I will certainly do this.

There are cases which can be confusing, for example, I have the name "Yamato" (old name for Japan), and "Yamato-takeru" (the name of a hero in Japanese mythology). For these names, I may have this table:

Yamato Yamato (old name for Japan)
Yamato-takeru Yamato-takeru (a hero in Japanese mythology)

Then, "Yamato" in "Yamato-takeru" would be indexed twice, both as "Yamato" and "Yamato-takeru". If in the generated index, the page for "Yamato" appears in the entry for "Yamato-takeru", that is not good. Is there any way to avoid this kind of situation…??

Yes, I just tried this, and this does seem to work this way. Apparently, since hyphen counts as a word boundary, the indexing finds “Yamato” inside “Yamato-takeru” and indexes it twice. I was hoping that by having it index “Yamato-takeru” first this might be avoided, but apparently this doesn’t work. It also doesn’t work to replace the hyphen with a non-breaking hyphen.

The simplest thing here is to avoid putting such hyphenated items in the word list. Then when you have indexed using the word list, use Find to find all instances of “Yamato-takeru” and remove the indexing (which will remove their index as “Yamato”). Then you can index them again correctly




I think I should use regex find features for many topics, and add "Index As..." mark to texts. That must be a very time consuming work…?

Well, yes a good index will require a lot of work. For a topical index, you should probably use the word list method for the “first draft”. Index using the word list and then generate the index. Check to see what is indexed and what is missing. Then go back and remove the indexing from places where it is not needed and add it in places which were missed.

In order to remove index mark from words, we have to find these words to which index marks were added, but this seems not easy...? Indexed words can have some color, but it is not very visible. And there is no command to find "Next Indexed Word", or something like this... Is it possible to find these words with regex?

I’m not sure if you can use Powerfind to find indexed items. My quick test didn’t work.
It seems that indexing is handled a bit differently from other styles. And the reason is probably that they need to deal with the “Index As” topics. Since you can index any text bit for multiple topics, this can get quite complicated. Even writing macros to handle this is complicated. Below I’m attaching a macro that will select the next indexed bit of text, and show you what it is indexed for

best

Philip Spaelti


# Macro Select Next Indexed Item

$doc = Document.active
$indexStyles = $doc.textIndexStyleNames

# Get the name of the index style
$indexName = Active Text Index Name

# Go through the document and look for indexed items
$sel = TextSelection.active
$loc = $sel.bound
$txt = $sel.text

while $loc < $txt.length
$attr = $txt.attributesAtIndex $loc
$range = $txt.rangeOfAttributesAtIndex $loc
$topic = $attr.textIndexTopicsForStyleName($indexName)
# If an indexed item is found select it and quit
if Defined $topic
$indexed = TextSelection.new $txt, $range
$doc.setSelection $indexed
Prompt $indexed.substring, 'Indexed as :' & $topic
Exit
end
$loc = $range.bound
end

# If nothing is found
Prompt 'No indexed items found.'

# end of macro