这是一个从文本提取中文地区的包
Project description
这是一个专门从文本里面提取中国的省,市,县的一个python模块
例子:
from get_province_city_county import get_city
citys=get_city("我出生在一个名字叫安徽的省份,我去过浙江,江苏,合肥还有淮南,但我最喜欢的还是合肥,因为我在蜀山区生活过一段时间")
print(citys)
结果:('安徽省', 5, '合肥市', 3, '蜀山区', 1)
你也可以通过h_zd参数来指定要提取的省市范围,将提取范围缩小,以便得到更精确的结果
例子:
from get_province_city_county import get_city
citys=get_city("我出生在一个名字叫安徽的省份,我去过浙江,江苏,台州,合肥还有淮南,但我最喜欢的还是合肥,因为我在蜀山区生活过一段时间",h_zd="浙江")
print(citys)
结果:
('浙江省', 3, '台州市', 1, '', 0)
通过h_zd这个参数,就可以锁定范围了
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
Close
Hashes for get_province_city_county-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8377e407b6dbcf2a5b2ebcb1f56f08447d20ab9e8b9606aa439a13eb940a005a |
|
MD5 | cfc322c5886fb1dd9f126616d7e9e01a |
|
BLAKE2b-256 | 6388649c220532525ef9f46311ed13c59a9c253d8e6afc3aad94bc8009674554 |
Close
Hashes for get_province_city_county-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c133acf7ff7ecc86640ff3ee950b4346393bbd1965d24e7958d8a46b7a374b36 |
|
MD5 | ab20c94bf590ab2a6fb9330b4980c5bd |
|
BLAKE2b-256 | 2e2592aaaeac573c375112f3e4d1bd6f094660b46d6a1ebdca3939a8b512555e |