//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagscheme?language=objc)
// NS_TYPED_EXTENSIBLE_ENUM
#[cfg(feature = "NSString")]
pub type NSLinguisticTagScheme = NSString;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagschemetokentype?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagSchemeTokenType: &'static NSLinguisticTagScheme;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagschemelexicalclass?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagSchemeLexicalClass: &'static NSLinguisticTagScheme;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagschemenametype?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagSchemeNameType: &'static NSLinguisticTagScheme;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagschemenametypeorlexicalclass?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagSchemeNameTypeOrLexicalClass: &'static NSLinguisticTagScheme;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagschemelemma?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagSchemeLemma: &'static NSLinguisticTagScheme;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagschemelanguage?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagSchemeLanguage: &'static NSLinguisticTagScheme;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagschemescript?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagSchemeScript: &'static NSLinguisticTagScheme;
}

/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictag?language=objc)
// NS_TYPED_EXTENSIBLE_ENUM
#[cfg(feature = "NSString")]
pub type NSLinguisticTag = NSString;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagword?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagWord: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagpunctuation?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagPunctuation: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagwhitespace?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagWhitespace: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagother?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagOther: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagnoun?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagNoun: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagverb?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagVerb: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagadjective?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagAdjective: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagadverb?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagAdverb: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagpronoun?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagPronoun: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagdeterminer?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagDeterminer: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagparticle?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagParticle: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagpreposition?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagPreposition: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagnumber?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagNumber: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagconjunction?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagConjunction: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictaginterjection?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagInterjection: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagclassifier?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagClassifier: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagidiom?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagIdiom: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagotherword?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagOtherWord: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagsentenceterminator?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagSentenceTerminator: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagopenquote?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagOpenQuote: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagclosequote?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagCloseQuote: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagopenparenthesis?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagOpenParenthesis: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagcloseparenthesis?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagCloseParenthesis: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagwordjoiner?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagWordJoiner: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagdash?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagDash: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagotherpunctuation?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagOtherPunctuation: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagparagraphbreak?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagParagraphBreak: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagotherwhitespace?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagOtherWhitespace: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagpersonalname?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagPersonalName: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagplacename?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagPlaceName: &'static NSLinguisticTag;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagorganizationname?language=objc)
    #[cfg(feature = "NSString")]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub static NSLinguisticTagOrganizationName: &'static NSLinguisticTag;
}

/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictaggerunit?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSLinguisticTaggerUnit(pub NSInteger);
impl NSLinguisticTaggerUnit {
    #[doc(alias = "NSLinguisticTaggerUnitWord")]
    pub const Word: Self = Self(0);
    #[doc(alias = "NSLinguisticTaggerUnitSentence")]
    pub const Sentence: Self = Self(1);
    #[doc(alias = "NSLinguisticTaggerUnitParagraph")]
    pub const Paragraph: Self = Self(2);
    #[doc(alias = "NSLinguisticTaggerUnitDocument")]
    pub const Document: Self = Self(3);
}

