Class NLTagger

    • Constructor Detail

      • NLTagger

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

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • alloc

        public static NLTagger alloc()
      • allocWithZone

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

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

        public static NSArray<java.lang.String> availableTagSchemesForUnitLanguage​(long unit,
                                                                                   java.lang.String language)
        Not all combinations of scheme and unit are supported, and not all combinations of scheme and language are supported. Clients can use +availableTagSchemesForUnit:language: to determine which ones are supported on the current device.
      • 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()
      • dominantLanguage

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

        public void enumerateTagsInRangeUnitSchemeOptionsUsingBlock​(NSRange range,
                                                                    long unit,
                                                                    java.lang.String scheme,
                                                                    long options,
                                                                    NLTagger.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 NLTagger is a block iterator, that iterates over all tokens intersecting a given range, supplying tags and ranges. There are additional convenience methods for obtaining information about a single token, or for obtaining information about all tokens intersecting a given range at once. In each case, the index 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 NLTagger should not be used from more than one thread simultaneously.
      • gazetteersForTagScheme

        public NSArray<? extends NLGazetteer> gazetteersForTagScheme​(java.lang.String tagScheme)
      • hash_static

        public static long hash_static()
      • initWithTagSchemes

        public NLTagger initWithTagSchemes​(NSArray<java.lang.String> tagSchemes)
        An instance of NLTagger 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.
      • 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)
      • modelsForTagScheme

        public NSArray<? extends NLModel> modelsForTagScheme​(java.lang.String tagScheme)
      • 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)
      • setGazetteersForTagScheme

        public void setGazetteersForTagScheme​(NSArray<? extends NLGazetteer> gazetteers,
                                              java.lang.String tagScheme)
        In addition to the model for a given tag scheme, clients can add a custom gazetteer that will override the tags for that scheme, for terms that are included in the gazetteer. If multiple gazetteers are specified, they will be matched to text based on the language that they specify.
      • setLanguageRange

        public void setLanguageRange​(java.lang.String language,
                                     NSRange range)
        If clients know the language or orthography for a given portion of the string, they may supply it to the tagger (after setting the string itself via 'string' @property). Otherwise, the tagger will infer the language from the contents of the text. In each case, the range passed in must not extend beyond the end of the tagger's string, or the methods will raise an exception. When a new string is set, it resets any language or orthography settings.
      • setModelsForTagScheme

        public void setModelsForTagScheme​(NSArray<? extends NLModel> models,
                                          java.lang.String tagScheme)
        In addition to the built-in models for predefined tag schemes, clients can set custom models that they have trained, either for existing tag schemes or for custom tag schemes. If multiple models are specified, they will be matched to text based on the language that they specify.
      • setOrthographyRange

        public void setOrthographyRange​(NSOrthography orthography,
                                        NSRange range)
      • setString

        public void setString​(java.lang.String value)
        An NLTagger instance must be assigned a string to tag, and clients can then obtain tags and ranges for tokens in that string appropriate to a given tag scheme and unit.
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • string

        public java.lang.String string()
        An NLTagger instance must be assigned a string to tag, and clients can then obtain tags and ranges for tokens in that string appropriate to a given tag scheme and unit.
      • superclass_static

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

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

        public NSArray<java.lang.String> tagSchemes()
      • 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 characterIndex,
                                             long unit)
        Returns the range corresponding to the token for the given unit that contains the given character index.
      • version_static

        public static long version_static()
      • tagHypothesesAtIndexUnitSchemeMaximumCountTokenRange

        public NSDictionary<java.lang.String,​? extends NSNumber> tagHypothesesAtIndexUnitSchemeMaximumCountTokenRange​(long characterIndex,
                                                                                                                            long unit,
                                                                                                                            java.lang.String scheme,
                                                                                                                            long maximumCount,
                                                                                                                            NSRange tokenRange)
        In addition, it is possible to obtain multiple hypotheses for a given tag with associated probability scores. Not all tag schemes will produce more than one hypothesis.
      • tokenRangeForRangeUnit

        public NSRange tokenRangeForRangeUnit​(NSRange range,
                                              long unit)
        Returns the smallest range covering all tokens for the given unit intersecting the given range. If range.length == 0, this is equivalent to tokenRangeAtIndex:unit:.