Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.cognigy.com/llms.txt

Use this file to discover all available pages before exploring further.

Updated in 4.58 Cognigy.AI helps you clean up user input (text or voice) with built-in functions. For example, if a user says alpha tango hotel double seven three nine minus L for London and C for Canada, it can automatically be converted to ath 7739 - lc. These Text Cleaner functions support the English (en) and German (de) locales and are available in: To learn more about the benefits of using Text Cleaner functions and how they work, watch this video:

Functions

Function NameDescription
cleanDisallowedSymbolsRemoves all symbols that are not explicitly allowed. All letters and numbers are allowed by default, and additional allowed symbols can be set.
resolveSpelledOutNumbersReplaces all number words with their numerical representation. For example, โ€œfive and three hundred nineteenโ€ > โ€œ5 319โ€.
resolvePhoneticAlphabetDetects and replaces all words that are part of the phonetic alphabet. For example, โ€œalpha tango limaโ€ > โ€œa t lโ€.
replaceSpecialWords (Deprecated)Replaces specifically set words with their replacements. For example, โ€œlufthansaโ€ > โ€œlhโ€.

As of Cognigy.AI 4.58.0, this function is deprecated. Use the replaceSpecialPhrases function instead.
replaceSpecialPhrasesReplaces specific words or phrases with replacements. For example, โ€œConversational AIโ€ is changed to โ€œCAIโ€, โ€œNew Yorkโ€ to โ€œNYโ€, and โ€œlufthansaโ€ to โ€œlhโ€.
resolveSpelledOutAlphabetResolves phrases like โ€œa for anton b as in bertramโ€ to โ€œa bโ€.
resolvePhoneticCountersResolves strings like โ€œ3 times 2โ€ to โ€œ222โ€ or โ€œdouble 4โ€ to โ€œ44โ€. Learn more about special rules in the Rules for resolvePhoneticCounters section.
contractSingleCharactersJoins all single characters standing alone into a full string. For example, โ€œmy name is c o g n i g yโ€ > โ€œmy name is cognigyโ€.
contractNumberGroupsJoins all numbers standing next to each other. For example, โ€œhis number is 333 43 22 44โ€ > โ€œhis number is 333432244โ€.
trimResultTrims the start and end of the string and replaces all double (or more) spaces with single spaces.

Rules for resolvePhoneticCounters

This function is designed to convert phrases like โ€œ3 times 2โ€ into their numeric representation, such as โ€œ3 times 2โ€ to โ€œ222โ€ or โ€œdouble 4โ€ to โ€œ44.โ€ The function handles sentences that include both a multiplier (for example, โ€œ3 timesโ€ or โ€œdoubleโ€) and a multiplicand (for example, โ€œ2โ€ or โ€œ4โ€). The multiplicand can be either a number or a character. Some examples can be ambiguous. For instance, consider the phrase โ€œdouble ap 3 4โ€, which could be interpreted as either โ€œaap34โ€ or โ€œapap34.โ€ To avoid this ambiguity, Cognigy defined the following rules for multiplicand types:
Multiplicand typeRuleExample
Number2 times 3, 2 times 16
Multiplicand is a number less than 13The multiplicand is repeated itself.โ€2 times 3โ€ will return โ€œ33โ€
โ€œ2 times 11โ€ will return โ€œ1111โ€
Multiplicand is a number greater than or equal to 13Only the first digit is repeated.

The first digit is given priority due to the more common usage of phrases like โ€œ3 times 4โ€ or โ€œ3 times 12,โ€ compared to โ€œ3 times 25โ€.
โ€œ2 times 16โ€ will return โ€œ116โ€
Character2 times alpha, 2 times ox
Multiplicand is a phonetic characterIt is resolved, and the character is repeated.โ€2 times alphaโ€ will return โ€œaaโ€
Multiplicand has more than one character and is not a phonetic characterOnly the first character is repeated.

Cognigy assumes that the speech-to-text (STT) system transcribed the user input incorrectly and that the user intended to say another.
โ€2 times oxโ€ will return โ€œooxโ€
(we assume that the user intended to say โ€œ2 times o, xโ€)