leaf icon indicating copy to clipboard operation
leaf copied to clipboard

camelCaseToUpperSpaced works poorly with acronyms

Open jnothman opened this issue 3 years ago • 0 comments

A dataset column such as MRICount gets presented as M R I Count by default, due to the use of camelCaseToUpperSpaced.

Possible solutions:

  • Leave it as is and accept poor display of "MRI".
  • Ask users to represent this as MriCount and accept poor display of "MRI".
  • Special case multiple uppercase letters in a row, i.e. replace caps = /([A-Z])/g with caps = /(?<![A-Z])([A-Z])/g.
    • Some cases will remain bad, e.g. camelCaseToUpperSpaced("NumberOfMRIs") == "Number Of MR Is"
  • Allow the administrator to set displayName in DynamicDatasetQuery.Schema
  • Avoid using camelCaseToUpperSpaced since heuristics can always go wrong.

jnothman avatar Dec 15 '21 23:12 jnothman