unsafe impl Encode for NSLinguisticTaggerUnit {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for NSLinguisticTaggerUnit {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictaggeroptions?language=objc)
// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSLinguisticTaggerOptions(pub NSUInteger);
bitflags::bitflags! {
    impl NSLinguisticTaggerOptions: NSUInteger {
        #[doc(alias = "NSLinguisticTaggerOmitWords")]
        const OmitWords = 1<<0;
        #[doc(alias = "NSLinguisticTaggerOmitPunctuation")]
        const OmitPunctuation = 1<<1;
        #[doc(alias = "NSLinguisticTaggerOmitWhitespace")]
        const OmitWhitespace = 1<<2;
        #[doc(alias = "NSLinguisticTaggerOmitOther")]
        const OmitOther = 1<<3;
        #[doc(alias = "NSLinguisticTaggerJoinNames")]
        const JoinNames = 1<<4;
    }
}

unsafe impl Encode for NSLinguisticTaggerOptions {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for NSLinguisticTaggerOptions {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslinguistictagger?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
    pub struct NSLinguisticTagger;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for NSLinguisticTagger {}
);

impl NSLinguisticTagger {
    extern_methods!(
        #[cfg(all(feature = "NSArray", feature = "NSString"))]
        #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
        #[unsafe(method(initWithTagSchemes:options:))]
        #[unsafe(method_family = init)]
        pub fn initWithTagSchemes_options(
            this: Allocated<Self>,
            tag_schemes: &NSArray<NSLinguisticTagScheme>,
            opts: NSUInteger,
        ) -> Retained<Self>;

        #[cfg(all(feature = "NSArray", feature = "NSString"))]
        #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
        #[unsafe(method(tagSchemes))]
        #[unsafe(method_family = none)]
        pub fn tagSchemes(&self) -> Retained<NSArray<NSLinguisticTagScheme>>;

        #[cfg(feature = "NSString")]
        #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
        #[unsafe(method(string))]
        #[unsafe(method_family = none)]
        pub fn string(&self) -> Option<Retained<NSString>>;

        #[cfg(feature = "NSString")]
        /// Setter for [`string`][Self::string].
        #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
        #[unsafe(method(setString:))]
        #[unsafe(method_family = none)]
        pub fn setString(&self, string: Option<&NSString>);

        #[cfg(all(feature = "NSArray", feature = "NSString"))]
        #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
        #[unsafe(method(availableTagSchemesForUnit:language:))]
        #[unsafe(method_family = none)]
        pub fn availableTagSchemesForUnit_language(
            unit: NSLinguisticTaggerUnit,
            language: &NSString,
        ) -> Retained<NSArray<NSLinguisticTagScheme>>;

        #[cfg(all(feature = "NSArray", feature = "NSString"))]
        #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
        #[unsafe(method(availableTagSchemesForLanguage:))]
        #[unsafe(method_family = none)]
        pub fn availableTagSchemesForLanguage(
            language: &NSString,
        ) -> Retained<NSArray<NSLinguisticTagScheme>>;

        #[cfg(all(feature = "NSOrthography", feature = "NSRange"))]
        #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
        #[unsafe(method(setOrthography:range:))]
        #[unsafe(method_family = none)]
        pub fn setOrthography_range(&self, orthography: Option<&NSOrthography>, range: NSRange);

        #[cfg(all(feature = "NSOrthography", feature = "NSRange"))]
        /// # Safety
        ///
        /// `effective_range` must be a valid pointer or null.
        #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
        #[unsafe(method(orthographyAtIndex:effectiveRange:))]
        #[unsafe(method_family = none)]
        pub unsafe fn orthographyAtIndex_effectiveRange(
            &self,
            char_index: NSUInteger,
            effective_range: NSRangePointer,
        ) -> Option<Retained<NSOrthography>>;

        #[cfg(feature = "NSRange")]
        #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
        #[unsafe(method(stringEditedInRange:changeInLength:))]
        #[unsafe(method_family = none)]
        pub fn stringEditedInRange_changeInLength(&self, new_range: NSRange, delta: NSInteger);

        #[cfg(feature = "NSRange")]
        #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
        #[unsafe(method(tokenRangeAtIndex:unit:))]
        #[unsafe(method_family = none)]
        pub fn tokenRangeAtIndex_unit(
            &self,
            char_index: NSUInteger,
            unit: NSLinguisticTaggerUnit,
        ) -> NSRange;

        #[cfg(feature = "NSRange")]
        #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
        #[unsafe(method(sentenceRangeForRange:))]
        #[unsafe(method_family = none)]
        pub fn sentenceRangeForRange(&self, range: NSRange) -> NSRange;

        #[cfg(all(feature = "NSRange", feature = "NSString", feature = "block2"))]
        #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
        #[unsafe(method(enumerateTagsInRange:unit:scheme:options:usingBlock:))]
        #[unsafe(method_family = none)]
        pub fn enumerateTagsInRange_unit_scheme_options_usingBlock(
            &self,
            range: NSRange,
            unit: NSLinguisticTaggerUnit,
            scheme: &NSLinguisticTagScheme,
            options: NSLinguisticTaggerOptions,
            block: &block2::DynBlock<dyn Fn(*mut NSLinguisticTag, NSRange, NonNull<Bool>) + '_>,
        );

        #[cfg(all(feature = "NSRange", feature = "NSString"))]
        /// # Safety
        ///
        /// `token_range` must be a valid pointer or null.
        #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
        #[unsafe(method(tagAtIndex:unit:scheme:tokenRange:))]
        #[unsafe(method_family = none)]
        pub unsafe fn tagAtIndex_unit_scheme_tokenRange(
            &self,
            char_index: NSUInteger,
            unit: NSLinguisticTaggerUnit,
            scheme: &NSLinguisticTagScheme,
            token_range: NSRangePointer,
        ) -> Option<Retained<NSLinguisticTag>>;

        #[cfg(all(
            feature = "NSArray",
            feature = "NSRange",
            feature = "NSString",
            feature = "NSValue"
        ))]
        #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
        #[unsafe(method(tagsInRange:unit:scheme:options:tokenRanges:))]
        #[unsafe(method_family = none)]
        pub fn tagsInRange_unit_scheme_options_tokenRanges(
            &self,
            range: NSRange,
            unit: NSLinguisticTaggerUnit,
            scheme: &NSLinguisticTagScheme,
            options: NSLinguisticTaggerOptions,
            token_ranges: Option<&mut Option<Retained<NSArray<NSValue>>>>,
        ) -> Retained<NSArray<NSLinguisticTag>>;

