go get -u github.com/bububa/TimeNLP
用于句子中时间词的抽取和转换
import (
"log"
"github.com/bububa/TimeNLP"
)
func main() {
target := "Hi,all.下周一下午三点开会"
preferFuture := true
tn := timenlp.TimeNormalizer(preferFuture)
ret, err := tn.Parse(target)
if err != nil {
log.Fatalln(err)
}
log.Printf("%+v\n", ret)
}
python3 版本 https://github.com/zhanzecheng/Time_NLP
Java 版本https://github.com/shinyke/Time-NLP
PHP 版本https://github.com/crazywhalecc/Time-NLP-PHP
Javascript 版本https://github.com/JohnnieFucker/ChiTimeNLP