sentence

package
v2.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package sentence composes the sentences Cartograph stores in parts.

A problem, a change and a programme's aim are written in the interface as two or three fields under their own headings, and the manifest holds exactly those fields. The sentence is an output: `<the groups> <situation>, because <cause>`. Nothing stores it, and everything that shows one — this server's renderer, the web interface, whatever the CLI grows — composes it the same way from the same inputs.

The rules are three, and each was a defect first:

  • A part is a fragment under a heading; the sentence it builds starts with a capital and ends with a stop.
  • A register's name reads as a phrase mid-clause ("so depot staff learn the same day"), not as the heading it is catalogued under.
  • A clause never joins onto a full stop.

The composition also tolerates a part that names its own subject, which is what text written before the parts existed looks like: a situation already beginning with the group's name is not given a second one.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Aim

func Aim(change, gain string) string

Aim composes "<change>, so that <gain>".

func Change

func Change(what, who, gain string) string

Change composes "<what>, so <who> <gain>". Until the gain is written the sentence stops at what will be true, rather than trailing off on a group name.

func Finish

func Finish(s string) string

Finish returns a built sentence with a capital at the front and a stop at the end. A first word that is an acronym or carries an internal capital is left as written, since that is somebody's spelling rather than a fragment's, and a question or exclamation mark is deliberate.

func MidCase

func MidCase(name string) string

MidCase returns a name as it reads inside a clause: an ordinary capitalised word is lowered, an acronym or a name with an internal capital is left alone.

func Problem

func Problem(who, situation, cause string) string

Problem composes "<who> <situation>, because <cause>". A subject with nothing said about it is not a clause, so a problem with no situation and no cause reads as nothing rather than as the group's name.

func SplitAim

func SplitAim(s string) (change, gain string)

func SplitChange

func SplitChange(s string) (what, gain string)

func SplitProblem

func SplitProblem(s string) (situation, cause string)

SplitProblem and SplitChange recover the parts from a sentence stored before the parts existed. They are used once, by the legacy rewrite on read, and never by anything that edits: the subject cannot be separated from the situation without the group names, so it stays where it was written and the composition above leaves it alone.

func WhoPhrase

func WhoPhrase(names []string) string

WhoPhrase is the subject a set of group names makes. Only the first name leads; the rest sit inside the phrase, where a catalogue's heading case reads as a defined term rather than as English.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL