Skip to main content

%iKnow.Configuration

Class %iKnow.Configuration Extends %Persistent [ Deprecated, Final, StorageStrategy = iKnowStorage, System = 4 ]

The InterSystems IRIS NLP iKnow technology is now deprecated. Please see the product documentation for more detail.

This class groups the configuration parameters to drive the iKnow Smart Indexing algorithm as executed by the iKnow engine (external libraries). Configurations are referred to by name and can be used across domains within the same namespace.

When creating a configuration, you can pass initial values for the following properties to its %New method:

  1. Name (required)
  2. DetectLanguage
  3. Languages
  4. UserDictionary
  5. Summarize Check the respective property descriptions for more details.

Properties

Id

Property Id As %Integer [ Internal, ReadOnly ];

Name

Property Name As %String [ ReadOnly ];

The name of this configuration, which should be unique within the namespace (case-insensitive)

DetectLanguage

Property DetectLanguage As %Boolean;

Whether or not to use Automatic Language Identification

Languages

Property Languages As %List;

The list of languages the engine should take into account when processing the text.

UserDictionary

Property UserDictionary As %String(MAXLEN = 1000);

The name to the User Dictionary to use for rewriting and standardizing input as it is read by the engine. See also %iKnow.UserDictionary. Alternatively, the path to a file-based User Dictionary can be supplied.

Summarize

Property Summarize As %Integer [ Deprecated, InitialExpression = 1 ];

This setting is deprecated. Summaries are now generated at query time.

MaxConceptLength

Property MaxConceptLength As %Integer(MINVAL = 0) [ Internal ];

Maximum cluster length. Advanced use only.

IsTransient

Property IsTransient As %Boolean [ Internal, Private, Transient ];

Indexer

Property Indexer As %iKnow.Indexer [ Internal, Private, Transient ];

Private Indexer object for Normalize method.

Methods

CreateDefaultConfig

ClassMethod CreateDefaultConfig() As %Status [ Internal ]

Automatically (re)create the default configuration

Create

ClassMethod Create(name As %String, DetectLanguage As %Integer = 0, languages As %List = {$lb("en")}, userDictionary As %String = "", summarize As %Integer = 1, maxConceptLength As %Integer = 0, Output sc As %Status = {$$$OK}) As %iKnow.Configuration [ Deprecated ]

Create a new Configuration object using the specified parameters

Deprecated: Please use %New and %Save

Open

ClassMethod Open(name As %String, Output pSC As %Status = {$$$OK}) As %iKnow.Configuration

Opens the Configuration object with the supplied name. When requesting the default configuration ($$$DEFAULTCONFIG), it will be created if it didn't exist yet for this namespace.

OpenId

ClassMethod OpenId(id As %Integer) As %iKnow.Configuration [ Deprecated ]

Opens the Configuration object with the supplied ID

Deprecated: Please use %OpenId

Exists

ClassMethod Exists(name As %String) As %Boolean [ Deprecated ]

Checks whether a Configuration object exists with the given name

Deprecated: Please use NameIndexExists

Delete

ClassMethod Delete(configName As %String) As %Status [ Deprecated ]

Deletes a named configuration

Deprecated: Please use NameIndexOpen and %DeleteId

DeleteId

ClassMethod DeleteId(configId As %String) As %Status [ Deprecated ]

Deletes a configuration specified by ID

Deprecated: Please use %DeleteId

%OnNew

Method %OnNew(pName As %String, pDetectLanguage As %Integer = 0, pLanguages As %List = {$lb("en")}, pUserDictionary As %String = "", pSummarize As %Integer = 1, pMaxConceptLength As %Integer = 0, pTransient As %Boolean = 0) As %Status [ Private, ServerOnly = 1 ]

Creates a Configuration object with the specified parameters.

Note: Use of the pMaxConceptLength parameter is deprecated as from 2013.2

.

ResolveLanguage

Method ResolveLanguage(tLanguage) As %String [ Internal ]

