Suggested spellings no longer function under Mojave

For me, it begins manifesting when a file exceeds 8000-9000 words in length. The exact word count appears to be inconsistent, but by 9K, suggestions are no longer functional.

I also have this problem running Scrivener 3.1.2 on Mojave 10.14.4. Suggested spellings work fine in all other apps I’ve tried.

As others have commented, the problem only occurs in Scrivener docs with longer word counts. If I cut and paste a section of text into a smaller doc the problem goes away.

There is a significant delay in the pull down menu appearing when the problem occurs.

Yup. I always know when the suggestions are going to fail in Scrivener, because of the delay in that popup’s appearance. When the suggestions work normally (word count is less than about 8K - 9K words), the popup appears quite quickly, populated with a list of suggestions. When it fails (as soon as the word count reaches the top limit), there is always a delay before the popup appears.

The most maddening part is I can’t nail down the exact word count before failure occurs. I’ve seen it creep as high as near 9K. But it’s bound to begin failing with any WC above 8K, and once it reaches that failure point, it fails with 100% consistency thereafter in that document.

And yes, it’s still a problem with 10.14.4.

Have you checked to see if it’s triggered by character count rather than word count?

That was one of my thoughts as well. To the best of my recollection, char count doesn’t seem to be the specific trigger either. I wouldn’t expect char count to be the operative difference here, since spell checkers look at words, not letters.

Nor does incidence of error seem to be the cause; if I have, say, 5 “redline” errors in a document, or 50, doesn’t make a difference once the WC has passed that hazy line between 8K and 9K words. It either works with total consistency, or it fails with total consistency. Once it starts failing in a document, it does’t work there again unless WC is reduced below some arbitrary and hard-to-nail-down threshold.

However, if ~8K words represents a chunk of memory, I could see there coming a point where it reaches 8192 discrete memory units (by whatever measure is being applied), and somehow overflowing the boundaries of a variable set aside to retain the text to be parsed (or a function designed to handle the text).

macOS is moving rapidly toward 64-bit architecture everywhere, and now warns users when we load a 32-bit app, telling us it won’t be supported on later OS releases.

I wonder if there’s some 32-bit architecture being referenced on the back end with Scrivener’s spell checker, and that’s ultimately the reason it’s having trouble now. At some time in the past, I seem to recall Scrivener made use of Java. If that’s still happening, and if it’s a 32-bit version of some embedded Java library, and particularly if that library somehow gets involved in the spelling or document-parsing handoff, well, who knows what might happen?

Don’t know if this will help KB or anyone else, but this symptom was also discussed at Apple Support Communities as having occurred in Apple Pages. The last poster (March 30) says that it was corrected for them in Pages version 8, build 6194. I know Pages is in a black box, but maybe the similar word count trigger is a clue. (It’s claimed that bug reports have been filed.)

discussions.apple.com/thread/8633284

Some more info on this bug in the hope that it might help sort it:

On the project I’m working on the problem only occurs with documents that are inside the “draft” section of the binder. I still get suggested spellings for all of the documents outside of the draft section, including documents in the “research” section of the binder. And if I drag a document or a folder of documents out of the draft section, I am able to get suggested spellings for the text in that doc or folder. But, if I drag it back into drafts, the problem reappears.

This looked really interesting, so I tried it too. Unfortunately I can’t report the same. Spelling popup suggestions fail whether or not a document is in the “Drafts” folder, any time my word count breaks an (as yet) undetermined quantity above 8000 words.

Scriv 3.1.2 (10882), purchased directly from L&L, not as a download from the App Store; macOS 10.14.4.

It’s a shame warrenao can’t replicate this. I’ve been experimenting with it a bit more and I now realise that – on my iMac – the issue only occurs when documents in the draft folder are spooled together so that they can be viewed and edited as one long document. If I use split view and open up a draft folder doc on its own in the second window, I get suggested spellings, but I can’t get suggested spellings for the same word in the same doc in the spooled view in the other window.

