# poetry-analysis

[![Release](https://img.shields.io/github/v/release/norn-uio/poetry-analysis)](https://img.shields.io/github/v/release/norn-uio/poetry-analysis)
<!--
[![Build status](https://img.shields.io/github/actions/workflow/status/norn-uio/poetry-analysis/main.yml?branch=main)](https://github.com/norn-uio/poetry-analysis/actions/workflows/main.yml?query=branch%3Amain)
[![codecov](https://codecov.io/gh/norn-uio/poetry-analysis/branch/main/graph/badge.svg)](https://codecov.io/gh/norn-uio/poetry-analysis)
[![License](https://img.shields.io/github/license/norn-uio/poetry-analysis)](https://img.shields.io/github/license/norn-uio/poetry-analysis)
-->

Rule-based tool to extract repetition patterns and other lyric features from poetry, or other text data where the newline is a meaningful segment boundary.

Lyric features that can be extracted with this tool includes

- end rhyme schemes
- alliteration
- anaphora
- lyrical subject

This tool was developed for the [NORN project](https://www.hf.uio.no/iln/english/research/projects/norn-norwegian-romantic-nationalisms/index.html).

It was developed alongside [NORN Poems](https://github.com/norn-uio/norn-poems), a corpus of Norwegian poetry from the 1890's, which is freely available as TEI `.xml` and plain `.txt` files.

- **Github repository**: <https://github.com/norn-uio/poetry-analysis/>
- **Documentation** <https://norn-uio.github.io/poetry-analysis/>

## Installation

This library requires python >= 3.11. Create and activate a virtual environment before installing, e.g. with [`uv`](https://docs.astral.sh/uv/):

```shell
# Create environment with uv
uv venv --python 3.11

# Activate environment
source .venv/bin/activate

# Install poetry_analysis
pip install poetry-analysis
```
