Natural language time parser

前端 未结 3 632
陌清茗
陌清茗 2020-12-10 00:00

I\'m trying to parse strings containing (natural language) times to hh:mm time objects? For example:

\"ten past five\"
\"quarter to three\"
\"half p         


        
相关标签:
3条回答
  • 2020-12-10 00:20

    parsedatetime looks promising. Credit.

    0 讨论(0)
  • 2020-12-10 00:29

    I didn't feel like extending parsedatetime, so I decided to use pyPEG, a parser interpreter framework for Python, to write a dedicated time parser. For whoever's interested, the first basic version is now finished, and nicely parses Dutch time strings.

    0 讨论(0)
  • 2020-12-10 00:41

    Just for anyone who is interested, I found this:

    https://gist.github.com/akatzbreaker/5849024

    This is the same as Bert's Anwser on Github, but it is in English... Just for anyone who is interested on this, and doesn't know Dutch :-P ...

    0 讨论(0)
提交回复
热议问题