Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# linebreak

A simple app to demonstrate line-breaking algorithms.
A Go library demonstrating line-breaking algorithms with optimal text formatting.


## Overview

This project implements two line-breaking algorithms to format text within specified width constraints:

- **Greedy Algorithm**: Fast, simple approach that fits as many words as possible on each line
- **Knuth-Plass Algorithm**: Sophisticated dynamic programming solution that optimizes line breaks based on penalty functions

## Features

- **Multiple Algorithms:** Choose between greedy and Knuth-Plass line breaking
- **Dynamic Programming:** Efficiently computes optimal line breaks. It uses a penalty for trailing spaces to promote balanced text.
- **Unit Tested:** Includes unit tests to ensure quality and to allow future changes with confidence.

Expand Down