#[repr(C)]pub struct NLLanguageRecognizer {
pub ptr: Id<Object>,
}
Expand description
The language of a body of text.
Fields§
§ptr: Id<Object>
The raw pointer to the Objective-C object.
Implementations§
Source§impl NLLanguageRecognizer
impl NLLanguageRecognizer
Sourcepub fn dominant_language_for_string(
&self,
string: &NSString,
) -> Option<NLLanguage>
pub fn dominant_language_for_string( &self, string: &NSString, ) -> Option<NLLanguage>
Finds the most likely language of a piece of text.
Sourcepub fn process_string(&mut self, string: &NSString)
pub fn process_string(&mut self, string: &NSString)
Analyzes the piece of text to determine its dominant language.
Sourcepub fn dominant_language(&self) -> Option<NSString>
pub fn dominant_language(&self) -> Option<NSString>
The most likely language for the processed text.
Sourcepub fn language_hypotheses_with_maximum(
&self,
max_hypotheses: UInt,
) -> NSDictionary<NLLanguage, NSNumber>
pub fn language_hypotheses_with_maximum( &self, max_hypotheses: UInt, ) -> NSDictionary<NLLanguage, NSNumber>
Generates the probabilities of possible languages for the processed text.
Sourcepub fn language_hints(&self) -> NSDictionary<NLLanguage, NSNumber>
pub fn language_hints(&self) -> NSDictionary<NLLanguage, NSNumber>
A dictionary that maps languages to their probabilities in the language identification process.
Sourcepub fn set_language_hints(
&mut self,
language_hints: &NSDictionary<NLLanguage, NSNumber>,
)
pub fn set_language_hints( &mut self, language_hints: &NSDictionary<NLLanguage, NSNumber>, )
Sets a dictionary that maps languages to their probabilities in the language identification process.
Sourcepub fn language_constraints(&self) -> NSArray<NLLanguage>
pub fn language_constraints(&self) -> NSArray<NLLanguage>
Limits the set of possible languages that the recognizer will return.
Sourcepub fn set_language_constraints(
&mut self,
language_constraints: &NSArray<NLLanguage>,
)
pub fn set_language_constraints( &mut self, language_constraints: &NSArray<NLLanguage>, )
Sets the limits of the set of possible languages that the recognizer will return.
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
.