{"id":21680,"library":"panphon","title":"PanPhon","description":"Tools for using the International Phonetic Alphabet (IPA) with phonological features. Supports feature extraction, segment similarity, alignment, and manipulation of Unicode IPA strings. Current version 0.22.2, release cadence irregular.","status":"active","version":"0.22.2","language":"python","source_language":"en","source_url":"https://github.com/dmort27/panphon","tags":["phonetics","IPA","phonological features"],"install":[{"cmd":"pip install panphon","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"array operations","package":"numpy","optional":false},{"reason":"loading feature data","package":"PyYAML","optional":false}],"imports":[{"note":"","wrong":"","symbol":"FeatureTable","correct":"from panphon import FeatureTable"},{"note":"","wrong":"","symbol":"Segment","correct":"from panphon.segment import Segment"},{"note":"","wrong":"","symbol":"IPA","correct":"from panphon import IPA"}],"quickstart":{"code":"from panphon import FeatureTable\n\nft = FeatureTable()\n# Feature vector for a segment\nvec = ft.word_fts('p')\nprint(vec)\n# Segment similarity\nsim = ft.hamming_distance('p', 'b')\nprint(sim)\n# Feature-based edit distance\nfrom panphon.distance import Distance\nd = Distance()\nprint(d.dolgo_prime_distance('pan', 'ban'))","lang":"python","description":"Load feature table, get feature vectors, compute segment distances."},"warnings":[{"fix":"Use FeatureTable('path/to/features.yaml') to load custom features.","message":"FeatureTable() loads a default feature set. If you need a custom set, pass a file path. The default is based on the 'panphon' bundle (SPE features plus extensions).","severity":"gotcha","affected_versions":"all"},{"fix":"Replace `from panphon.editdistance import dolgo_prime_distance` with `from panphon.distance import Distance; Distance().dolgo_prime_distance(...)`.","message":"The `panphon.editdistance` module and its functions (e.g., `dolgo_prime_distance`) are deprecated in favor of `panphon.distance.Distance` class methods.","severity":"deprecated","affected_versions":">=0.19"},{"fix":"Use `for vec in ft.word_fts('hello'):` to process each segment.","message":"The `word_fts` method returns a list of feature vectors for each segment, not a single tensor. Iterate over the list to get individual segment vectors.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use `from panphon.distance import Distance` and call methods like `Distance().dolgo_prime_distance(...)`.","cause":"The `editdistance` module was removed in version 0.19. Use `panphon.distance` instead.","error":"ImportError: No module named 'panphon.editdistance'"},{"fix":"Upgrade to panphon 0.19 or later: `pip install --upgrade panphon`.","cause":"Deprecated YAML.load call in older versions (fixed in 0.19). Update to 0.19+ or use safe loader.","error":"YAML load error."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}