Package: ipasymbols
ipasymbols: Properties of IPA symbols for data analysisA simple JSON database to lookup the properties of IPA symbols.Warning: Under Development! (25.Nov.2021)Version0.0.*isnotready to use. Non-Pulmonic consonants, affricates, co-articulated consonants, and dipthongs arenotimplemented yet. This kind of software is very prone to human errors, and required unit tests are not implemented so far.UsageGet lists of IPA phonsimportipasymbols# all vowelsall_vowels=ipasymbols.phonlist(query={'type':'vowel'})# front vowelsfront_vowels=ipasymbols.phonlist(query={'type':'vowel','backness':'front'})# diphthongs (2 char vowels)diphthongs=ipasymbols.phonlist(query={'type':'diphthong'})# different types of consonantsconsonants=ipasymbols.phonlist(query={'type':["pulmonic","non-pulmonic"]})# consonants = ['m̥', 'm', 'ɱ', 'n̼', ...]Get properties of an IPA phonimportipasymbolsphon='ɪ'props=ipasymbols.props(phon=phon,keys=["height"])# props = {'height': 'near-close'}Count certain kinds of IPA symbolsimportipasymbolsipatext="de:ɐ̯ kɔʊd ɪst fɔl blø:t abɐ aʊ̯x tɔl"# vowelsall_vowels=ipasymbols.count(ipatext,query={'type':'vowel'})# front vowelsfront_vowels=ipasymbols.count(ipatext,query={'type':'vowel','backness':'front'})# diphthongs (2 char vowels)diphthongs=ipasymbols.count(ipatext,query={'type':'diphthong'})# different types of consonantsconsonants=ipasymbols.count(ipatext,query={'type':["pulmonic","non-pulmonic"]})Count consonant clustersimportipasymbolsipatext="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 databaseimportipasymbolsmydict=ipasymbols.dbAppendixInstallationTheipasymbolsgit repois available asPyPi packagepipinstallipasymbols
pipinstallgit+ssh://git@github.com/ulf1/ipasymbols.gitInstall a virtual environmentpython3-mvenv.venvsource.venv/bin/activate
pipinstall--upgradepip
pipinstall-rrequirements.txt--no-cache-dir
pipinstall-rrequirements-dev.txt--no-cache-dir
pipinstall-rrequirements-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 commandsJupyter for the examples:jupyter labCheck syntax:flake8 --ignore=F401 --exclude=$(grep -v '^#' .gitignore | xargs | sed -e 's/ /,/g'),./ipasymbols/ipasymbols.pyRun Unit Tests:PYTHONPATH=. pytestPublishpythonsetup.pysdisttwineupload-rpypidist/*Clean upfind.-typef-name"*.pyc"|xargsrm
find.-typed-name"__pycache__"|xargsrm-r
rm-r.pytest_cache
rm-r.venvSupportPleaseopen an issuefor support.ContributingPlease contribute usingGithub Flow. Create a branch, add commits, andopen a pull request.AcknowledgementsThe "Evidence" project was funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) -433249742(GU 798/27-1; GE 1119/11-1).Maintenancetill 31.Aug.2023 (v0.0.1) the code repository was maintained within the DFG project433249742since 01.Sep.2023 (v0.1.0) the code repository is maintained by Ulf Hamster.CitationYou 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",
}