Installation

Requirements

  • Python 3.9 or higher

  • spaCy 3.5 or higher

  • click 8.0 or higher

  • rich 13.0 or higher

Installing phrasplit

The easiest way to install phrasplit is using pip:

pip install phrasplit

Installing from Source

To install from source, clone the repository and install:

git clone https://github.com/holgern/phrasplit.git
cd phrasplit
pip install -e .

For development, install with dev dependencies:

pip install -e ".[dev]"

Installing spaCy Language Models

phrasplit requires a spaCy language model for sentence detection. The default model is en_core_web_sm (English). Install it with:

python -m spacy download en_core_web_sm

For better accuracy, you can use larger models:

# Medium model (more accurate)
python -m spacy download en_core_web_md

# Large model (most accurate)
python -m spacy download en_core_web_lg

For other languages, see the spaCy models documentation.

Verifying Installation

You can verify your installation by running:

import phrasplit
print(phrasplit.__version__)

from phrasplit import split_sentences
print(split_sentences("Hello world. How are you?"))
# ['Hello world.', 'How are you?']