text2date-spring-boot-starter

For extracting time in Chinese text

License

License

Categories

Categories

Spring Boot Container Microservices Mirror Application Layer Libs Introspection ORM Data
GroupId

GroupId

io.github.mirrormingzz
ArtifactId

ArtifactId

text2date-spring-boot-starter
Last Version

Last Version

1.0.5
Release Date

Release Date

Type

Type

jar
Description

Description

text2date-spring-boot-starter
For extracting time in Chinese text
Project URL

Project URL

https://github.com/mirrormingzZ/text2date-spring-boot-starter
Source Code Management

Source Code Management

https://github.com/mirrormingzZ/text2date-spring-boot-starter

Download text2date-spring-boot-starter

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.mirrormingzz/text2date-spring-boot-starter/ -->
<dependency>
    <groupId>io.github.mirrormingzz</groupId>
    <artifactId>text2date-spring-boot-starter</artifactId>
    <version>1.0.5</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.mirrormingzz/text2date-spring-boot-starter/
implementation 'io.github.mirrormingzz:text2date-spring-boot-starter:1.0.5'
// https://jarcasting.com/artifacts/io.github.mirrormingzz/text2date-spring-boot-starter/
implementation ("io.github.mirrormingzz:text2date-spring-boot-starter:1.0.5")
'io.github.mirrormingzz:text2date-spring-boot-starter:jar:1.0.5'
<dependency org="io.github.mirrormingzz" name="text2date-spring-boot-starter" rev="1.0.5">
  <artifact name="text2date-spring-boot-starter" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.mirrormingzz', module='text2date-spring-boot-starter', version='1.0.5')
)
libraryDependencies += "io.github.mirrormingzz" % "text2date-spring-boot-starter" % "1.0.5"
[io.github.mirrormingzz/text2date-spring-boot-starter "1.0.5"]

Dependencies

compile (1)

Group / Artifact Type Version
io.github.mirrormingzz : text2date-spring-boot-starter-autoconfigurer jar 1.0.5

Project Modules

There are no modules declared in this project.

提取中文文本里面的时间

使用

添加依赖

<dependency>
    <groupId>io.github.mirrormingzz</groupId>
    <artifactId>text2date-spring-boot-starter</artifactId>
    <version>1.0.4</version>
</dependency>

注入DatetimeRecognizer

@Autowired
private DatetimeRecognizer datetimeRecognizer;

使用dateParse()/parse()进行文本解析

List<Date> dates = datetimeRecognizer.dateParse("半个小时后提醒我去买票");

List<TimeEntity> timeEntities = datetimeRecognizer.parse("明天下午四点到五点去看电影");
  • 2020-4-22 添加:节假日解析,礼拜x 解析
  • 2020-4-2 修复:半个小时,半个钟头前/后和xx小时前/后 的解析
  • 2020-3-27 添加:半小时前/后和xx小时前/后 的解析

TODO:

  • 节假日解析 4-22
  • 时间短语解析 4-22
  • 是否倾向未来时间可配置
  • 自定义添加解析参数

参考项目:

mandarintools:https://github.com/luoxuefeng01/mandarintools-1

复旦大学fnlp:https://github.com/FudanNLP/fnlp 时间处理模块见:package org.fnlp.nlp.cn.ner;

Microsoft/Recognizers-Text:https://github.com/microsoft/Recognizers-Text 微软的 Java - datetime 目前未完成

Time-NLP:https://github.com/shinyke/Time-NLP

TimeRecognition:https://github.com/senlinxuefeng/TimeRecognition

TimeRec:https://github.com/wbq813/TimeRec

ALBERT_4_Time_Recognition:https://github.com/percent4/ALBERT_4_Time_Recognition

Chinese_Time_Recogniztion:https://github.com/percent4/Chinese_Time_Recogniztion

Versions

Version
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0