Giter VIP home page Giter VIP logo

Comments (10)

dongrixinyu avatar dongrixinyu commented on May 22, 2024

我暂时没想到以什么数据结构来阐述这个周期时间的表达。
如果数据结构可以清晰阐述,改一下肯定没问题。可能后续考虑给一个返回的周期时间的数量参数,把相应的时间全部计算返回。

from jionlp.

dong706 avatar dong706 commented on May 22, 2024

我暂时没想到以什么数据结构来阐述这个周期时间的表达。 如果数据结构可以清晰阐述,改一下肯定没问题。可能后续考虑给一个返回的周期时间的数量参数,把相应的时间全部计算返回。

嗯...我想到一个思路,对于每个周末9点,返回如下结构:

[
	{
		"detail": {
			"definition": "blur",
			"time": {
				"delta": {
					"day": 1
				},
				"point": {
					"string": "每个周末",
					"time": [
						"2022-03-06 00:00:00",
						"2022-03-07 23:59:59"
					]
				}
			},
			"type": "time_period"
		},
		"offset": [
			0,
			4
		],
		"text": "每个周末",
		"type": "time_period"
	},
	{
		"detail": {
			"definition": "accurate",
			"time": [
				"2022-03-06 09:00:00",
				"2022-03-06 09:59:59"
			],
			"type": "time_point"
		},
		"offset": [
			4,
			6
		],
		"text": "9点",
		"type": "time_point"
	}
]

每个工作日同理。

修改了一下返回数据结构,和现在的兼容。

from jionlp.

dongrixinyu avatar dongrixinyu commented on May 22, 2024

每个工作日九点

这个我改了一些,程序有一些bug,每个周末九点可以解析了。但是每个工作日九点 这个里面,工作日它的周期性有点复杂,这个我还需要再考虑一下怎么处理。

from jionlp.

dong706 avatar dong706 commented on May 22, 2024

每个工作日九点

这个我改了一些,程序有一些bug,每个周末九点可以解析了。但是每个工作日九点 这个里面,工作日它的周期性有点复杂,这个我还需要再考虑一下怎么处理。

我昨晚测试了一下“每周一到周五,上午九点”,其返回结构如下,个人觉得是能正确表示“每个工作日9点”这个时间语义的。

另外,去掉了逗号用“每周一到周五的上午九点”的话则不能返回如下结构,算是BUG么?

[
	{
		"detail": {
			"definition": "accurate",
			"time": {
				"delta": {
					"day": 7
				},
				"point": {
					"string": "周一到周五",
					"time": [
						"2022-03-07 00:00:00",
						"2022-03-11 23:59:59"
					]
				}
			},
			"type": "time_period"
		},
		"offset": [
			0,
			6
		],
		"text": "每周一到周五",
		"type": "time_period"
	},
	{
		"detail": {
			"definition": "accurate",
			"time": [
				"2022-03-07 09:00:00",
				"2022-03-07 09:59:59"
			],
			"type": "time_point"
		},
		"offset": [
			7,
			11
		],
		"text": "上午九点",
		"type": "time_point"
	}
]

from jionlp.

dongrixinyu avatar dongrixinyu commented on May 22, 2024

是 bug,不过这个bug 不是关键。关键点是,每周的周期是 7,但是工作日是在这7天里另外一个周期为 5 的周期。我想问问,你拿到这个数据,后续是怎么接入实际应用的,比如,闹铃等等。是怎么样的数据格式,我想参考一下

from jionlp.

dong706 avatar dong706 commented on May 22, 2024

是 bug,不过这个bug 不是关键。关键点是,每周的周期是 7,但是工作日是在这7天里另外一个周期为 5 的周期。我想问问,你拿到这个数据,后续是怎么接入实际应用的,比如,闹铃等等。是怎么样的数据格式,我想参考一下

周一到周五的周期是7天,初始时间范围是7日到11日,那下一周时间范围就是把第一个时间范围+7,即14日到18日,我感觉这样用起来好像没啥问题。

from jionlp.

dongrixinyu avatar dongrixinyu commented on May 22, 2024

是 bug,不过这个bug 不是关键。关键点是,每周的周期是 7,但是工作日是在这7天里另外一个周期为 5 的周期。我想问问,你拿到这个数据,后续是怎么接入实际应用的,比如,闹铃等等。是怎么样的数据格式,我想参考一下

周一到周五的周期是7天,初始时间范围是7日到11日,那下一周时间范围就是把第一个时间范围+7,即14日到18日,我感觉这样用起来好像没啥问题。

每个工作日九点 ,我打算把解析结果核心部分改为,

