ucum-org / ucum

https://ucum.org
Other
48 stars 10 forks source link

Request for Chinese characters and the like in Annotation strings #288

Open linforestzhang opened 6 months ago

linforestzhang commented 6 months ago

In the file unitString.js the ucum-lhc project: // A regular expression for validating annotation strings. static VALID_ANNOTATION_REGEX = /^{[!-z|~]*}$/;

It reminds me of the following proposal: Annotation strings should be allowed to contain Chinese characters and like, such as: {片} ... for {tablet}

Proposed regular expression: // A regular expression for validating annotation strings. static VALID_ANNOTATION_REGEX = /^{[!-z|~\u4e00-\u9fa5]*}$/;

Validated examples: {片} ... for {tablet} {肌酐} for {creat} [ Usage: nmol/mmol{肌酐} ... for nmol/mmol{creat} ] {蛋白质} for {prot} [ Usage: nmol/mg{蛋白质} ... nmol/mg{prot} ] ...

The proposal above was initially submitted to the ucum-lhc project. See here: https://github.com/lhncbc/ucum-lhc/issues/49

Maybe this should be submitted as a proposal for the UCUM Specification per se.

Tkanks