TextSimplifyChars ( someText ; options )
Simplifies text by converting diacriticals and other characters to their low-ASCII equivalent.
Be the first to rate this function Log in to vote
Dan Shockley - Show more from this author |
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
Simplifies text by converting diacriticals and other characters to their low-ASCII equivalent.
Can be used to "simplify" two strings before doing a PatternCount, or other strict matching function.
By default, PatternCount does fairly strict comparisons, while a Find does loose Unicode-equivalence comparisons. That means a Find for a search phrase where words have high-ASCII/Unicode characters will result in finding records on which a PatternCount for the same phrase (intended to find which records have those words _together_, without another word in between) will say there is NOT a match.
This function first converts most diacritical characters to their low-ASCII equivalent. Then, it filters the result to ONLY be the “allowed” low-ASCII characters, so any other high-ASCII/Unicode/emoji get stripped away.
Do that to both the target text and the search phrase, then do a PatternCount using the “simplified” strings, and you can see if the phrase is in the target.
Note that this method could produce false positive (matches) outcomes where a relevant non-simplified character would NOT match between the target and search, but was stripped out and thus ignored. So, this function is best used when false positives (does match) are preferred over false negative (does not match because comparison was too strict).
Comments
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.