Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser and Formatter objects #98

Closed
ChanceNCounter opened this issue Mar 25, 2020 · 3 comments
Closed

Parser and Formatter objects #98

ChanceNCounter opened this issue Mar 25, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@ChanceNCounter
Copy link
Contributor

ChanceNCounter commented Mar 25, 2020

Should we add Parser and Formatter classes, so that users can instantiate these functions with state?

I can see the utility: instantiate a formatter, specify once that you prefer: commas for decimal points, French for the language, do NOT fall back on English, 24 hour clock.

@ChanceNCounter ChanceNCounter added the enhancement New feature or request label Mar 25, 2020
@JarbasAl
Copy link
Collaborator

i like this!

using objects is very pythonic

@ChanceNCounter
Copy link
Contributor Author

ChanceNCounter commented Mar 25, 2020

In fact, it might be helpful for Mycroft skill developers. We'd have to start documenting more thoroughly (which somehow excites me, rather than horrifying me) but Mycroft could just instantiate one parser. Skill authors would wind up doing stuff like, self.parser.extract_number(). The library as such would still be showcasing itself, as the objects would just be a stateful frontend for the same functions.

Which, come to think of it, even live in "the same place" (Parser.extract_number() == lingua_franca.parse.extract_number())

Or Mycroft could just keep doing what it's doing.

@ChanceNCounter
Copy link
Contributor Author

Obviated by the much better solutions in #108 and #128. I tried it as part of the former, and it was lousy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants