r2eng
r2eng copied to clipboard
Allow custom translations
Maybe a user could provide a list object with preferred text for each token?
Something like:
r2eng::translate("1 / 1", dict = list("/" = "divided by"))) # rather than 'over'
It's probably preferable for this to be set as an option() so that it can always be applied when the function is called in a given session.
Option sets the location of a “dictionary” file that’s set out in YAML?
@mattkerlogue Ahaha, didn't realise you watched this repo. I was just thinking about tidying up this package soon—especially #10, #14 and #28—and then maybe even release a v0.1 eventually. (P.S. y r u such a YAML fanboi 🙃)
Ahahah. Well it could specify a list or a YAML file, which the {yaml} package reads in as a list. Reason for thinking of a file was so that ’translations’ could be shared, e.g an “en-GB”, “en-US”, “en-CA”, “en-AU”, “en-pirate”.