INLTagger

Trait INLTagger 

Source
pub trait INLTagger: PNSObject {
Show 20 methods // Provided methods fn m_init_with_tag_schemes( &mut self, tag_schemes: NSArray<NLTagScheme>, ) -> Self where Self: Sized + FromId { ... } fn p_string(&self) -> Option<NSString> { ... } fn p_set_string(&mut self, value: Option<NSString>) { ... } fn m_available_tag_schemes_for_unit_language( unit: NLTokenUnit, language: &NLLanguage, ) -> NSArray<NLTagScheme> { ... } fn m_request_assets_for_language_tag_scheme_completion_handler<F>( language: &NLLanguage, tag_scheme: &NLTagScheme, completion_hanlder: F, ) where F: IntoConcreteBlock<(NLTaggerAssetsResult, NSError), Ret = ()> + 'static { ... } fn p_tag_schemes(&self) -> NSArray<NLTagScheme> { ... } fn p_dominant_language(&self) -> Option<NLLanguage> { ... } fn p_set_dominant_language(&self, language: Option<&NLLanguage>) { ... } fn m_set_language_range(&mut self, language: &NLLanguage, range: NSRange) { ... } fn m_set_orthography_range( &mut self, orthography: &NSOrthography, range: NSRange, ) { ... } fn m_enumerate_tags_in_range_unit_scheme_options_using_block<F>( &self, range: NSRange, unit: NLTokenUnit, scheme: &NLTagScheme, options: &[NLTaggerOptions], block: F, ) where F: IntoConcreteBlock<(NLTag, NSRange, *mut bool), Ret = ()> + 'static { ... } fn m_tags_in_range_unit_scheme_options_token_ranges( &self, range: NSRange, unit: NLTokenUnit, scheme: &NLTagScheme, options: &[NLTaggerOptions], token_ranges: &mut NSArray<NSValue>, ) -> NSArray<NLTag> { ... } fn m_tag_at_index_unit_scheme_token_range( &self, character_index: UInt, unit: NLTokenUnit, scheme: &NLTagScheme, token_range: NSRangePointer, ) -> Option<NLTag> { ... } fn m_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> { ... } fn m_token_range_at_index_unit( &self, character_index: UInt, unit: NLTokenUnit, ) -> NSRange { ... } fn m_token_range_for_range_unit( &self, range: NSRange, unit: NLTokenUnit, ) -> NSRange { ... } fn m_set_models_for_tag_scheme( &mut self, models: &NSArray<NLModel>, tag_scheme: &NLTagScheme, ) { ... } fn m_models_for_tag_scheme( &self, tag_scheme: &NLTagScheme, ) -> NSArray<NLModel> { ... } fn m_set_gazetteers_for_tag_scheme( &mut self, gazetteers: &NSArray<NLGazetteer>, tag_scheme: &NLTagScheme, ) { ... } fn m_gazetteers_for_tag_scheme( &self, tag_scheme: &NLTagScheme, ) -> NSArray<NLGazetteer> { ... }
}
Expand description

A trait containing all the methods for NLTagger

Provided Methods§

Source

fn m_init_with_tag_schemes(&mut self, tag_schemes: NSArray<NLTagScheme>) -> Self
where Self: Sized + FromId,

Creates a linguistic tagger instance using the specified tag schemes and options.

Source

fn p_string(&self) -> Option<NSString>

The string being analyzed by the linguistic tagger.

Source

fn p_set_string(&mut self, value: Option<NSString>)

Sets the string being analyzed by the linguistic tagger.

Source

fn m_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.

Source

fn m_request_assets_for_language_tag_scheme_completion_handler<F>( language: &NLLanguage, tag_scheme: &NLTagScheme, completion_hanlder: F, )
where F: IntoConcreteBlock<(NLTaggerAssetsResult, NSError), Ret = ()> + 'static,

Asks the Natural Language framework to load any missing assets for a tag scheme onto the device for the given language.

Source

fn p_tag_schemes(&self) -> NSArray<NLTagScheme>

The tag schemes configured for this linguistic tagger.

Source

fn p_dominant_language(&self) -> Option<NLLanguage>

The dominant language of the string set for the linguistic tagger.

Source

fn p_set_dominant_language(&self, language: Option<&NLLanguage>)

Sets the dominant language of the string set for the linguistic tagger.

Source

fn m_set_language_range(&mut self, language: &NLLanguage, range: NSRange)

Sets the language for a range of text within the tagger’s string.

Source

fn m_set_orthography_range( &mut self, orthography: &NSOrthography, range: NSRange, )

Sets the orthography for the specified range.

Source

fn m_enumerate_tags_in_range_unit_scheme_options_using_block<F>( &self, range: NSRange, unit: NLTokenUnit, scheme: &NLTagScheme, options: &[NLTaggerOptions], block: F, )
where F: IntoConcreteBlock<(NLTag, NSRange, *mut bool), Ret = ()> + 'static,

Enumerates a block over the tagger’s string, given a range, token unit, and tag scheme.

Source

fn m_tags_in_range_unit_scheme_options_token_ranges( &self, range: NSRange, unit: NLTokenUnit, scheme: &NLTagScheme, options: &[NLTaggerOptions], token_ranges: &mut NSArray<NSValue>, ) -> NSArray<NLTag>

Finds an array of linguistic tags and token ranges for a given string range and linguistic unit.

Source

fn m_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.

Source

fn m_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.

Source

fn m_token_range_at_index_unit( &self, character_index: UInt, unit: NLTokenUnit, ) -> NSRange

Returns the range of the linguistic unit containing the specified character index.

Source

fn m_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.

Source

fn m_set_models_for_tag_scheme( &mut self, models: &NSArray<NLModel>, tag_scheme: &NLTagScheme, )

Assigns models for a tag scheme.

Source

fn m_models_for_tag_scheme(&self, tag_scheme: &NLTagScheme) -> NSArray<NLModel>

Returns the models that apply to the given tag scheme.

Source

fn m_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.

Source

fn m_gazetteers_for_tag_scheme( &self, tag_scheme: &NLTagScheme, ) -> NSArray<NLGazetteer>

Retrieves the gazetteers attached to a tag scheme.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§