countrytagger-0.1.2
توضیحات
Tag the names of countries and in text.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | countrytagger-0.1.2 |
| نام | countrytagger |
| نسخه کتابخانه | 0.1.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | OCCRP |
| ایمیل نویسنده | - |
| آدرس صفحه اصلی | https://github.com/alephdata/countrytagger |
| آدرس اینترنتی | https://pypi.org/project/countrytagger/ |
| مجوز | MIT |
# countrytagger
This library finds the names of places in a string of text and tries to associate
them with countries. The goal is to tag a piece (or set) of text with country
metadata. The place names are derived from the GeoNames database, and they include
names of countries, major administrative areas and large cities. Place names that
are used in several countries are not used.
## Usage
```python
import countrytagger
# match in a string using sequential matching:
text = 'I am in Berlin'
for (code, score, country) in countrytagger.tag_text_countries(text):
print(score, country)
# find precise matches:
code, score, country = countrytagger.tag_place('Berlin')
```
## Building the data
You can re-generate the place database like this:
```bash
$ make generate
```
This will download GeoNames and parse it into the format used by this library.
نیازمندی
| مقدار | نام |
|---|---|
| >=2.0.0 | normality |
| >=1.4.0 | pyahocorasick |
نحوه نصب
نصب پکیج whl countrytagger-0.1.2:
pip install countrytagger-0.1.2.whl
نصب پکیج tar.gz countrytagger-0.1.2:
pip install countrytagger-0.1.2.tar.gz