Anyone know of a tool that parses human time input like slack's /remind command?

blov · · 336 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;m looking for a tool that will take a string, something like &#34;every day at 9:00 am&#34; and convert that into a <code>time.Time</code> object and probably a <code>time.Duration</code> object to denote repetition. I was hoping <a href="https://github.com/dustin/go-humanize">go-humanize</a> would have something like that, but haven&#39;t found anything after googling for a bit. </p> <p>I&#39;m happy to write it myself, sounds like a fun project, but didn&#39;t want to repeat effort. </p> <hr/>**评论:**<br/><br/>GunsKnivesRadios: <pre><p>Same here, I would love to find something like the big nasty behemoth Date::Manip from perl. Stop laughing. </p></pre>bwdezend: <pre><p>There’s some things I hate about Perl. That library is not one of them. </p></pre>1lann: <pre><p>I Googled around a bit and found this: <a href="https://github.com/olebedev/when" rel="nofollow">https://github.com/olebedev/when</a></p> <p>There really isn&#39;t many libraries to do this in Go, there are way more available in JavaScript.</p></pre>TimHugh: <pre><p>I haven&#39;t used this (just found it on Google), but it looks promising: <a href="https://github.com/olebedev/when" rel="nofollow">https://github.com/olebedev/when</a></p></pre>vldo: <pre><p><a href="https://github.com/Shixzie/nlp" rel="nofollow">Shixzie/nlp</a></p> <p>Seems to <a href="https://github.com/Shixzie/nlp#supported-types" rel="nofollow">support time.Duration</a>. It also has <a href="https://github.com/Shixzie/nlp#usage" rel="nofollow">an example</a> similar to what you&#39;re describing.</p> <p>Found in <a href="https://github.com/avelino/awesome-go#natural-language-processing" rel="nofollow">awesome-go#natural-language-processing</a></p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

336 次点击  
加入收藏 微博
0 回复
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传