#[repr(C)]pub struct NLTagger {
pub ptr: Id<Object>,
}Expand description
A tagger that analyzes natural language text.
Fields§
§ptr: Id<Object>The raw pointer to the Objective-C object.
Implementations§
Source§impl NLTagger
impl NLTagger
Sourcepub fn init_with_tag_schemes(
&mut self,
tag_schemes: NSArray<NLTagScheme>,
) -> Self
pub fn init_with_tag_schemes( &mut self, tag_schemes: NSArray<NLTagScheme>, ) -> Self
Creates a linguistic tagger instance using the specified tag schemes and options.
Sourcepub fn set_string(&mut self, value: Option<NSString>)
pub fn set_string(&mut self, value: Option<NSString>)
Sets the string being analyzed by the linguistic tagger.
Sourcepub fn available_tag_schemes_for_unit_language(
unit: NLTokenUnit,
language: &NLLanguage,
) -> NSArray<NLTagScheme>
pub fn available_tag_schemes_for_unit_language( unit: NLTokenUnit, language: &NLLanguage, ) -> NSArray<NLTagScheme>
Retrieves the tag schemes available for a particular unit (like word or sentence) and language on the current device.
Sourcepub fn request_assets_for_language_tag_scheme_completion_handler<F>(
language: &NLLanguage,
tag_scheme: &NLTagScheme,
completion_hanlder: F,
)
pub fn request_assets_for_language_tag_scheme_completion_handler<F>( language: &NLLanguage, tag_scheme: &NLTagScheme, completion_hanlder: F, )
Asks the Natural Language framework to load any missing assets for a tag scheme onto the device for the given language.
Sourcepub fn tag_schemes(&self) -> NSArray<NLTagScheme>
pub fn tag_schemes(&self) -> NSArray<NLTagScheme>
The tag schemes configured for this linguistic tagger.
Sourcepub fn dominant_language(&self) -> Option<NLLanguage>
pub fn dominant_language(&self) -> Option<NLLanguage>
The dominant language of the string set for the linguistic tagger.
Sourcepub fn set_dominant_language(&self, language: Option<&NLLanguage>)
pub fn set_dominant_language(&self, language: Option<&NLLanguage>)
Sets the dominant language of the string set for the linguistic tagger.
Sourcepub fn set_language_range(&mut self, language: &NLLanguage, range: NSRange)
pub fn set_language_range(&mut self, language: &NLLanguage, range: NSRange)
Sets the language for a range of text within the tagger’s string.
Sourcepub fn set_orthography_range(
&mut self,
orthography: &NSOrthography,
range: NSRange,
)
pub fn set_orthography_range( &mut self, orthography: &NSOrthography, range: NSRange, )
Sets the orthography for the specified range.
Enumerates a block over the tagger’s string, given a range, token unit, and tag scheme.
Finds an array of linguistic tags and token ranges for a given string range and linguistic unit.
Sourcepub fn tag_at_index_unit_scheme_token_range(
&self,
character_index: UInt,
unit: NLTokenUnit,
scheme: &NLTagScheme,
token_range: NSRangePointer,
) -> Option<NLTag>
pub fn tag_at_index_unit_scheme_token_range( &self, character_index: UInt, unit: NLTokenUnit, scheme: &NLTagScheme, token_range: NSRangePointer, ) -> Option<NLTag>
Finds a tag for a given linguistic unit, for a single scheme, at the specified character position.
Sourcepub fn tag_hypotheses_at_index_unit_scheme_maximum_count_token_range(
&self,
character_index: UInt,
unit: NLTokenUnit,
scheme: &NLTagScheme,
maximum_count: UInt,
token_range: Option<NSRangePointer>,
) -> NSDictionary<NLTag, NSNumber>
pub fn tag_hypotheses_at_index_unit_scheme_maximum_count_token_range( &self, character_index: UInt, unit: NLTokenUnit, scheme: &NLTagScheme, maximum_count: UInt, token_range: Option<NSRangePointer>, ) -> NSDictionary<NLTag, NSNumber>
Finds multiple possible tags for a given linguistic unit, for a single scheme, at the specified character position.
Sourcepub fn token_range_at_index_unit(
&self,
character_index: UInt,
unit: NLTokenUnit,
) -> NSRange
pub fn token_range_at_index_unit( &self, character_index: UInt, unit: NLTokenUnit, ) -> NSRange
Returns the range of the linguistic unit containing the specified character index.
Sourcepub fn token_range_for_range_unit(
&self,
range: NSRange,
unit: NLTokenUnit,
) -> NSRange
pub fn token_range_for_range_unit( &self, range: NSRange, unit: NLTokenUnit, ) -> NSRange
Finds the entire range of all tokens of the specified linguistic unit contained completely or partially within the specified range.
Sourcepub fn set_models_for_tag_scheme(
&mut self,
models: &NSArray<NLModel>,
tag_scheme: &NLTagScheme,
)
pub fn set_models_for_tag_scheme( &mut self, models: &NSArray<NLModel>, tag_scheme: &NLTagScheme, )
Assigns models for a tag scheme.
Sourcepub fn models_for_tag_scheme(
&self,
tag_scheme: &NLTagScheme,
) -> NSArray<NLModel>
pub fn models_for_tag_scheme( &self, tag_scheme: &NLTagScheme, ) -> NSArray<NLModel>
Returns the models that apply to the given tag scheme.
Sourcepub fn set_gazetteers_for_tag_scheme(
&mut self,
gazetteers: &NSArray<NLGazetteer>,
tag_scheme: &NLTagScheme,
)
pub fn set_gazetteers_for_tag_scheme( &mut self, gazetteers: &NSArray<NLGazetteer>, tag_scheme: &NLTagScheme, )
Attaches gazetteers to a tag scheme, typically one gazetteer per language or one language-independent gazetteer.
Sourcepub fn gazetteers_for_tag_scheme(
&self,
tag_scheme: &NLTagScheme,
) -> NSArray<NLGazetteer>
pub fn gazetteers_for_tag_scheme( &self, tag_scheme: &NLTagScheme, ) -> NSArray<NLGazetteer>
Retrieves the gazetteers attached to a tag scheme.
Methods from Deref<Target = Object>§
Sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Returns a reference to the ivar of self with the given name.
Panics if self has no ivar with the given name.
Unsafe because the caller must ensure that the ivar is actually
of type T.
Sourcepub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
Returns a mutable reference to the ivar of self with the given name.
Panics if self has no ivar with the given name.
Unsafe because the caller must ensure that the ivar is actually
of type T.