Troy, you can file an enhancement request specifically for an "ignore grammar" 
API, but currently how it works is that if the last shown checking result is a 
grammar checking result, then ignoring the word underlined by that result will 
cause that grammar checking result to be ignored.

It would be perfectly reasonable for you to maintain your own ignore list and 
filter grammar-check results based on it.

Douglas Davidson

On Aug 8, 2013, at 7:41 AM, Troy Stephens <troy_steph...@mac.com> wrote:

> 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 (Cocoa-dev@lists.apple.com)
> 
> 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/ddavidso%40apple.com
> 
> This email sent to ddavi...@apple.com


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to