Class NSLinguisticTagger

  • All Implemented Interfaces:
    NSObject

    public class NSLinguisticTagger
    extends NSObject
    • Constructor Detail

      • NSLinguisticTagger

        protected NSLinguisticTagger​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • availableTagSchemesForLanguage

        public static NSArray<java.lang.String> availableTagSchemesForLanguage​(java.lang.String language)
        Clients wishing to know the tag schemes supported in NSLinguisticTagger for a particular language at the word level may query them with this method. The language should be specified using a standard abbreviation as with NSOrthography.
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(java.lang.Object aTarget,
                                                                                 org.moe.natj.objc.SEL aSelector,
                                                                                 java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        public static org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • new_objc

        public static java.lang.Object new_objc()
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • version_static

        public static long version_static()
      • initWithTagSchemesOptions

        public NSLinguisticTagger initWithTagSchemesOptions​(NSArray<java.lang.String> tagSchemes,
                                                            long opts)
        An instance of NSLinguisticTagger is created with an array of tag schemes. The tagger will be able to supply tags corresponding to any of the schemes in this array.
      • orthographyAtIndexEffectiveRange

        public NSOrthography orthographyAtIndexEffectiveRange​(long charIndex,
                                                              NSRange effectiveRange)
      • possibleTagsAtIndexSchemeTokenRangeSentenceRangeScores

        public NSArray<java.lang.String> possibleTagsAtIndexSchemeTokenRangeSentenceRangeScores​(long charIndex,
                                                                                                java.lang.String tagScheme,
                                                                                                NSRange tokenRange,
                                                                                                NSRange sentenceRange,
                                                                                                org.moe.natj.general.ptr.Ptr<NSArray<? extends NSValue>> scores)
        Deprecated method for obtaining a list of possible tags for the token at a given index.
      • sentenceRangeForRange

        public NSRange sentenceRangeForRange​(NSRange range)
        Returns a range covering all sentences intersecting the given range.
      • setOrthographyRange

        public void setOrthographyRange​(NSOrthography orthography,
                                        NSRange range)
        If clients know the orthography for a given portion of the string, they may supply it to the tagger. Otherwise, the tagger will infer the language from the contents of the text. In each case, the charIndex or range passed in must not extend beyond the end of the tagger's string, or the methods will raise an exception.
      • setString

        public void setString​(java.lang.String value)
      • string

        public java.lang.String string()
      • stringEditedInRangeChangeInLength

        public void stringEditedInRangeChangeInLength​(NSRange newRange,
                                                      long delta)
        If the string attached to the tagger is mutable, this method must be called to inform the tagger whenever the string changes. The newRange is the range in the final string which was explicitly edited, and delta is the change in length from the previous version to the current version of the string. Alternatively, the client may call setString: again to reset all information about the string, but this has the disadvantage of not preserving information about portions of the string that have not changed.
      • tagAtIndexSchemeTokenRangeSentenceRange

        public java.lang.String tagAtIndexSchemeTokenRangeSentenceRange​(long charIndex,
                                                                        java.lang.String scheme,
                                                                        NSRange tokenRange,
                                                                        NSRange sentenceRange)
      • tagSchemes

        public NSArray<java.lang.String> tagSchemes()
      • tagsInRangeSchemeOptionsTokenRanges

        public NSArray<java.lang.String> tagsInRangeSchemeOptionsTokenRanges​(NSRange range,
                                                                             java.lang.String tagScheme,
                                                                             long opts,
                                                                             org.moe.natj.general.ptr.Ptr<NSArray<? extends NSValue>> tokenRanges)
      • availableTagSchemesForUnitLanguage

        public static NSArray<java.lang.String> availableTagSchemesForUnitLanguage​(long unit,
                                                                                   java.lang.String language)
        Clients wishing to know the tag schemes supported in NSLinguisticTagger for a particular unit and language may query them with this method. The language should be specified using a standard BCP-47 language tag as with NSOrthography.
      • dominantLanguage

        public java.lang.String dominantLanguage()
        Returns the top identified language (if any) for the entire string. Convenience for tagAtIndex: with NSLinguisticTagSchemeLanguage and NSLinguisticTaggerUnitDocument.
      • dominantLanguageForString

        public static java.lang.String dominantLanguageForString​(java.lang.String string)
        The following class methods are conveniences for clients who wish to perform a single analysis on a string without having to create an instance of NSLinguisticTagger. If more than one tagging operation is needed on a given string, it is more efficient to use an explicit NSLinguisticTagger instance.
      • enumerateTagsInRangeUnitSchemeOptionsUsingBlock

        public void enumerateTagsInRangeUnitSchemeOptionsUsingBlock​(NSRange range,
                                                                    long unit,
                                                                    java.lang.String scheme,
                                                                    long options,
                                                                    NSLinguisticTagger.Block_enumerateTagsInRangeUnitSchemeOptionsUsingBlock block)
        The tagger will segment the string as needed into tokens for the given unit, and return those ranges along with a tag for any scheme in its array of tag schemes. The fundamental tagging method on NSLinguisticTagger is a block iterator, that iterates over all tokens intersecting a given range, supplying tags and ranges. There are several additional convenience methods, for obtaining a sentence range, information about a single token, or for obtaining information about all tokens intersecting a given range at once, in arrays. In each case, the charIndex or range passed in must not extend beyond the end of the tagger's string, or the methods will raise an exception. Note that a given instance of NSLinguisticTagger should not be used from more than one thread simultaneously.
      • tagAtIndexUnitSchemeTokenRange

        public java.lang.String tagAtIndexUnitSchemeTokenRange​(long charIndex,
                                                               long unit,
                                                               java.lang.String scheme,
                                                               NSRange tokenRange)
      • tagForStringAtIndexUnitSchemeOrthographyTokenRange

        public static java.lang.String tagForStringAtIndexUnitSchemeOrthographyTokenRange​(java.lang.String string,
                                                                                          long charIndex,
                                                                                          long unit,
                                                                                          java.lang.String scheme,
                                                                                          NSOrthography orthography,
                                                                                          NSRange tokenRange)
      • tagsForStringRangeUnitSchemeOptionsOrthographyTokenRanges

        public static NSArray<java.lang.String> tagsForStringRangeUnitSchemeOptionsOrthographyTokenRanges​(java.lang.String string,
                                                                                                          NSRange range,
                                                                                                          long unit,
                                                                                                          java.lang.String scheme,
                                                                                                          long options,
                                                                                                          NSOrthography orthography,
                                                                                                          org.moe.natj.general.ptr.Ptr<NSArray<? extends NSValue>> tokenRanges)
      • tagsInRangeUnitSchemeOptionsTokenRanges

        public NSArray<java.lang.String> tagsInRangeUnitSchemeOptionsTokenRanges​(NSRange range,
                                                                                 long unit,
                                                                                 java.lang.String scheme,
                                                                                 long options,
                                                                                 org.moe.natj.general.ptr.Ptr<NSArray<? extends NSValue>> tokenRanges)
      • tokenRangeAtIndexUnit

        public NSRange tokenRangeAtIndexUnit​(long charIndex,
                                             long unit)
        Returns the range corresponding to the token for the given unit that contains the given character index.