2be851c8acf32ce69189a0d0bae0d81d9523ac5f kent Thu Dec 9 16:06:58 2021 -0800 Adding new symbol_id() builtin function. diff --git src/lib/strex.doc src/lib/strex.doc index cde94b0..597eadb 100644 --- src/lib/strex.doc +++ src/lib/strex.doc @@ -97,30 +97,32 @@ returns "deep/path/to/your/reads" upper(string) - returns all upper case version of string lower(string) - returns all lower case version of string md5(string) - returns an MD5 sum digest/hash of string. symbol(prefix, string) - turn string into a computer usable symbol that starts with the given prefix. To create the rest of the symbol, the string is mangled. First the spaces, tabs, and newlines are all turned into _ chars, then any remaining characters that aren't ascii letters or numerical digits are removed. If the result is 32 characters or less it's used, but if it's longer it's converted into an MD5 sum. +symbol_id(prefix, string) - turns a string into prefix followed by a small numerical ID that will be + unique and return consistently if same prefix,string is input. replace(string, oldPart, newPart) - returns string with all instances of old replaced by new. The cases where either old or new are empty string are useful special cases. If new is "", then all instances of the old string will be deleted. If old is "", then empty strings will be replaced by new strings, useful in setting a default value for a field. fix(string, target, newString) - similar to replace but works at the whole string level. Returns string unchanged except for the case where string matches target exactly. In that case it returns newString instead. The name "fix" comes from it being used generally to replace one constant, fixed, string with another. Also, a lot of the time when you do this it is to fix a small inconsistency in the metadata. In general fix is faster to execute and quicker to type than replace and the effects are more specific. example to help clean up minor variations in vocabulary fix(fix(fix(fix( sex, "M","male"), "F","female"), "Male","male") "Female","female")