objc2_foundation/generated/
NSLinguisticTagger.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9#[cfg(feature = "NSString")]
12pub type NSLinguisticTagScheme = NSString;
13
14extern "C" {
15 #[cfg(feature = "NSString")]
17 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
18 pub static NSLinguisticTagSchemeTokenType: &'static NSLinguisticTagScheme;
19}
20
21extern "C" {
22 #[cfg(feature = "NSString")]
24 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
25 pub static NSLinguisticTagSchemeLexicalClass: &'static NSLinguisticTagScheme;
26}
27
28extern "C" {
29 #[cfg(feature = "NSString")]
31 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
32 pub static NSLinguisticTagSchemeNameType: &'static NSLinguisticTagScheme;
33}
34
35extern "C" {
36 #[cfg(feature = "NSString")]
38 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
39 pub static NSLinguisticTagSchemeNameTypeOrLexicalClass: &'static NSLinguisticTagScheme;
40}
41
42extern "C" {
43 #[cfg(feature = "NSString")]
45 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
46 pub static NSLinguisticTagSchemeLemma: &'static NSLinguisticTagScheme;
47}
48
49extern "C" {
50 #[cfg(feature = "NSString")]
52 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
53 pub static NSLinguisticTagSchemeLanguage: &'static NSLinguisticTagScheme;
54}
55
56extern "C" {
57 #[cfg(feature = "NSString")]
59 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
60 pub static NSLinguisticTagSchemeScript: &'static NSLinguisticTagScheme;
61}
62
63#[cfg(feature = "NSString")]
66pub type NSLinguisticTag = NSString;
67
68extern "C" {
69 #[cfg(feature = "NSString")]
71 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
72 pub static NSLinguisticTagWord: &'static NSLinguisticTag;
73}
74
75extern "C" {
76 #[cfg(feature = "NSString")]
78 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
79 pub static NSLinguisticTagPunctuation: &'static NSLinguisticTag;
80}
81
82extern "C" {
83 #[cfg(feature = "NSString")]
85 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
86 pub static NSLinguisticTagWhitespace: &'static NSLinguisticTag;
87}
88
89extern "C" {
90 #[cfg(feature = "NSString")]
92 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
93 pub static NSLinguisticTagOther: &'static NSLinguisticTag;
94}
95
96extern "C" {
97 #[cfg(feature = "NSString")]
99 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
100 pub static NSLinguisticTagNoun: &'static NSLinguisticTag;
101}
102
103extern "C" {
104 #[cfg(feature = "NSString")]
106 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
107 pub static NSLinguisticTagVerb: &'static NSLinguisticTag;
108}
109
110extern "C" {
111 #[cfg(feature = "NSString")]
113 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
114 pub static NSLinguisticTagAdjective: &'static NSLinguisticTag;
115}
116
117extern "C" {
118 #[cfg(feature = "NSString")]
120 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
121 pub static NSLinguisticTagAdverb: &'static NSLinguisticTag;
122}
123
124extern "C" {
125 #[cfg(feature = "NSString")]
127 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
128 pub static NSLinguisticTagPronoun: &'static NSLinguisticTag;
129}
130
131extern "C" {
132 #[cfg(feature = "NSString")]
134 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
135 pub static NSLinguisticTagDeterminer: &'static NSLinguisticTag;
136}
137
138extern "C" {
139 #[cfg(feature = "NSString")]
141 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
142 pub static NSLinguisticTagParticle: &'static NSLinguisticTag;
143}
144
145extern "C" {
146 #[cfg(feature = "NSString")]
148 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
149 pub static NSLinguisticTagPreposition: &'static NSLinguisticTag;
150}
151
152extern "C" {
153 #[cfg(feature = "NSString")]
155 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
156 pub static NSLinguisticTagNumber: &'static NSLinguisticTag;
157}
158
159extern "C" {
160 #[cfg(feature = "NSString")]
162 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
163 pub static NSLinguisticTagConjunction: &'static NSLinguisticTag;
164}
165
166extern "C" {
167 #[cfg(feature = "NSString")]
169 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
170 pub static NSLinguisticTagInterjection: &'static NSLinguisticTag;
171}
172
173extern "C" {
174 #[cfg(feature = "NSString")]
176 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
177 pub static NSLinguisticTagClassifier: &'static NSLinguisticTag;
178}
179
180extern "C" {
181 #[cfg(feature = "NSString")]
183 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
184 pub static NSLinguisticTagIdiom: &'static NSLinguisticTag;
185}
186
187extern "C" {
188 #[cfg(feature = "NSString")]
190 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
191 pub static NSLinguisticTagOtherWord: &'static NSLinguisticTag;
192}
193
194extern "C" {
195 #[cfg(feature = "NSString")]
197 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
198 pub static NSLinguisticTagSentenceTerminator: &'static NSLinguisticTag;
199}
200
201extern "C" {
202 #[cfg(feature = "NSString")]
204 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
205 pub static NSLinguisticTagOpenQuote: &'static NSLinguisticTag;
206}
207
208extern "C" {
209 #[cfg(feature = "NSString")]
211 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
212 pub static NSLinguisticTagCloseQuote: &'static NSLinguisticTag;
213}
214
215extern "C" {
216 #[cfg(feature = "NSString")]
218 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
219 pub static NSLinguisticTagOpenParenthesis: &'static NSLinguisticTag;
220}
221
222extern "C" {
223 #[cfg(feature = "NSString")]
225 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
226 pub static NSLinguisticTagCloseParenthesis: &'static NSLinguisticTag;
227}
228
229extern "C" {
230 #[cfg(feature = "NSString")]
232 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
233 pub static NSLinguisticTagWordJoiner: &'static NSLinguisticTag;
234}
235
236extern "C" {
237 #[cfg(feature = "NSString")]
239 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
240 pub static NSLinguisticTagDash: &'static NSLinguisticTag;
241}
242
243extern "C" {
244 #[cfg(feature = "NSString")]
246 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
247 pub static NSLinguisticTagOtherPunctuation: &'static NSLinguisticTag;
248}
249
250extern "C" {
251 #[cfg(feature = "NSString")]
253 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
254 pub static NSLinguisticTagParagraphBreak: &'static NSLinguisticTag;
255}
256
257extern "C" {
258 #[cfg(feature = "NSString")]
260 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
261 pub static NSLinguisticTagOtherWhitespace: &'static NSLinguisticTag;
262}
263
264extern "C" {
265 #[cfg(feature = "NSString")]
267 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
268 pub static NSLinguisticTagPersonalName: &'static NSLinguisticTag;
269}
270
271extern "C" {
272 #[cfg(feature = "NSString")]
274 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
275 pub static NSLinguisticTagPlaceName: &'static NSLinguisticTag;
276}
277
278extern "C" {
279 #[cfg(feature = "NSString")]
281 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
282 pub static NSLinguisticTagOrganizationName: &'static NSLinguisticTag;
283}
284
285#[repr(transparent)]
288#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
289pub struct NSLinguisticTaggerUnit(pub NSInteger);
290impl NSLinguisticTaggerUnit {
291 #[doc(alias = "NSLinguisticTaggerUnitWord")]
292 pub const Word: Self = Self(0);
293 #[doc(alias = "NSLinguisticTaggerUnitSentence")]
294 pub const Sentence: Self = Self(1);
295 #[doc(alias = "NSLinguisticTaggerUnitParagraph")]
296 pub const Paragraph: Self = Self(2);
297 #[doc(alias = "NSLinguisticTaggerUnitDocument")]
298 pub const Document: Self = Self(3);
299}
300
301unsafe impl Encode for NSLinguisticTaggerUnit {
302 const ENCODING: Encoding = NSInteger::ENCODING;
303}
304
305unsafe impl RefEncode for NSLinguisticTaggerUnit {
306 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
307}
308
309#[repr(transparent)]
312#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
313pub struct NSLinguisticTaggerOptions(pub NSUInteger);
314bitflags::bitflags! {
315 impl NSLinguisticTaggerOptions: NSUInteger {
316 #[doc(alias = "NSLinguisticTaggerOmitWords")]
317 const OmitWords = 1<<0;
318 #[doc(alias = "NSLinguisticTaggerOmitPunctuation")]
319 const OmitPunctuation = 1<<1;
320 #[doc(alias = "NSLinguisticTaggerOmitWhitespace")]
321 const OmitWhitespace = 1<<2;
322 #[doc(alias = "NSLinguisticTaggerOmitOther")]
323 const OmitOther = 1<<3;
324 #[doc(alias = "NSLinguisticTaggerJoinNames")]
325 const JoinNames = 1<<4;
326 }
327}
328
329unsafe impl Encode for NSLinguisticTaggerOptions {
330 const ENCODING: Encoding = NSUInteger::ENCODING;
331}
332
333unsafe impl RefEncode for NSLinguisticTaggerOptions {
334 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
335}
336
337extern_class!(
338 #[unsafe(super(NSObject))]
340 #[derive(Debug, PartialEq, Eq, Hash)]
341 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
342 pub struct NSLinguisticTagger;
343);
344
345extern_conformance!(
346 unsafe impl NSObjectProtocol for NSLinguisticTagger {}
347);
348
349impl NSLinguisticTagger {
350 extern_methods!(
351 #[cfg(all(feature = "NSArray", feature = "NSString"))]
352 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
353 #[unsafe(method(initWithTagSchemes:options:))]
354 #[unsafe(method_family = init)]
355 pub fn initWithTagSchemes_options(
356 this: Allocated<Self>,
357 tag_schemes: &NSArray<NSLinguisticTagScheme>,
358 opts: NSUInteger,
359 ) -> Retained<Self>;
360
361 #[cfg(all(feature = "NSArray", feature = "NSString"))]
362 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
363 #[unsafe(method(tagSchemes))]
364 #[unsafe(method_family = none)]
365 pub fn tagSchemes(&self) -> Retained<NSArray<NSLinguisticTagScheme>>;
366
367 #[cfg(feature = "NSString")]
368 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
369 #[unsafe(method(string))]
370 #[unsafe(method_family = none)]
371 pub fn string(&self) -> Option<Retained<NSString>>;
372
373 #[cfg(feature = "NSString")]
374 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
376 #[unsafe(method(setString:))]
377 #[unsafe(method_family = none)]
378 pub fn setString(&self, string: Option<&NSString>);
379
380 #[cfg(all(feature = "NSArray", feature = "NSString"))]
381 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
382 #[unsafe(method(availableTagSchemesForUnit:language:))]
383 #[unsafe(method_family = none)]
384 pub fn availableTagSchemesForUnit_language(
385 unit: NSLinguisticTaggerUnit,
386 language: &NSString,
387 ) -> Retained<NSArray<NSLinguisticTagScheme>>;
388
389 #[cfg(all(feature = "NSArray", feature = "NSString"))]
390 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
391 #[unsafe(method(availableTagSchemesForLanguage:))]
392 #[unsafe(method_family = none)]
393 pub fn availableTagSchemesForLanguage(
394 language: &NSString,
395 ) -> Retained<NSArray<NSLinguisticTagScheme>>;
396
397 #[cfg(all(feature = "NSOrthography", feature = "NSRange"))]
398 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
399 #[unsafe(method(setOrthography:range:))]
400 #[unsafe(method_family = none)]
401 pub fn setOrthography_range(&self, orthography: Option<&NSOrthography>, range: NSRange);
402
403 #[cfg(all(feature = "NSOrthography", feature = "NSRange"))]
404 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
408 #[unsafe(method(orthographyAtIndex:effectiveRange:))]
409 #[unsafe(method_family = none)]
410 pub unsafe fn orthographyAtIndex_effectiveRange(
411 &self,
412 char_index: NSUInteger,
413 effective_range: NSRangePointer,
414 ) -> Option<Retained<NSOrthography>>;
415
416 #[cfg(feature = "NSRange")]
417 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
418 #[unsafe(method(stringEditedInRange:changeInLength:))]
419 #[unsafe(method_family = none)]
420 pub fn stringEditedInRange_changeInLength(&self, new_range: NSRange, delta: NSInteger);
421
422 #[cfg(feature = "NSRange")]
423 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
424 #[unsafe(method(tokenRangeAtIndex:unit:))]
425 #[unsafe(method_family = none)]
426 pub fn tokenRangeAtIndex_unit(
427 &self,
428 char_index: NSUInteger,
429 unit: NSLinguisticTaggerUnit,
430 ) -> NSRange;
431
432 #[cfg(feature = "NSRange")]
433 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
434 #[unsafe(method(sentenceRangeForRange:))]
435 #[unsafe(method_family = none)]
436 pub fn sentenceRangeForRange(&self, range: NSRange) -> NSRange;
437
438 #[cfg(all(feature = "NSRange", feature = "NSString", feature = "block2"))]
439 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
440 #[unsafe(method(enumerateTagsInRange:unit:scheme:options:usingBlock:))]
441 #[unsafe(method_family = none)]
442 pub fn enumerateTagsInRange_unit_scheme_options_usingBlock(
443 &self,
444 range: NSRange,
445 unit: NSLinguisticTaggerUnit,
446 scheme: &NSLinguisticTagScheme,
447 options: NSLinguisticTaggerOptions,
448 block: &block2::DynBlock<dyn Fn(*mut NSLinguisticTag, NSRange, NonNull<Bool>) + '_>,
449 );
450
451 #[cfg(all(feature = "NSRange", feature = "NSString"))]
452 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
456 #[unsafe(method(tagAtIndex:unit:scheme:tokenRange:))]
457 #[unsafe(method_family = none)]
458 pub unsafe fn tagAtIndex_unit_scheme_tokenRange(
459 &self,
460 char_index: NSUInteger,
461 unit: NSLinguisticTaggerUnit,
462 scheme: &NSLinguisticTagScheme,
463 token_range: NSRangePointer,
464 ) -> Option<Retained<NSLinguisticTag>>;
465
466 #[cfg(all(
467 feature = "NSArray",
468 feature = "NSRange",
469 feature = "NSString",
470 feature = "NSValue"
471 ))]
472 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
473 #[unsafe(method(tagsInRange:unit:scheme:options:tokenRanges:))]
474 #[unsafe(method_family = none)]
475 pub fn tagsInRange_unit_scheme_options_tokenRanges(
476 &self,
477 range: NSRange,
478 unit: NSLinguisticTaggerUnit,
479 scheme: &NSLinguisticTagScheme,
480 options: NSLinguisticTaggerOptions,
481 token_ranges: Option<&mut Option<Retained<NSArray<NSValue>>>>,
482 ) -> Retained<NSArray<NSLinguisticTag>>;
483
484 #[cfg(all(feature = "NSRange", feature = "NSString", feature = "block2"))]
485 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
486 #[unsafe(method(enumerateTagsInRange:scheme:options:usingBlock:))]
487 #[unsafe(method_family = none)]
488 pub fn enumerateTagsInRange_scheme_options_usingBlock(
489 &self,
490 range: NSRange,
491 tag_scheme: &NSLinguisticTagScheme,
492 opts: NSLinguisticTaggerOptions,
493 block: &block2::DynBlock<
494 dyn Fn(*mut NSLinguisticTag, NSRange, NSRange, NonNull<Bool>) + '_,
495 >,
496 );
497
498 #[cfg(all(feature = "NSRange", feature = "NSString"))]
499 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
504 #[unsafe(method(tagAtIndex:scheme:tokenRange:sentenceRange:))]
505 #[unsafe(method_family = none)]
506 pub unsafe fn tagAtIndex_scheme_tokenRange_sentenceRange(
507 &self,
508 char_index: NSUInteger,
509 scheme: &NSLinguisticTagScheme,
510 token_range: NSRangePointer,
511 sentence_range: NSRangePointer,
512 ) -> Option<Retained<NSLinguisticTag>>;
513
514 #[cfg(all(
515 feature = "NSArray",
516 feature = "NSRange",
517 feature = "NSString",
518 feature = "NSValue"
519 ))]
520 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
521 #[unsafe(method(tagsInRange:scheme:options:tokenRanges:))]
522 #[unsafe(method_family = none)]
523 pub fn tagsInRange_scheme_options_tokenRanges(
524 &self,
525 range: NSRange,
526 tag_scheme: &NSString,
527 opts: NSLinguisticTaggerOptions,
528 token_ranges: Option<&mut Option<Retained<NSArray<NSValue>>>>,
529 ) -> Retained<NSArray<NSString>>;
530
531 #[cfg(feature = "NSString")]
532 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
533 #[unsafe(method(dominantLanguage))]
534 #[unsafe(method_family = none)]
535 pub fn dominantLanguage(&self) -> Option<Retained<NSString>>;
536
537 #[cfg(feature = "NSString")]
538 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
539 #[unsafe(method(dominantLanguageForString:))]
540 #[unsafe(method_family = none)]
541 pub fn dominantLanguageForString(string: &NSString) -> Option<Retained<NSString>>;
542
543 #[cfg(all(feature = "NSOrthography", feature = "NSRange", feature = "NSString"))]
544 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
548 #[unsafe(method(tagForString:atIndex:unit:scheme:orthography:tokenRange:))]
549 #[unsafe(method_family = none)]
550 pub unsafe fn tagForString_atIndex_unit_scheme_orthography_tokenRange(
551 string: &NSString,
552 char_index: NSUInteger,
553 unit: NSLinguisticTaggerUnit,
554 scheme: &NSLinguisticTagScheme,
555 orthography: Option<&NSOrthography>,
556 token_range: NSRangePointer,
557 ) -> Option<Retained<NSLinguisticTag>>;
558
559 #[cfg(all(
560 feature = "NSArray",
561 feature = "NSOrthography",
562 feature = "NSRange",
563 feature = "NSString",
564 feature = "NSValue"
565 ))]
566 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
567 #[unsafe(method(tagsForString:range:unit:scheme:options:orthography:tokenRanges:))]
568 #[unsafe(method_family = none)]
569 pub fn tagsForString_range_unit_scheme_options_orthography_tokenRanges(
570 string: &NSString,
571 range: NSRange,
572 unit: NSLinguisticTaggerUnit,
573 scheme: &NSLinguisticTagScheme,
574 options: NSLinguisticTaggerOptions,
575 orthography: Option<&NSOrthography>,
576 token_ranges: Option<&mut Option<Retained<NSArray<NSValue>>>>,
577 ) -> Retained<NSArray<NSLinguisticTag>>;
578
579 #[cfg(all(
580 feature = "NSOrthography",
581 feature = "NSRange",
582 feature = "NSString",
583 feature = "block2"
584 ))]
585 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
586 #[unsafe(method(enumerateTagsForString:range:unit:scheme:options:orthography:usingBlock:))]
587 #[unsafe(method_family = none)]
588 pub fn enumerateTagsForString_range_unit_scheme_options_orthography_usingBlock(
589 string: &NSString,
590 range: NSRange,
591 unit: NSLinguisticTaggerUnit,
592 scheme: &NSLinguisticTagScheme,
593 options: NSLinguisticTaggerOptions,
594 orthography: Option<&NSOrthography>,
595 block: &block2::DynBlock<dyn Fn(*mut NSLinguisticTag, NSRange, NonNull<Bool>) + '_>,
596 );
597
598 #[cfg(all(
599 feature = "NSArray",
600 feature = "NSRange",
601 feature = "NSString",
602 feature = "NSValue"
603 ))]
604 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
609 #[unsafe(method(possibleTagsAtIndex:scheme:tokenRange:sentenceRange:scores:))]
610 #[unsafe(method_family = none)]
611 pub unsafe fn possibleTagsAtIndex_scheme_tokenRange_sentenceRange_scores(
612 &self,
613 char_index: NSUInteger,
614 tag_scheme: &NSString,
615 token_range: NSRangePointer,
616 sentence_range: NSRangePointer,
617 scores: Option<&mut Option<Retained<NSArray<NSValue>>>>,
618 ) -> Option<Retained<NSArray<NSString>>>;
619 );
620}
621
622impl NSLinguisticTagger {
624 extern_methods!(
625 #[unsafe(method(init))]
626 #[unsafe(method_family = init)]
627 pub fn init(this: Allocated<Self>) -> Retained<Self>;
628
629 #[unsafe(method(new))]
630 #[unsafe(method_family = new)]
631 pub fn new() -> Retained<Self>;
632 );
633}
634
635impl DefaultRetained for NSLinguisticTagger {
636 #[inline]
637 fn default_retained() -> Retained<Self> {
638 Self::new()
639 }
640}
641
642#[cfg(feature = "NSString")]
644impl NSString {
645 extern_methods!(
646 #[cfg(all(
647 feature = "NSArray",
648 feature = "NSOrthography",
649 feature = "NSRange",
650 feature = "NSValue"
651 ))]
652 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
653 #[unsafe(method(linguisticTagsInRange:scheme:options:orthography:tokenRanges:))]
654 #[unsafe(method_family = none)]
655 pub fn linguisticTagsInRange_scheme_options_orthography_tokenRanges(
656 &self,
657 range: NSRange,
658 scheme: &NSLinguisticTagScheme,
659 options: NSLinguisticTaggerOptions,
660 orthography: Option<&NSOrthography>,
661 token_ranges: Option<&mut Option<Retained<NSArray<NSValue>>>>,
662 ) -> Retained<NSArray<NSLinguisticTag>>;
663
664 #[cfg(all(feature = "NSOrthography", feature = "NSRange", feature = "block2"))]
665 #[deprecated = "All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API"]
666 #[unsafe(method(enumerateLinguisticTagsInRange:scheme:options:orthography:usingBlock:))]
667 #[unsafe(method_family = none)]
668 pub fn enumerateLinguisticTagsInRange_scheme_options_orthography_usingBlock(
669 &self,
670 range: NSRange,
671 scheme: &NSLinguisticTagScheme,
672 options: NSLinguisticTaggerOptions,
673 orthography: Option<&NSOrthography>,
674 block: &block2::DynBlock<
675 dyn Fn(*mut NSLinguisticTag, NSRange, NSRange, NonNull<Bool>) + '_,
676 >,
677 );
678 );
679}