ipasymbols


Nameipasymbols JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttp://github.com/ulf1/ipasymbols
SummaryProperties of IPA symbols for data analysis.
upload_time2023-07-10 15:19:15
maintainer
docs_urlNone
authorUlf Hamster
requires_python>=3.6
licenseApache License 2.0
keywords
VCS
bugtrack_url
requirements numpy
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![PyPI version](https://badge.fury.io/py/ipasymbols.svg)](https://badge.fury.io/py/ipasymbols)
[![PyPi downloads](https://img.shields.io/pypi/dm/ipasymbols)](https://img.shields.io/pypi/dm/ipasymbols)
[![DOI](https://zenodo.org/badge/431771809.svg)](https://zenodo.org/badge/latestdoi/431771809)


# ipasymbols: Properties of IPA symbols for data analysis
A simple JSON database to lookup the properties of IPA symbols.

## Warning: Under Development! (25.Nov.2021)
Version `0.0.*` is **not** ready to use. Non-Pulmonic consonants, affricates, co-articulated consonants, and dipthongs are **not** implemented yet. This kind of software is very prone to human errors, and required unit tests are not implemented so far.

## Usage

### Get lists of IPA phons
```py
import ipasymbols

# all vowels
all_vowels = ipasymbols.phonlist(query={'type': 'vowel'})

# front vowels
front_vowels = ipasymbols.phonlist(query={'type': 'vowel', 'backness': 'front'})

# diphthongs (2 char vowels)
diphthongs = ipasymbols.phonlist(query={'type': 'diphthong'})

# different types of consonants
consonants = ipasymbols.phonlist(query={'type': ["pulmonic", "non-pulmonic"]})
# consonants = ['m̥', 'm', 'ɱ', 'n̼', ...]
```


### Get properties of an IPA phon
```py
import ipasymbols
phon = 'ɪ'
props = ipasymbols.props(phon=phon, keys=["height"])
# props = {'height': 'near-close'}
```


### Count certain kinds of IPA symbols
```py
import ipasymbols
ipatext = "de:ɐ̯ kɔʊd ɪst fɔl blø:t abɐ aʊ̯x tɔl"
# vowels
all_vowels = ipasymbols.count(ipatext, query={'type': 'vowel'})
# front vowels
front_vowels = ipasymbols.count(ipatext, query={'type': 'vowel', 'backness': 'front'})
# diphthongs (2 char vowels)
diphthongs = ipasymbols.count(ipatext, query={'type': 'diphthong'})
# different types of consonants
consonants = ipasymbols.count(ipatext, query={'type': ["pulmonic", "non-pulmonic"]})
```


### Count consonant clusters
```py
import ipasymbols
ipatext = "de:ɐ̯ kɔʊd ɪst fɔl blø:t abɐ aʊ̯x tɔl"
types = ["pulmonic", "non-pulmonic", "affricate", "co-articulated"]
clusters = ipasymbols.count_clusters(
    ipatext, query={"type": types}, phonlen=3, min_cluster_len=2)
# clusters = {2: 789, 3: 654, 4: 123, ...}
```


### Read the whole IPA symbols database

```py
import ipasymbols
mydict = ipasymbols.db
```


## Appendix

### Installation
The `ipasymbols` [git repo](http://github.com/ulf1/ipasymbols) is available as [PyPi package](https://pypi.org/project/ipasymbols)

```sh
pip install ipasymbols
pip install git+ssh://git@github.com/ulf1/ipasymbols.git
```

### Install a virtual environment

```sh
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt --no-cache-dir
pip install -r requirements-dev.txt --no-cache-dir
pip install -r requirements-demo.txt --no-cache-dir
```

(If your git repo is stored in a folder with whitespaces, then don't use the subfolder `.venv`. Use an absolute path without whitespaces.)

### Python commands

* Jupyter for the examples: `jupyter lab`
* Check syntax: `flake8 --ignore=F401 --exclude=$(grep -v '^#' .gitignore | xargs | sed -e 's/ /,/g'),./ipasymbols/ipasymbols.py`
* Run Unit Tests: `PYTHONPATH=. pytest`

Publish

```sh
python setup.py sdist 
twine upload -r pypi dist/*
```

### Clean up 

```sh
find . -type f -name "*.pyc" | xargs rm
find . -type d -name "__pycache__" | xargs rm -r
rm -r .pytest_cache
rm -r .venv
```


### Support
Please [open an issue](https://github.com/ulf1/ipasymbols/issues/new) for support.


### Contributing
Please contribute using [Github Flow](https://guides.github.com/introduction/flow/). Create a branch, add commits, and [open a pull request](https://github.com/ulf1/ipasymbols/compare/).

### Acknowledgements
The "Evidence" project was funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) - [433249742](https://gepris.dfg.de/gepris/projekt/433249742) (GU 798/27-1; GE 1119/11-1).

### Maintenance
- till 31.Aug.2023 (v0.0.1) the code repository was maintained within the DFG project [433249742](https://gepris.dfg.de/gepris/projekt/433249742)
- since 01.Sep.2023 (v0.1.0) the code repository is maintained by Ulf Hamster.

### Citation
You can cite the following paper if you want to use this repository in your research work.

```
@inproceedings{hamster-2022-everybody,
    title = "Everybody likes short sentences - A Data Analysis for the Text Complexity {DE} Challenge 2022",
    author = "Hamster, Ulf A.",
    booktitle = "Proceedings of the GermEval 2022 Workshop on Text Complexity Assessment of German Text",
    month = sep,
    year = "2022",
    address = "Potsdam, Germany",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2022.germeval-1.2",
    pages = "10--14",
}
```


            

Raw data

            {
    "_id": null,
    "home_page": "http://github.com/ulf1/ipasymbols",
    "name": "ipasymbols",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "Ulf Hamster",
    "author_email": "554c46@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/6b/57/92dc11cd422a611a010b34647c10dc25ba2f610a6e18f91fdc3b4c31c217/ipasymbols-0.1.0.tar.gz",
    "platform": null,
    "description": "[![PyPI version](https://badge.fury.io/py/ipasymbols.svg)](https://badge.fury.io/py/ipasymbols)\n[![PyPi downloads](https://img.shields.io/pypi/dm/ipasymbols)](https://img.shields.io/pypi/dm/ipasymbols)\n[![DOI](https://zenodo.org/badge/431771809.svg)](https://zenodo.org/badge/latestdoi/431771809)\n\n\n# ipasymbols: Properties of IPA symbols for data analysis\nA simple JSON database to lookup the properties of IPA symbols.\n\n## Warning: Under Development! (25.Nov.2021)\nVersion `0.0.*` is **not** ready to use. Non-Pulmonic consonants, affricates, co-articulated consonants, and dipthongs are **not** implemented yet. This kind of software is very prone to human errors, and required unit tests are not implemented so far.\n\n## Usage\n\n### Get lists of IPA phons\n```py\nimport ipasymbols\n\n# all vowels\nall_vowels = ipasymbols.phonlist(query={'type': 'vowel'})\n\n# front vowels\nfront_vowels = ipasymbols.phonlist(query={'type': 'vowel', 'backness': 'front'})\n\n# diphthongs (2 char vowels)\ndiphthongs = ipasymbols.phonlist(query={'type': 'diphthong'})\n\n# different types of consonants\nconsonants = ipasymbols.phonlist(query={'type': [\"pulmonic\", \"non-pulmonic\"]})\n# consonants = ['m\u0325', 'm', '\u0271', 'n\u033c', ...]\n```\n\n\n### Get properties of an IPA phon\n```py\nimport ipasymbols\nphon = '\u026a'\nprops = ipasymbols.props(phon=phon, keys=[\"height\"])\n# props = {'height': 'near-close'}\n```\n\n\n### Count certain kinds of IPA symbols\n```py\nimport ipasymbols\nipatext = \"de:\u0250\u032f k\u0254\u028ad \u026ast f\u0254l bl\u00f8:t ab\u0250 a\u028a\u032fx t\u0254l\"\n# vowels\nall_vowels = ipasymbols.count(ipatext, query={'type': 'vowel'})\n# front vowels\nfront_vowels = ipasymbols.count(ipatext, query={'type': 'vowel', 'backness': 'front'})\n# diphthongs (2 char vowels)\ndiphthongs = ipasymbols.count(ipatext, query={'type': 'diphthong'})\n# different types of consonants\nconsonants = ipasymbols.count(ipatext, query={'type': [\"pulmonic\", \"non-pulmonic\"]})\n```\n\n\n### Count consonant clusters\n```py\nimport ipasymbols\nipatext = \"de:\u0250\u032f k\u0254\u028ad \u026ast f\u0254l bl\u00f8:t ab\u0250 a\u028a\u032fx t\u0254l\"\ntypes = [\"pulmonic\", \"non-pulmonic\", \"affricate\", \"co-articulated\"]\nclusters = ipasymbols.count_clusters(\n    ipatext, query={\"type\": types}, phonlen=3, min_cluster_len=2)\n# clusters = {2: 789, 3: 654, 4: 123, ...}\n```\n\n\n### Read the whole IPA symbols database\n\n```py\nimport ipasymbols\nmydict = ipasymbols.db\n```\n\n\n## Appendix\n\n### Installation\nThe `ipasymbols` [git repo](http://github.com/ulf1/ipasymbols) is available as [PyPi package](https://pypi.org/project/ipasymbols)\n\n```sh\npip install ipasymbols\npip install git+ssh://git@github.com/ulf1/ipasymbols.git\n```\n\n### Install a virtual environment\n\n```sh\npython3 -m venv .venv\nsource .venv/bin/activate\npip install --upgrade pip\npip install -r requirements.txt --no-cache-dir\npip install -r requirements-dev.txt --no-cache-dir\npip install -r requirements-demo.txt --no-cache-dir\n```\n\n(If your git repo is stored in a folder with whitespaces, then don't use the subfolder `.venv`. Use an absolute path without whitespaces.)\n\n### Python commands\n\n* Jupyter for the examples: `jupyter lab`\n* Check syntax: `flake8 --ignore=F401 --exclude=$(grep -v '^#' .gitignore | xargs | sed -e 's/ /,/g'),./ipasymbols/ipasymbols.py`\n* Run Unit Tests: `PYTHONPATH=. pytest`\n\nPublish\n\n```sh\npython setup.py sdist \ntwine upload -r pypi dist/*\n```\n\n### Clean up \n\n```sh\nfind . -type f -name \"*.pyc\" | xargs rm\nfind . -type d -name \"__pycache__\" | xargs rm -r\nrm -r .pytest_cache\nrm -r .venv\n```\n\n\n### Support\nPlease [open an issue](https://github.com/ulf1/ipasymbols/issues/new) for support.\n\n\n### Contributing\nPlease contribute using [Github Flow](https://guides.github.com/introduction/flow/). Create a branch, add commits, and [open a pull request](https://github.com/ulf1/ipasymbols/compare/).\n\n### Acknowledgements\nThe \"Evidence\" project was funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) - [433249742](https://gepris.dfg.de/gepris/projekt/433249742) (GU 798/27-1; GE 1119/11-1).\n\n### Maintenance\n- till 31.Aug.2023 (v0.0.1) the code repository was maintained within the DFG project [433249742](https://gepris.dfg.de/gepris/projekt/433249742)\n- since 01.Sep.2023 (v0.1.0) the code repository is maintained by Ulf Hamster.\n\n### Citation\nYou can cite the following paper if you want to use this repository in your research work.\n\n```\n@inproceedings{hamster-2022-everybody,\n    title = \"Everybody likes short sentences - A Data Analysis for the Text Complexity {DE} Challenge 2022\",\n    author = \"Hamster, Ulf A.\",\n    booktitle = \"Proceedings of the GermEval 2022 Workshop on Text Complexity Assessment of German Text\",\n    month = sep,\n    year = \"2022\",\n    address = \"Potsdam, Germany\",\n    publisher = \"Association for Computational Linguistics\",\n    url = \"https://aclanthology.org/2022.germeval-1.2\",\n    pages = \"10--14\",\n}\n```\n\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "Properties of IPA symbols for data analysis.",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "http://github.com/ulf1/ipasymbols"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6b5792dc11cd422a611a010b34647c10dc25ba2f610a6e18f91fdc3b4c31c217",
                "md5": "919fc32311ec2091502a252c9864b6b7",
                "sha256": "416a5abe9ed62b51454fe108e2030db3c6bde90d62b3542f8f727dc2d8003ded"
            },
            "downloads": -1,
            "filename": "ipasymbols-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "919fc32311ec2091502a252c9864b6b7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 17177,
            "upload_time": "2023-07-10T15:19:15",
            "upload_time_iso_8601": "2023-07-10T15:19:15.570585Z",
            "url": "https://files.pythonhosted.org/packages/6b/57/92dc11cd422a611a010b34647c10dc25ba2f610a6e18f91fdc3b4c31c217/ipasymbols-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-10 15:19:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ulf1",
    "github_project": "ipasymbols",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "numpy",
            "specs": [
                [
                    "<",
                    "2"
                ],
                [
                    ">=",
                    "1.21.4"
                ]
            ]
        }
    ],
    "lcname": "ipasymbols"
}
        
Elapsed time: 0.13100s