Updated in 4.58 Cognigy.AI helps you clean up user input (text or voice) with built-in functions. For example, if a user saysDocumentation Index
Fetch the complete documentation index at: https://docs.cognigy.com/llms.txt
Use this file to discover all available pages before exploring further.
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 Name | Description |
|---|---|
| cleanDisallowedSymbols | Removes all symbols that are not explicitly allowed. All letters and numbers are allowed by default, and additional allowed symbols can be set. |
| resolveSpelledOutNumbers | Replaces all number words with their numerical representation. For example, โfive and three hundred nineteenโ > โ5 319โ. |
| resolvePhoneticAlphabet | Detects 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. |
| replaceSpecialPhrases | Replaces specific words or phrases with replacements. For example, โConversational AIโ is changed to โCAIโ, โNew Yorkโ to โNYโ, and โlufthansaโ to โlhโ. |
| resolveSpelledOutAlphabet | Resolves phrases like โa for anton b as in bertramโ to โa bโ. |
| resolvePhoneticCounters | Resolves strings like โ3 times 2โ to โ222โ or โdouble 4โ to โ44โ. Learn more about special rules in the Rules for resolvePhoneticCounters section. |
| contractSingleCharacters | Joins 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โ. |
| contractNumberGroups | Joins all numbers standing next to each other. For example, โhis number is 333 43 22 44โ > โhis number is 333432244โ. |
| trimResult | Trims 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 type | Rule | Example |
|---|---|---|
| Number | 2 times 3, 2 times 16 | |
| Multiplicand is a number less than 13 | The 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 13 | Only 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โ |
| Character | 2 times alpha, 2 times ox | |
| Multiplicand is a phonetic character | It is resolved, and the character is repeated. | โ2 times alphaโ will return โaaโ |
| Multiplicand has more than one character and is not a phonetic character | Only 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โ) |