text2date-spring-boot-starter-autoconfigurer

For extracting time in Chinese text

License

License

Categories

Categories

Spring Boot Container Microservices Auto Application Layer Libs Code Generators config Configuration Mirror Introspection ORM Data
GroupId

GroupId

io.github.mirrormingzz
ArtifactId

ArtifactId

text2date-spring-boot-starter-autoconfigurer
Last Version

Last Version

1.0.5
Release Date

Release Date

Type

Type

jar
Description

Description

text2date-spring-boot-starter-autoconfigurer
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-autoconfigurer

How to add to project

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

Dependencies

compile (5)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter jar 2.2.0.RELEASE
org.projectlombok : lombok Optional jar 1.18.10
commons-io : commons-io jar 2.6
org.apache.commons : commons-lang3 jar 3.9
com.fulmicoton : multiregexp jar 0.5.1

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.1
0.0.1