Re: NSSpellChecker -ignoreWord:… for NSTextCheckingTypeGrammar?
Re: NSSpellChecker -ignoreWord:… for NSTextCheckingTypeGrammar?
- Subject: Re: NSSpellChecker -ignoreWord:… for NSTextCheckingTypeGrammar?
- From: Douglas Davidson <email@hidden>
- Date: Fri, 16 Aug 2013 18:01:32 -0700
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 <email@hidden> 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 (email@hidden)
>
> 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:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden