xnlp_time
处理时间模块集合
安装
pip install xnlp-time
测试
from xnlp_time import TimeExtractor
time_ext = TimeExtractor()
def time_extractor_parse(query):
"""
时间提取解析
:param query:
:return:
"""
result = time_ext.parse(query)
return result
if __name__ == '__main__':
texts = [
'去年的今天',
'明天',
'后天',
'去年的五一',
'去年的五月十一号',
'明年的今天',
'明年的十月一日',
'腊月十三',
'端午节',
'十一',
'劳动节',
'植树节',
'双十一',
'元旦',
'春节',
'圣诞节',
'元宵节',
'正月十五',
'八一',
'六一',
'儿童节',
'妇女节',
'万圣节',
'大后天',
'明后两天',
'下午两点',
'上午两点',
'昨晚,前晚,明晚',
'上月今天天气咋样',
'昨天夜里两点',
'大后天',
'大前天',
'腊八节'
]
for text in texts:
print('query:{},result:{}'.format(text, time_extractor_parse(text)))
print("********the end********")
Metadata
Release files for xnlp-time 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| xnlp_time-1.0.3.tar.gz | 11.6 kB | Without provenance | Details for xnlp_time-1.0.3.tar.gz |
Release files / xnlp_time-1.0.3.tar.gz
| Download URL | xnlp_time-1.0.3.tar.gz |
|---|---|
| Size | 11.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
34bcf87a9ca7480a28ed1aa9caedb81dfdd3349a2df6bf7a77db52c35b9835c5
|
|
BLAKE2b-256 checksum How to use checksums |
2d24a8a39a7a07b4bc1ba3bfa3ffaba4d09ea77b93ef6b1b20216c3e110036fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0.post20200518 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.10
|
Security for xnlp-time 1.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.