        #[cfg(all(feature = "NSRange", feature = "NSString", feature = "block2"))]
        #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
        #[unsafe(method(enumerateTagsInRange:scheme:options:usingBlock:))]
        #[unsafe(method_family = none)]
        pub fn enumerateTagsInRange_scheme_options_usingBlock(
            &self,
            range: NSRange,
            tag_scheme: &NSLinguisticTagScheme,
            opts: NSLinguisticTaggerOptions,
            block: &block2::DynBlock<
                dyn Fn(*mut NSLinguisticTag, NSRange, NSRange, NonNull<Bool>) + '_,
            >,
        );

        #[cfg(all(feature = "NSRange", feature = "NSString"))]
        /// # Safety
        ///
        /// - `token_range` must be a valid pointer or null.
        /// - `sentence_range` must be a valid pointer or null.
        #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
        #[unsafe(method(tagAtIndex:scheme:tokenRange:sentenceRange:))]
        #[unsafe(method_family = none)]
        pub unsafe fn tagAtIndex_scheme_tokenRange_sentenceRange(
            &self,
            char_index: NSUInteger,
            scheme: &NSLinguisticTagScheme,
            token_range: NSRangePointer,
            sentence_range: NSRangePointer,
        ) -> Option<Retained<NSLinguisticTag>>;

