Aperçu d'IndexMatic²
February 26, 2011 | IndexMatic² | fr | en
IndexMatic² pour InDesign est un outil d'indexation pour ceux d'entre vous qui réalisent des livres ou des documents massifs avec InDesign. Cette nouvelle version est le fruit d'un croisement entre deux scripts « originels » que j'ai écrits il y a plusieurs années (IndexBrutal et IndexMatic 1), mais le code a été entièrement repensé afin d'offrir de nouvelles fonctionnalités et des performances radicalement supérieures…
Fin du beta-test [01-07-2011] — La période de beta-test d'IndexMatic² est terminée et le contenu de cette page est en partie obsolète. Merci de vous reporter désormais à la page principale du produit.
Avertissement. — Ce billet n'offre qu'une présentation ultra-simplifiée d'IndexMatic². Je développerai les fonctionnalités avancées et certains aspects plus techniques quand le produit final sera prêt.
Le plus excitant concernant IndexMatic² est qu'il permet de produire un index en combinant différents critères liés au(x) document(s) cible(s) (intervalle de pages, sections, calques, styles...) avec un moteur de recherche basé sur les expressions régulières. Le script offre donc à la fois les fonctionnalités d'IndexMatic 1 et d'IndexBrutal — et bien plus ! — réunies dans un seul outil.
Note. — La rubrique Context est verrouillée dans la version BETA, ainsi vous ne pouvez pas indexer les notes de bas de page séparément, et tous les contenus ancrés ou emboîtés (tableaux inclus) sont ignorés.
Aperçu du module de recherche (« Search Mode »)
Une fois que vous avez délimité l'espace du texte cible, IndexMatic² vous propose trois façons d'extraire les mots-clés ou expressions à indexer.
1) Dans la rubrique Search Mode, sélectionnez « Automatic » pour construire une liste de mots exhaustive directement à partir du texte cible. Vous aurez seulement à préciser la longueur minimum et la longueur maximum d'un mot. Le mode de recherche automatique est le plus facile à utiliser mais gardez à l'esprit qu'il tend à engendrer un vaste corpus. Vous pouvez limiter la prolifération de mots peu pertinents en augmentant le paramètre « Page Rank » dans la rubrique Default Options.
2) Choisissez “Query List” pour éditer vos propres requêtes. Fondamentalement, une requête est un simple mot-clé attaché à un terme (une entrée de l'index final). Par défaut, toute expression recherchée est attachée à elle-même, c'est-à-dire qu'elle apparaîtra telle quelle comme terme d'index. IndexMatic² offre certaines options — Case sensitive, Whole Word, Generic Space — qui permettent d'agréger les variantes d'une même expression autour d'un même terme. De plus, vous pouvez forger des requêtes plus complexes sur des expressions régulières (regex). Il suffit pour cela d'entourer l'expression de barres obliques (slashes). Par exemple, la requête :
/a\w+/
recherche tous les mots commençant par un a — y compris un A majuscule si l'opération est insensible à la casse (option Case sensitive décochée). Vous pouvez utiliser n'importe quelle regex JavaScript valide. Lorsqu'une requête est basée sur une expression régulière, IndexMatic² considère par défaut chaque forme trouvée comme un terme d'indexation. Toutefois, un opérateur spécial est prévu (=>
) si vous souhaitez attacher toutes les formes trouvée à un terme unique. Par exemple, la requête :
/tests?/=>test
relie la regex /tests?/
au terme test
. Notez d'ailleurs que toute requête peut faire appel à l'opérateur de réécriture =>
, même une requête simple du genre : chien=>animal
.
Note. — Il existe des différences subtiles entre les expressions régulières JavaScript et GREP. Pour des raisons de performance, IndexMatic² ne sollicite pas la couche GREP d'InDesign ; tout le processus de recherche est donc basé sur des RegExp au sens JavaScript.
3) Choisissez “Single Query” pour envoyer une unique requête (plutôt qu'une liste). Cette option est utile pour indexer toutes les occurrences d'une seule expression, ou pour effectuer des tests rapides.
Aperçu de l'index final (« Output »)
Les rubriques Output et Page Report permettent de contrôler le formatage de l'index final. Le seul objectif d'IndexMatic² est de construire un ensemble pertinent de termes, et d'indiquer pour chaque terme les numéros de pages correspondants. Le script n'altère d'aucune façon le(s) document(s) de travail. Par ailleurs, la version BETA propose pour seul mode de sortie un fichier texte (« Destination : Text File »).
Essayez-le et racontez-moi !
• Voir aussi :
— « Premier essai » d'IndexMatic² sur Urbanbike.
— Mention dans InDesignSecrets (EN).
• Remerciements chaleureux à : Laurent Tournier, Herbert M. Tucker et Jean-Christophe Courte.
Comments
Excellent Marc, je n'ai pas de long document sous la main, mais je regarde dès que ça arrive !
Great work, Marc! I can't wait to have the time to try this! ;-)
J'ai fini il y a quelques jours l'index de mon livre sur Illustrator CS5 (presque 550 pages). Je vais le refaire avec ce script pour tester et comparer.
Comme à l'accoutumée, notre ami Marc nous offre un magnifique script. Comme il se doit, j'apprécie tout particulièrement la possibilité d'utiliser les expressions régulières. Un script qu'il faut prendre le temps de tester pour en maîtriser toutes les subtilités, que Marc saura nous expliquer avec tout son talent. Merci.
Zut, j'ai de la compta à faire… Dilemme, IndexMatic 2 ou Compta…??! T'es grouphhhhannnnt Marc avec tes scripts de la mort qui tue…!
Hi, When I try and run your script in CS3 I get the following error, "Invalid object for this request".
IndexBrutal opens OK but no luck with IndexMatic 2 which I just downloaded.
Thanks,
Herb
Thanks Herb, I was not very confident about the CS3-compatibility. I will investigate on this issue.
@+
Marc
Je n'ai pas laissé de message, mais j'ai eu le même avertissement hier, en français, sous CS4 Mac. Avec la version Beta2 + la spéciale. J'ai fermé et rouvert ID, et tout est rentré dans l'ordre.
Argh! Il y a donc un bug qui se cache quelque part... Je vais d'abord orienter mes recherches sur CS3, mais si d'aventure tu réussis à reproduire l'erreur de façon systématique, je serai évidemment très intéressé d'en savoir plus sur le document utilisé.
@+
Marc
Pour rassurer les utilisateurs d'IndexMatic2, mes problèmes proviennent d'une corruption de fichiers IDD associés à un Livre. Résidus de fichiers idlk.
This is great. Just what I need to create an index using a character style. I need it to work inside tables, as all my product numbers are inside tables. Any idea when the beta (or final product) that will allow this will be available?
Hi Peter,
I hope IndexMatic PRO be available by late April. Still a few checks.
@+
Marc
hi thanks so much this is almost a lifesaver. One question, how do I link sub words to a parent word in the query list so that they remain connected in the final index and not moved to alphabetical order?
For example:
main word:biome
sub words:deserts
forests
grasslands
savanna
semi-deserts
tundra
@scone8
[I'm sorry, your comment had been —wrongly— rejected as a spam. My blog engine sometimes acts like a dragon!]
> how do I link sub words to a parent word in the query
> list so that they remain connected in the final index
Good point! Indeed, you can only 'send' sub words to the main word, using sth like:
/deserts|forests|grasslands|savanna|tundra/ => biome
but IndexMatic does not actually manage subtopics in the way you want it to. I really take this feature request in consideration.
The track I'm exploring is to add a specific operator that would allow the user to specify topic hierarchy. What do you think of:
/deserts|forests|grasslands/ => biome > $0
?
@+
Marc
Marc,
I'm trying to run your script using a list. Some of the items in the list begin with a numeral, some of them have apostrophes. The script is ignoring those entries. I have 'Allow Hyphens' Digits & Apostrophes all checked, but it's just not working. Any clues on how I can index all the entries?
Great script, by the way. Incredible timesaver.
Hi Sherm,
Thanks for your feedback.
> Some of the items in the list begin with a numeral,
> some of them have apostrophes. The script is
> ignoring those entries.
You mean the script ignores *only* those queries? Could you show me an example?
If you try a single query such as 123abc, what happens?
About apostrophes, note that if the queries use single straight quotes (U+0027) and if the document uses RIGHT SINGLE QUOTATION MARK (U+2019), they won't match. Therefore, assumed you want to find any apostrophe form w/o distinction, you have to use a regex such as ['’].
E.g.:
/don['’]t/ => don’t
Hope I'm on the right track…
@+
Marc
Any word on PRO? Need table searching badly :)
Hi Kevin,
Still fixing bugs… And by the way, you've pinpointed the deepest issue: table searching. The search routine works fine but indexing the right page is a real headache. Indeed, the InDesign scripting DOM offers no access to the page that actually contains a table cell. So IndexMatic can only retrieve the page that owns the table insertion point, which produces wrong results when such a table spans over multiple pages.
Not sure I could find a workaround…
@+
Marc
Found a bug today.
Indesign returned the following error: reflect is read only
Hi Craig,
Thanks for your message. Other beta-testers reported the same issue and I already fixed that bug in my WIP version.
Note. — The bug occurs when the indexed document contains the word ‘reflect’ (!)
@+
Marc
Hi and thanks, amazing! But I have a question: I need find two words like one (name of city Nova Bystrice - found like Nova and Bystrice) - any idea how to connect together? Thanks again.
Hi Michal,
> I need find two words like one (name of city
> Nova Bystrice - found like Nova and Bystrice)
In your Query list you can connect multiple queries to the same final term:
/Nova/I => Nova Bystrice
/Bystrice/I => Nova Bystrice
(Note: The 'I' flag means that the query is locally case-sensitive whatever the Default Options.)
Better, you can wrap it all in a single regex:
/Nova|Bystrice/I => Nova Bystrice
Even better, with diacritics:
/(Nov(a|á))|(Byst(r|ř)ice)/I => Nová Bystřice
@+
Marc
This is great, but unfortunately, it does not work with Serbian cyrillic alphabet...
Hi tadir,
Yes, I'm really sorry about that. IndexMatic2 only supports Latin-based alphabets so far. I plan to fix this limitation in the future.
@+
Marc
The beta version had a "longest styled string" option. How do I do that in this new version?
Hi CJ,
> The beta version had a "longest styled string" option […]
Are you sure? I don't remember that. What is true is that the previous versions of the script managed break characters and new lines in a different way. Now IndexMatic does not regard breaks as if they could belong to the same entity. There are pros and cons on this approach, and this is a complicated topic, but after consulting the opinion of some beta-testers I had to make a choice. Please, tell me more on the issue you encounter.
> How do I do that in this new version?
Well, the generic way to capture the longest text ‘entity’ in a specific style is to use the query:
/.+/W
(but that does not cancel the restriction mentioned above.)
Feel free to supplement your comment. There are certainly still areas for improvement in IndexMatic.
@+
Marc
Hi Marc,
I'm using the Pro version in CS5 and my query from a simple (I think) word list continues to return a "syntax error" from within InDesign. I have "dumbed down" my word list to include only single, whole words but the error persists. I'm totally new to scripting and using your scripts. I'd be happy to provide any additional information that you need. Thanks in advance.
Hi Joel,
Thanks for your report. I will contact you by email in order to study this bug.
@+,
Marc
Any chance I could get the beta version back? I have purchased the Pro, but I desperately need the other one. The easiest way for me to describe the whole longest styled string thing is for you to go to http://indesignsecrets.com/building... and see the screen shot. Under the "Search For" drop down, there was a "longest styled string" and I used it for indexing directories. Instead of indexing "clinic" and "name" it would index "Clinic Name" and it was fabulous. And I loved it. And my computer crashed, and I lost it and bought the new one. And it's sort of a design/indexing emergency.
Nevermind. I found the archived file. THANK YOU!!
Hi CJ,
That's OK, but as replied above (#26) you can retrieve the “longest styled string” with IndexMatic 2. Simply use the following query:
/.+/W
Regards,
Marc
==================================
[EN] THIS COMMENT THREAD IS CLOSED.
FOR FURTHER DISCUSSION ABOUT INDEXMATIC 2,
PLEASE POST YOUR MESSAGE IN THE
“FREQUENTLY ASKED QUESTION” PAGE.
==================================
[FR] CE FIL DE COMMENTAIRES EST FERMÉ.
POUR POURSUIVRE LA DISCUSSION SUR INDEXMATIC 2,
MERCI DE POSTER VOTRE MESSAGE DANS
LA « FOIRE AUX QUESTIONS ».
==================================