you can save some time by passing the parser to the constructor, instead to recreate it each time. To do
this, get the Lark parser with the humanized_opening_hours.field_parser.get_parser() function, and pass
it to the OHParser constructor via the parser argument.
Perhaps a more user-friendly approach is to save the lark instance, either as a property in the OHParser instance like:
if not self._parser:
self._parser = field_parser.get_parser()
return self._parser
Or as a global variable in the field_parser module.
Hi, you wrote in your readme:
Perhaps a more user-friendly approach is to save the lark instance, either as a property in the
OHParser
instance like:Or as a global variable in the field_parser module.
Just a suggestion :)