        #[cfg(all(
            feature = "NSArray",
            feature = "NSRange",
            feature = "NSString",
            feature = "NSValue"
        ))]
        #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
        #[unsafe(method(tagsInRange:scheme:options:tokenRanges:))]
        #[unsafe(method_family = none)]
        pub fn tagsInRange_scheme_options_tokenRanges(
            &self,
            range: NSRange,
            tag_scheme: &NSString,
            opts: NSLinguisticTaggerOptions,
            token_ranges: Option<&mut Option<Retained<NSArray<NSValue>>>>,
        ) -> Retained<NSArray<NSString>>;

        #[cfg(feature = "NSString")]
        #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
        #[unsafe(method(dominantLanguage))]
        #[unsafe(method_family = none)]
        pub fn dominantLanguage(&self) -> Option<Retained<NSString>>;

        #[cfg(feature = "NSString")]
        #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
        #[unsafe(method(dominantLanguageForString:))]
        #[unsafe(method_family = none)]
        pub fn dominantLanguageForString(string: &NSString) -> Option<Retained<NSString>>;

        #[cfg(all(feature = "NSOrthography", feature = "NSRange", feature = "NSString"))]
        /// # Safety
        ///
        /// `token_range` must be a valid pointer or null.
        #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
        #[unsafe(method(tagForString:atIndex:unit:scheme:orthography:tokenRange:))]
        #[unsafe(method_family = none)]
        pub unsafe fn tagForString_atIndex_unit_scheme_orthography_tokenRange(
            string: &NSString,
            char_index: NSUInteger,
            unit: NSLinguisticTaggerUnit,
            scheme: &NSLinguisticTagScheme,
            orthography: Option<&NSOrthography>,
            token_range: NSRangePointer,
        ) -> Option<Retained<NSLinguisticTag>>;

        #[cfg(all(
            feature = "NSArray",
            feature = "NSOrthography",
            feature = "NSRange",
            feature = "NSString",
            feature = "NSValue"
        ))]
        #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
        #[unsafe(method(tagsForString:range:unit:scheme:options:orthography:tokenRanges:))]
        #[unsafe(method_family = none)]
        pub fn tagsForString_range_unit_scheme_options_orthography_tokenRanges(
            string: &NSString,
            range: NSRange,
            unit: NSLinguisticTaggerUnit,
            scheme: &NSLinguisticTagScheme,
            options: NSLinguisticTaggerOptions,
            orthography: Option<&NSOrthography>,
            token_ranges: Option<&mut Option<Retained<NSArray<NSValue>>>>,
        ) -> Retained<NSArray<NSLinguisticTag>>;

        #[cfg(all(
            feature = "NSOrthography",
            feature = "NSRange",
            feature = "NSString",
            feature = "block2"
        ))]
        #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
        #[unsafe(method(enumerateTagsForString:range:unit:scheme:options:orthography:usingBlock:))]
        #[unsafe(method_family = none)]
        pub fn enumerateTagsForString_range_unit_scheme_options_orthography_usingBlock(
            string: &NSString,
            range: NSRange,
            unit: NSLinguisticTaggerUnit,
            scheme: &NSLinguisticTagScheme,
            options: NSLinguisticTaggerOptions,
            orthography: Option<&NSOrthography>,
            block: &block2::DynBlock<dyn Fn(*mut NSLinguisticTag, NSRange, NonNull<Bool>) + '_>,
        );

        #[cfg(all(
            feature = "NSArray",
            feature = "NSRange",
            feature = "NSString",
            feature = "NSValue"
        ))]
        /// # Safety
        ///
        /// - `token_range` must be a valid pointer or null.
        /// - `sentence_range` must be a valid pointer or null.
        #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
        #[unsafe(method(possibleTagsAtIndex:scheme:tokenRange:sentenceRange:scores:))]
        #[unsafe(method_family = none)]
        pub unsafe fn possibleTagsAtIndex_scheme_tokenRange_sentenceRange_scores(
            &self,
            char_index: NSUInteger,
            tag_scheme: &NSString,
            token_range: NSRangePointer,
            sentence_range: NSRangePointer,
            scores: Option<&mut Option<Retained<NSArray<NSValue>>>>,
        ) -> Option<Retained<NSArray<NSString>>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl NSLinguisticTagger {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for NSLinguisticTagger {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}

/// NSLinguisticAnalysis.
#[cfg(feature = "NSString")]
impl NSString {
    extern_methods!(
        #[cfg(all(
            feature = "NSArray",
            feature = "NSOrthography",
            feature = "NSRange",
            feature = "NSValue"
        ))]
        #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
        #[unsafe(method(linguisticTagsInRange:scheme:options:orthography:tokenRanges:))]
        #[unsafe(method_family = none)]
        pub fn linguisticTagsInRange_scheme_options_orthography_tokenRanges(
            &self,
            range: NSRange,
            scheme: &NSLinguisticTagScheme,
            options: NSLinguisticTaggerOptions,
            orthography: Option<&NSOrthography>,
            token_ranges: Option<&mut Option<Retained<NSArray<NSValue>>>>,
        ) -> Retained<NSArray<NSLinguisticTag>>;

        #[cfg(all(feature = "NSOrthography", feature = "NSRange", feature = "block2"))]
        #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
        #[unsafe(method(enumerateLinguisticTagsInRange:scheme:options:orthography:usingBlock:))]
        #[unsafe(method_family = none)]
        pub fn enumerateLinguisticTagsInRange_scheme_options_orthography_usingBlock(
            &self,
            range: NSRange,
            scheme: &NSLinguisticTagScheme,
            options: NSLinguisticTaggerOptions,
            orthography: Option<&NSOrthography>,
            block: &block2::DynBlock<
                dyn Fn(*mut NSLinguisticTag, NSRange, NSRange, NonNull<Bool>) + '_,
            >,
        );
    );
}
