Suggested spellings no longer function under Mojave

User avatar
KB
Site Admin
Posts: 20775
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Fri May 03, 2019 5:07 pm Post

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
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

User avatar
ThisHereIsPete
Posts: 21
Joined: Sun Mar 04, 2018 9:47 am
Platform: Mac + iOS

Fri May 03, 2019 7:00 pm Post

Excellent. Glad I could help.

And thank you for making such wonderful software.

De
Dewlally
Posts: 10
Joined: Mon Feb 02, 2009 10:31 am

Thu Jun 13, 2019 11:20 am Post

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.

User avatar
Silverdragon
Posts: 1534
Joined: Mon Jul 29, 2013 2:52 pm
Platform: Mac + iOS
Location: Tarzana, California, USA
Contact:

Thu Jun 13, 2019 6:05 pm Post

What is "spool view"?
  • Fiction-writer curled up on her TP hoard.
  • Mac Scrivener 3.1.5, MacBook Air 11, MacOS 10.15.6 (Catalina)
  • IOS Scrivener 1.2.1; iPhone 8+, iPad 6; i(Pad)OS 13.6
  • Website: https://silverdrag0n.wordpress.com

De
Dewlally
Posts: 10
Joined: Mon Feb 02, 2009 10:31 am

Thu Jun 13, 2019 6:48 pm Post

Silverdragon wrote: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.

User avatar
Silverdragon
Posts: 1534
Joined: Mon Jul 29, 2013 2:52 pm
Platform: Mac + iOS
Location: Tarzana, California, USA
Contact:

Thu Jun 13, 2019 7:11 pm Post

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. ;) 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!
  • Fiction-writer curled up on her TP hoard.
  • Mac Scrivener 3.1.5, MacBook Air 11, MacOS 10.15.6 (Catalina)
  • IOS Scrivener 1.2.1; iPhone 8+, iPad 6; i(Pad)OS 13.6
  • Website: https://silverdrag0n.wordpress.com

wa
warrenao
Posts: 37
Joined: Sat Feb 09, 2013 8:52 pm
Platform: Mac

Sun Jun 30, 2019 3:56 pm Post

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.

De
Dewlally
Posts: 10
Joined: Mon Feb 02, 2009 10:31 am

Sun Jun 30, 2019 7:01 pm Post

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