Skip to content

sdaschner/capitalize-titles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Capitalize Titles

Java API and command line program to capitalize English titles according to the APA style (in a best-effort manner).

Caution: It doesn’t perform any Grammar analysis and thus might incorrectly return some prepositions, conjunctions, adjective, or adverbs, such as yet, out, so, etc.

Caution No 2: Has been created by a non-native speaker 🙂

Features

  • Capitalizes English titles according to APA
    Example: a river runs through the cityA River Runs Through the City
    Example: my cloud-native deploymentMy Cloud-Native Deployment

  • Ignores trailing special characters (helpful for AsciiDoc & Markdown content)
    Example: === a river runs through the city=== A River Runs Through the City

  • Honors certain characters as stop characters
    Example: breaking news: a river runs through the cityBreaking News: A River Runs Through the City

Building

To build a native executable, execute: mvn package -P native

This will create an executable binary under target/capitalize-title-runner

Command Line Usage

USAGE:
    capitalize-title <title>
                           Capitalizes the provided title according to AP style
    capitalize-title -
                           Reads the title from stdin.
EXAMPLES:
    capitalize-title a river runs through the city
                           Returns: A River Runs Through the City
    cat titles.txt | capitalize-title -
                           Capitalizes each line in the titles.txt file