When I copied the project onto my MacBook (running the same version of the OS and Scrivener), the issue disappeared, which suggests the problem must have something to do with my iMac setup. So I tried booting the iMac in Safe Mode to see if that helped – it didn’t!

I also tried turning off all the functions in the iMac’s “Services” menu (since they differ from the services I use on my MacBook) but that didn’t help either.

I can confirm that it the bug appears to have been fixed in the last update of Pages, but is still prevalent in Scrivener.

I haven’t been able to reproduce this even in documents with thousands of words of text. Does anyone have a sample project that shows the issue in a document 100% of the time?
Thanks and all the best,
Keith

Hi Keith.

I made a quick document using the default novel template and pasting in the text from Great Expectations. I tried to upload a file but the forum wont allow it (file size too big)*, so here’s a gif illustrating the problem:

SpellingTest.gif

If I right click on a misspelt word on an individual scrivening, I get spelling suggestions. If I do the same in scriveneings mode (ie, click on the manuscript icon or the top folder) I get no suggestions.

This happens 100% of the time and on two different Macs running Mojave (High Sierra is fine).

*UPDATE: I managed to attach the file by stripping out the front matter, templates etc.
TestDoc.zip (817 KB)

Thank you! I can now see the problem. I’m guessing that I didn’t see the problem before because I’m working on a pretty powerful machine (an iMac Pro), so that 10,000 or even 20,000 words weren’t enough to trigger the issue for me. With 180,000 words I see the issue.

Apple’s frameworks are in fact reporting the following error on the Console:

“suggestGuessesForWordRange timed out”

The way suggestions work is that I pass in to apple’s “word guesses” method the current text and the range in that text that is currently selected. Apple’s code then comes up with a list of suggestions. It takes the whole of the text rather than just the selected word so that it can use the context to make suggestions, I believe.

It seems that when the text is so long, however, Apple’s code fails. This seems to be a problem on their side, really, since their code should be optimised to deal with this, and ignore the greater position of the text if it’s going to time out.

I’ve worked around it myself though in the way that I would have expected Apple’s method to do. I’ve made it so that if the text is over 10,000 characters (just under around 2,000 words), I truncate what I pass in to Apple’s method to 2000 characters either side of the selected word. This ensures that there is still enough context for Apple’s code to do its work, while avoiding passing in a text so long that Apple’s method times out.

So this should now finally be fixed for the next update - thanks for providing a sample project that allowed me to see the issue.

All the best,
Keith

Excellent. Glad I could help.

And thank you for making such wonderful software.

Another snippet of info on this bug, in the hope that it might help fix it. I’ve just realised that when I click on a misspelled or unfamiliar word (a word with a red underline) in spool view, the option to “learn spelling” appears in the pull down menu, but if I select it, the red underline remains and Scrivener does not learn it. If I click on the same word in the same doc outside of spool view, Scrivener learns the word and the red underline disappears.

What is “spool view”?

It might not be the proper name for it, but I meant the view that shows the documents in “draft folder” joined together as if they were on one long “spool” of paper.

Thank you! For future reference, that’s Scrivenings view.

IIRC, this is a Mojave bug that ruins the “learn spelling” when a file is too big. Since Scrivenings view presents text to the Mojave speller as one big text lump, this problem is likely to show up if you have many texts in your Scrivenings view. Unfortunately, Scrivener uses the MacOS spelling engine, so this will be fixed when Apple fixes it. :wink: The workaround is, as you discovered, to quickly switch to single doc mode, learn the spelling, and switch back to Scrivenings. You can put a tool in the toolbar for this, or ( if your taste runs to keyboard shortcuts) you can find the shortcuts in the View menu.

Hope this helps!

This was an ongoing problem with Mojave 10.14.5, as well. However, it seems to have been addressed with the latest Scrivener release, 3.1.3. I can no longer replicate the error, even with documents considerably longer than 8K words in length.

Just updated to 3.1.3 and the suggested spellings is working perfectly again. Thanks for fixing this!