Brian Dunning's FileMaker Custom Functions

OvertypeMistakes ( text ; fixList )

Text-input word corrector for upper/lower case typos

  Average rating: 3.9 (42 votes) Log in to vote

Edward L. Scott   Edward L. Scott - Show more from this author
Scott Resources
https://scott-resources.com

Share on Facebook Share on Twitter

  Sample input:
apple has sold ipads in the ussr and nyc after designing components with autocad.
  Sample output:
Apple has sold iPads in the USSR and NYC after designing components with AutoCAD.

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Written as a triggered script originally, then customer needed it to work in Instant Web Publishing, so I re-wrote it as a recursive custom function.

This is a recursive function to correct case-related typos in textual data-entry fields. It was requested by a fellow developer whose customer wanted a way to automatically clean up data entries sloppily typed in by Instant Web Publishing users. Parsing is accomplished word-by-word rather than character-by-character.

The correctly typed "fixList" parameter may be easily maintained as a return-delimited-list global field in a Preferences table. The function can (should) be invoked by defining the "text" input field as an auto-calculation that recalculates itself upon field exit. The function is implemented as a recursive loop as limited by the number of words in the calling "text" parameter, and a nested loop within that loop as limited by the number of words-to-fix in the "fixList" parameter. When every individual word in the "text" input has been compared to every individual word in the "fixList" parameter (and modified as-needed using a Substitute function), the function then exits via the second Let statement which first nulls out (destroys) the global variables (i.e., $$...) and then returns the "fixed-text" local (i.e., exists only within the custom function) variable.

 

Comments

Hans Nagelgast   Hans Nagelgast, None
May 25, 2014
Could you give an example of the Fixlist, I am not able to reproduce your results
 
Hans Nagelgast   Hans Nagelgast, None
May 25, 2014
OK, well I have figured it out. The Fixlist only contains the correctly spelled words and the input text simply replaces these values. Thanks, nice function.
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: