Time expression analyzer for Japanese.
Project description
Jatime: Time Expression Analyzer for Japanese
Jatime is a Python library to extract Japanese time expressions from a given text and turning them into objects. Try Jatime now from your browser!
Installing jatime
Install with pip or your favorite PyPI package manager.
$ pip install jatime
Using jatime
Here's how to analyze Japanese text using jatime. Note that "dow" means the day of the week.
From within Python
from jatime.analyzer import analyze
result = analyze("それは令和2年十月十七日の出来事でした。")
print(result)
['それは', {'string': '令和2年十月十七日', 'year': 2020, 'month': 10, 'day': 17, 'dow': 5, 'hour': None, 'minute': None}, 'の出来事でした。']
From the command line
$ jatime analyze --format-json それは令和2年十月十七日の出来事でした。
[
"それは",
{
"string": "令和2年十月十七日",
"year": 2020,
"month": 10,
"day": 17,
"dow": 5,
"hour": null,
"minute": null
},
"の出来事でした。"
]
Over HTTP communication
$ jatime serve
$ curl --get "http://localhost:1729/analysis" --data-urlencode "string=それは令和2年十月十七日の出来事でした。"
["それは",{"day":17,"dow":5,"hour":null,"minute":null,"month":10,"string":"令和2年十月十七日","year":2020},"の出来事でした。"]
Features
- Jatime does not change the given string at all. It just objectifies the extracted time expressions.
- Jatime supports a variety of time expressions.
22:30,午後十時半andP.M.10:30are all interpreted as the same time as we want. - Jatime tries to make up for the missing time information whenever possible. That is, jatime calculates the year given the month, day and day of the week.
- Jatime will tell us why the time information is inconsistent if it is inconsistent.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jatime-0.1.0.tar.gz.
File metadata
- Download URL: jatime-0.1.0.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.10 CPython/3.8.5 Linux/4.18.0-193.19.1.el8_2.x86_64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c5eecbf2dcb7bbb8dd3a21a791bdf2a6b510fccb6765b19fa2a429e895f6c26
|
|
| MD5 |
079b2627e1df6bdd6d539b583cbaea00
|
|
| BLAKE2b-256 |
870854a48cd1176d1dfee813c2de181a1832896b36e5c2f360a5d0f81b5263bd
|
File details
Details for the file jatime-0.1.0-py3-none-any.whl.
File metadata
- Download URL: jatime-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.10 CPython/3.8.5 Linux/4.18.0-193.19.1.el8_2.x86_64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93a32522492cd08ff45cb478dca9d8ec539e4eae1f0c9753e57e427f850d1f70
|
|
| MD5 |
8f8b9d9fa783e59c3ea57250a85088e6
|
|
| BLAKE2b-256 |
7d040b1dc4946310dfe2066fad47aa3485d8efae3a03cd2e7637051794029626
|