"time": [
			[
				"2022-03-07 09:00:00",
				"2022-03-07 09:59:59"
			],
			[
				"2022-03-08 09:00:00",
				"2022-03-08 09:59:59"
			],
			[
				"2022-03-09 09:00:00",
				"2022-03-09 09:59:59"
			],
			[
				"2022-03-10 09:00:00",
				"2022-03-10 09:59:59"
			],
			[
				"2022-03-11 09:00:00",
				"2022-03-11 09:59:59"
			],
			[
				"2022-03-14 09:00:00",
				"2022-03-14 09:59:59"
			],
			[
				"2022-03-15 09:00:00",
				"2022-03-16 09:59:59"
			],

其中,第一个为距离最近的时间点,返回个数由参数指定

from jionlp.

dong706 avatar dong706 commented on May 22, 2024

是 bug,不过这个bug 不是关键。关键点是,每周的周期是 7,但是工作日是在这7天里另外一个周期为 5 的周期。我想问问,你拿到这个数据,后续是怎么接入实际应用的,比如,闹铃等等。是怎么样的数据格式,我想参考一下

周一到周五的周期是7天,初始时间范围是7日到11日,那下一周时间范围就是把第一个时间范围+7,即14日到18日,我感觉这样用起来好像没啥问题。

每个工作日九点 ,我打算把解析结果核心部分改为,

"time": [
			[
				"2022-03-07 09:00:00",
				"2022-03-07 09:59:59"
			],
			[
				"2022-03-08 09:00:00",
				"2022-03-08 09:59:59"
			],
			[
				"2022-03-09 09:00:00",
				"2022-03-09 09:59:59"
			],
			[
				"2022-03-10 09:00:00",
				"2022-03-10 09:59:59"
			],
			[
				"2022-03-11 09:00:00",
				"2022-03-11 09:59:59"
			],
			[
				"2022-03-14 09:00:00",
				"2022-03-14 09:59:59"
			],
			[
				"2022-03-15 09:00:00",
				"2022-03-16 09:59:59"
			],

其中,第一个为距离最近的时间点,返回个数由参数指定

也是可以的,赞美大佬!

from jionlp.

dongrixinyu avatar dongrixinyu commented on May 22, 2024

是 bug,不过这个bug 不是关键。关键点是,每周的周期是 7,但是工作日是在这7天里另外一个周期为 5 的周期。我想问问,你拿到这个数据,后续是怎么接入实际应用的,比如,闹铃等等。是怎么样的数据格式,我想参考一下

周一到周五的周期是7天,初始时间范围是7日到11日,那下一周时间范围就是把第一个时间范围+7,即14日到18日,我感觉这样用起来好像没啥问题。

每个工作日九点 ,我打算把解析结果核心部分改为,

"time": [
			[
				"2022-03-07 09:00:00",
				"2022-03-07 09:59:59"
			],
			[
				"2022-03-08 09:00:00",
				"2022-03-08 09:59:59"
			],
			[
				"2022-03-09 09:00:00",
				"2022-03-09 09:59:59"
			],
			[
				"2022-03-10 09:00:00",
				"2022-03-10 09:59:59"
			],
			[
				"2022-03-11 09:00:00",
				"2022-03-11 09:59:59"
			],
			[
				"2022-03-14 09:00:00",
				"2022-03-14 09:59:59"
			],
			[
				"2022-03-15 09:00:00",
				"2022-03-16 09:59:59"
			],

其中,第一个为距离最近的时间点,返回个数由参数指定

也是可以的,赞美大佬!

更了一版,1.3.52

from jionlp.

dong706 avatar dong706 commented on May 22, 2024

是 bug,不过这个bug 不是关键。关键点是,每周的周期是 7,但是工作日是在这7天里另外一个周期为 5 的周期。我想问问,你拿到这个数据,后续是怎么接入实际应用的,比如,闹铃等等。是怎么样的数据格式,我想参考一下

周一到周五的周期是7天,初始时间范围是7日到11日,那下一周时间范围就是把第一个时间范围+7,即14日到18日,我感觉这样用起来好像没啥问题。

每个工作日九点 ,我打算把解析结果核心部分改为,

"time": [
			[
				"2022-03-07 09:00:00",
				"2022-03-07 09:59:59"
			],
			[
				"2022-03-08 09:00:00",
				"2022-03-08 09:59:59"
			],
			[
				"2022-03-09 09:00:00",
				"2022-03-09 09:59:59"
			],
			[
				"2022-03-10 09:00:00",
				"2022-03-10 09:59:59"
			],
			[
				"2022-03-11 09:00:00",
				"2022-03-11 09:59:59"
			],
			[
				"2022-03-14 09:00:00",
				"2022-03-14 09:59:59"
			],
			[
				"2022-03-15 09:00:00",
				"2022-03-16 09:59:59"
			],

其中,第一个为距离最近的时间点,返回个数由参数指定

也是可以的,赞美大佬!

更了一版,1.3.52

有一点小问题,parse_time函数已经支持period_results_num参数,但是extract_time尚未支持,求优化~~~

from jionlp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.