Package apple.naturallanguage
Class NLTagger
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.naturallanguage.NLTagger
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceNLTagger.Block_enumerateTagsInRangeUnitSchemeOptionsUsingBlockstatic interfaceNLTagger.Block_requestAssetsForLanguageTagSchemeCompletionHandler-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedNLTagger(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanaccessInstanceVariablesDirectly()static NLTaggeralloc()static java.lang.ObjectallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)static booleanautomaticallyNotifiesObserversForKey(java.lang.String key)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.static voidcancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)static NSArray<java.lang.String>classFallbacksForKeyedArchiver()static org.moe.natj.objc.ClassclassForKeyedUnarchiver()static java.lang.StringdebugDescription_static()static java.lang.Stringdescription_static()java.lang.StringdominantLanguage()Returns the top identified language (if any) for the entire string.voidenumerateTagsInRangeUnitSchemeOptionsUsingBlock(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.NSArray<? extends NLGazetteer>gazetteersForTagScheme(java.lang.String tagScheme)static longhash_static()NLTaggerinit()NLTaggerinitWithTagSchemes(NSArray<java.lang.String> tagSchemes)An instance of NLTagger is created with an array of tag schemes.static NSObject.Function_instanceMethodForSelector_retinstanceMethodForSelector(org.moe.natj.objc.SEL aSelector)static NSMethodSignatureinstanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)static booleaninstancesRespondToSelector(org.moe.natj.objc.SEL aSelector)static booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)static NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(java.lang.String key)NSArray<? extends NLModel>modelsForTagScheme(java.lang.String tagScheme)static java.lang.Objectnew_objc()static voidrequestAssetsForLanguageTagSchemeCompletionHandler(java.lang.String language, java.lang.String tagScheme, NLTagger.Block_requestAssetsForLanguageTagSchemeCompletionHandler completionHandler)static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)voidsetGazetteersForTagScheme(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.voidsetLanguageRange(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).voidsetModelsForTagScheme(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.voidsetOrthographyRange(NSOrthography orthography, NSRange range)voidsetString(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.static voidsetVersion_static(long aVersion)java.lang.Stringstring()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.static org.moe.natj.objc.Classsuperclass_static()java.lang.StringtagAtIndexUnitSchemeTokenRange(long characterIndex, long unit, java.lang.String scheme, NSRange tokenRange)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.NSArray<java.lang.String>tagSchemes()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)NSRangetokenRangeAtIndexUnit(long characterIndex, long unit)Returns the range corresponding to the token for the given unit that contains the given character index.NSRangetokenRangeForRangeUnit(NSRange range, long unit)Returns the smallest range covering all tokens for the given unit intersecting the given range.static longversion_static()-
Methods inherited from class apple.NSObject
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKey
-
-
-
-
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.
-
instanceMethodForSelector
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
-
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()
-
requestAssetsForLanguageTagSchemeCompletionHandler
public static void requestAssetsForLanguageTagSchemeCompletionHandler(java.lang.String language, java.lang.String tagScheme, NLTagger.Block_requestAssetsForLanguageTagSchemeCompletionHandler completionHandler)
-
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.
-
-