Is NSSpellChecker’s “ignored words” API meant for use with grammar-checking
results too?
Seems unlikely to me, and yet that’s what appears to be indicated by the
documentation and apparent lack of corresponding “-ignoreGrammar…” API.
The Spelling and Grammar panel sends -ignoreSpelling: when the user clicks
“Ignore” for a grammar-check result, the same as it would do for a spell-check
result. And the implementation example in the -ignoreSpelling: reference
documentation unconditionally invokes -ignoreWord:inSpellDocumentWithTag:
- (void)ignoreSpelling:(id)sender {
[[NSSpellChecker sharedSpellChecker] ignoreWord:[[sender selectedCell]
stringValue] inSpellDocumentWithTag: myDocumentTag];
}
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Protocols/NSIgnoreMisspelledWords_Protocol/
It’s hard to tell whether the same technique is really meant to be applicable
to ignored grammar results, and this bit of documentation wasn’t seen as
needing updating when grammar-checking was added, or whether the documentation
is in need of update.
In the absence of clear info, seems like I should take care to invoke
-ignoreWord:… for spell-check results only. If want to be able to ignore
grammar results, maybe I need to maintain my own grammar “ignore” list and
filter received grammar-check results based on it.
Info appreciated if anyone else has run into this. My searching hasn’t turned
up any answers.
--
Troy Stephens
Developer of TypeMetal: The Visual HTML Editor for OS X
http://coherencelabs.com/typemetal/
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]