Class Reference
IRIS for UNIX 2024.1.2
InterSystems: The power behind what matters   
Documentation  Search
  [USER] >  [%iKnow] >  [Matching] >  [Formats] >  [SimplePrefixFormat]
Private  Storage   

deprecatedclass %iKnow.Matching.Formats.SimplePrefixFormat extends %iKnow.Matching.Formats.Format

This sample %iKnow.Matching.Formats.Format implementation checks whether a string starts with a given character sequence, offering a meaningful MatchAll example.

Format parameters:

  1. prefix (%String, no default) - the prefix to check for, with no double, starting or trailing spaces
  2. outputType (%Integer, default 0) - what to supply in terms of output:
    • 0: no output
    • 1: the remainder of the word following the (first occurrence of the) prefix
    • 2: same as 1, but if there is a space following the prefix, returns the next word
    • 3: the whole entity starting right after the (first occurrence of the) prefix

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
4


Summary

Properties
DomainId

Methods
%AddToSaveSet %ClassIsLatestVersion %ClassName %ConstructClone
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %Extends
%GetParameter %IsA %IsModified %New
%NormalizeObject %ObjectModified %OriginalNamespace %PackageName
%RemoveFromSaveSet %SerializeObject %SetModified %ValidateObject
Finalize HasMatchAll MatchAll MatchAllHashes
MatchSingle TestParams


Methods

• method HasMatchAll() as %Boolean
• method MatchAll(stringsGlobalName As %String, resultGlobalName As %String, formatParams As %List, minEntUniId As %Integer = 0) as %Status

This method loops through @stringsGlobalName@(" "_string) = id and matches all global entries, storing the results in @resultGlobalName@(id) = $lb(matchScore, matchedWordBits, isScattered, formatOutput). The implementation should ignore all ids < minEntUniId and should not store any results if the matchScore is 0.

Implementing this method only makes sense if the specific format this class represents can exploit the inverse global structure of @stringsGlobalName.

Note: entries in @stringsGlobalName are all in lowercase and prefixed with a space

Warning: an implementation for this method does not replace MatchSingle. There should still be a MatchSingle alternative, for example to process strings longer than $$$IKHASHSIZE that would not appear in @stringsGlobalName.

• method MatchSingle(string As %String, formatParams As %List, Output matchScore As %Numeric, Output matchedWordBits, Output isScattered As %Boolean, Output formatOutput) as %Status

Implementations of this method check whether an individual string complies with the format this class represents, returning a matchScore (0..1) and optional matchedWordBits, isScattered and formatOutput through output parameters.



Copyright (c) 2025 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.