This content has been marked as final. Show 5 replies
try something like this:
var myPos = app.selection.contents.indexOf('\u00AD');
But you will only find the discretionary hyphen you have typed in.
You cannot find a ... (in German: 'Trennfuge') of your hyphenation modul with this.
(It's my mistake that I didn't read your question as well as needed.)
The user dictionary (specifically) has a list of added and removed exceptions. I didn't check, but these most likely are in the "~~" format.
The hyphenationExceptions set is an element of Document.
I guess what you're after is to use ID's engine to hyphenate
word. Seems not possible through the regular channels. Perhaps one of the external Hyphenation plugins expose their methods for scripting.
> Perhaps one of the external Hyphenation plugins expose their methods for scripting.
But maybe the producers of hyphenation plugins want to keep this information/knowledge for themselves. ;-)
If they are smart, they do. You could use a scriptable hyphenator to compare its output against a known word list and then count errors.
I once wrote an implementation of the algorithm used in TeX, and it did surprisingly well, albeit within the constraints of the algorithm (TeX has a list of exceptions -- fourteen, in the standard version). This algorithm is from Frank Liang, and his thesis can be found here. Not surprisingly, there is a JS version as well. It looks like it's targeting browsers, but you could lift out the relevant code and do a better job than ID. (Is "contralateral" really such a weird word? :-) )
Very interesting. I will have a look at the JS version. Thank you.