Tazinho / snakecase

🐍🐍🐍 A systematic approach to parse strings and automate the conversion to snake_case, UpperCamelCase or any other case.
https://tazinho.github.io/snakecase/
GNU General Public License v3.0
146 stars 9 forks source link

(possibly) allow for completely user defined parsing #163

Open Tazinho opened 5 years ago

Tazinho commented 5 years ago

It should be possible to add user defined parsing functionality.

To not break the existing parsig_option modus via integers, there could be an alternative via usage of named character vectors. These names and values could form pairs of regular expression patterns and replacements which would be chained and iteratively applied to the string. To enable this, a chain of str_replace_all calls should be wrapped into its own function via a base:::Reduce() call or some while/for conditional.

Tazinho commented 5 years ago

Additionally it should be possible to combine these steps, i.e. providing a vector parsing_option = c("" = "", 1)`, which replaces all ticks first and afterwards applies the default parsing optionality.

Tazinho commented 5 years ago

hm maybe this is out of scope. any advanced use might be able to write a sequence of gsubs by himself