{"id":22990,"library":"wordsegment","title":"WordSegment","description":"English word segmentation library that segments concatenated text into separate words. Version 1.3.1 released October 2019; no active development since then. Designed for segmenting hashtags, URLs, or other concatenated phrases.","status":"maintenance","version":"1.3.1","language":"python","source_language":"en","source_url":"https://github.com/mammothb/wordsegment","tags":["segmentation","nlp","english","concatenated-text"],"install":[{"cmd":"pip install wordsegment","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"note":"Correct import path.","wrong":"","symbol":"segment","correct":"from wordsegment import segment"}],"quickstart":{"code":"from wordsegment import segment\nprint(segment('wheninthecourse'))  # Output: ['when', 'in', 'the', 'course']","lang":"python","description":"Basic segmentation example using the default model."},"warnings":[{"fix":"Preprocess input to lowercase or clean punctuation. Consider adding custom words to the model.","message":"The library uses a unigram model that may not handle proper nouns or domain-specific terms well. It can produce unexpected segmentations for text with numbers or mixed case.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider using an alternative like 'wordninja' or a more modern NLP library.","message":"This library is no longer actively maintained. Python 2 support may have issues; Python 3 is recommended.","severity":"deprecated","affected_versions":"<=1.3.1"},{"fix":"Remove spaces or punctuation from input before passing to segment.","message":"The 'segment' function expects a single string without spaces. Passing a string with spaces will still segment but may produce incorrect results.","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":"Run 'pip install wordsegment' in the correct Python environment.","cause":"The library is not installed or the environment is wrong.","error":"ImportError: No module named 'wordsegment'"},{"fix":"Use segment('yourtext') with a single string argument.","cause":"Calling segment without arguments or passing keyword incorrectly.","error":"TypeError: segment() missing 1 required positional argument: 'text'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}