{"id":24574,"library":"sentencex","title":"sentencex","description":"A sentence segmentation library supporting ~300 languages, powered by Rust for performance. Version 1.0.23, MIT license, maintained by Wikimedia. Releases are frequent with multilingual improvements.","status":"active","version":"1.0.23","language":"python","source_language":"en","source_url":"https://github.com/wikimedia/sentencex","tags":["sentence segmentation","multilingual","nlp","rust"],"install":[{"cmd":"pip install sentencex","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Function is in module, not as attribute of package.","wrong":"import sentencex\nsentencex.segment()","symbol":"segment","correct":"from sentencex import segment"}],"quickstart":{"code":"from sentencex import segment\n\ntext = \"Hello world! This is a test. And another sentence.\"\nsentences = segment('en', text)\nprint(list(sentences))","lang":"python","description":"Basic usage: segment English text into sentences."},"warnings":[{"fix":"Wrap with list() or iterate.","message":"The segment function returns a generator, not a list. Must be consumed (e.g., list()) to see all sentences.","severity":"gotcha","affected_versions":"all"},{"fix":"Use 'en' for English; see README for supported codes.","message":"Language code must be lowercase (e.g., 'en', 'zh') but not all ISO codes are supported. Check support list.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"sentences = list(segment('en', text))","cause":"segment returns a generator, not a list.","error":"TypeError: 'generator' object is not subscriptable"},{"fix":"Use 'en' instead of 'English'.","cause":"Language code must be ISO 639-1 two-letter code, not language name.","error":"ValueError: Unsupported language code: 'English'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}