Skip to main content

这是一个从文本提取中文地区的包

Project description

这是一个专门从文本里面提取中国的省,市,县的一个python模块

例子:

from get_province_city_county.city import mycity
citys = mycity.get_city("我出生在一个名字叫安徽的省份,我去过浙江,江苏,合肥还有淮南,但我最喜欢的还是合肥,因为我在蜀山区生活过一段时间")
print(citys)

结果:[['安徽', 5, '淮南', 2, None, 0, False, [1, 1]]]

你也可以通过h_zd参数来指定要提取的省市范围,将提取范围缩小,以便得到更精确的结果

例子:

from get_province_city_county.city import mycity
citys = mycity.get_city("我出生在一个名字叫安徽的省份,我去过浙江,江苏,台州,合肥还有淮南,但我最喜欢的还是合肥,因为我在蜀山区生活过一段时间",h_zd="浙江")
print(citys)

结果:[['浙江', 5, '台州', 2, None, 0, False, [1, 1]]]

通过h_zd这个参数,就可以锁定范围了

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

get_province_city_county-1.3.0.tar.gz (36.0 kB view details)

Uploaded Source

Built Distribution

get_province_city_county-1.3.0-py3-none-any.whl (35.6 kB view details)

Uploaded Python 3

File details

Details for the file get_province_city_county-1.3.0.tar.gz.

File metadata

  • Download URL: get_province_city_county-1.3.0.tar.gz
  • Upload date:
  • Size: 36.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.6

File hashes

Hashes for get_province_city_county-1.3.0.tar.gz
Algorithm Hash digest
SHA256 4760ed7c747ed96ac8895e72a91a2eb2b8e1fb8b58efe7d96ce1a3afa2542915
MD5 c64f51a63f9f96e5df63d0bb5129184e
BLAKE2b-256 d0457c0366542850dafe01102ae40e414fcfba3aebc0c2eced739f6b6e0d65c0

See more details on using hashes here.

File details

Details for the file get_province_city_county-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: get_province_city_county-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 35.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.6

File hashes

Hashes for get_province_city_county-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 65878d3e5e9da4f9930c55ca1773a217091bf2c7be96c4ec458413db4132da28
MD5 88860e6534972d402ab87b5250f5b353
BLAKE2b-256 a2ecef9fd604ee421a4c917c4ac12922fc653f8fe6420207e7d7526f4689560b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page