ConfigureIndexer

Method ConfigureIndexer(indexer As %iKnow.Indexer) As %Status [ Internal ]

Configures an %iKnow.Indexer object with the settings stored in this Configuration object

GetAllConfigurationsExecute

ClassMethod GetAllConfigurationsExecute(ByRef qHandle As %Binary) As %Status [ Internal ]

Simple class query to retrieve all the configurations for this Namespace.

Deprecated: Please use normal SQL queries to approach this class.

GetAllConfigurationsClose

ClassMethod GetAllConfigurationsClose(ByRef qHandle As %Binary) As %Status [ Internal, PlaceAfter = GetAllConfigurationsExecute ]

GetAllConfigurationsFetch

ClassMethod GetAllConfigurationsFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) As %Status [ Internal, PlaceAfter = GetAllConfigurationsExecute ]

%OnBeforeSave

Method %OnBeforeSave(insert As %Boolean) As %Status [ Private, ServerOnly = 1 ]

LanguagesIsValid

ClassMethod LanguagesIsValid(pLanguages As %String) As %Status [ Private, ServerOnly = 1 ]

%ConstructClone

Method %ConstructClone(deep As %Boolean = 0, ByRef cloned As %String, location As %String) As %RegisteredObject [ ServerOnly = 0 ]

%DeleteExtent

ClassMethod %DeleteExtent(concurrency As %Integer = -1, ByRef deletecount, ByRef instancecount, pInitializeExtent As %Integer = 1) As %Status [ ServerOnly = 0 ]

%KillExtentData

ClassMethod %KillExtentData(killstreams As %Boolean = 0) As %Status [ Private, ServerOnly = 1 ]

CheckIfManaged

ClassMethod CheckIfManaged(pConfig As %iKnow.Configuration) As %Status [ Internal ]

%OnDelete

ClassMethod %OnDelete(oid As %ObjectIdentity) As %Status [ Private, ServerOnly = 1 ]

Normalize

Method Normalize(pString As %String, pLanguage As %String = "", Output pSC As %Status = {$$$OK}, pCleanPunctuation As %Boolean = 1) As %String

Takes an input string pString and returns its normalized form as returned by the iKnow engine. Using this method will ensure a string has the same form as any results (entities) returned by the engine as a result of iKnow indexing with this Configuration object.

More specifically, this normalization takes into account the following properties:

  • User Dictionary literal input substitutions.
  • Language model preprocess filters.
  • Character normalization (lower casing and some punctuation separation)
  • Whitespace compression.
  • Entity filters.

Input substitution adheres to the User Dictionary as specified in the UserDictionary property of this Configuration. If not specified through pLanguage (as a two-letter language code), the language will be randomly selected by the engine from the list specified in this Configuration's Languages property, so it's recommended to supply a value for pLanguage if Languages contains more than one entry. If specified, pLanguage should appear in Languages

See also NormalizeWithParams to normalize without a Configuration object.

NormalizeWithParams

ClassMethod NormalizeWithParams(pString As %String, pLanguage As %String = "en", pUserDictionary As %String = "", Output pSC As %Status = {$$$OK}, pCleanPunctuation As %Boolean = 1) As %String

Takes an input string pString and returns its normalized form as returned by the iKnow engine. Using this method will ensure a string has the same form as any results (entities) returned by the engine as a result of indexing operations.

More specifically, this normalization takes into account the following properties:

  • User Dictionary literal input substitutions.
  • Language model preprocess filters.
  • Character normalization (lower casing and some punctuation separation)
  • Whitespace compression.
  • Entity filters.

Input substitution adheres to the User Dictionary as specified through pUserDictionary and the preprocess filters for language pLanguage are used.

See also Normalize to normalize using an existing Configuration object.

CreateTransientConfig

ClassMethod CreateTransientConfig(pLanguage As %String = "en", pUserDictionary As %String = "", Output pSC As %Status = {$$$OK}) As %iKnow.Configuration [ Internal ]