How we made Typerighter, the Guardian’s style guide checker

Lots of regular expressions, and a timely demonstration by an editorial colleague, led to a two year side-project that eventually ended up in production The Guardian’s style guide was originally published in 1928 as a physical book, and is available to everyone on our website. Over time, it’s grown bigger and more complex, containing guidelines […]

Lots of regular expressions, and a timely demonstration by an editorial colleague, led to a two year side-project that eventually ended up in production

The Guardian’s style guide was originally published in 1928 as a physical book, and is available to everyone on our website. Over time, it’s grown bigger and more complex, containing guidelines on important topics that we want to get right. Last year, for example, we updated it to more accurately describe the environmental crisis facing the world. In short, our style guide is ever-expanding, and it changes to reflect our times and values. How do journalists writing and editing content keep up to date?

I’m a software engineer on the Guardian’s Editorial Tools team. Two years ago, the team were introduced to Max Walker, who had been working on an answer to that question. As a subeditor on the Features desk, Max had begun writing regular expressions – short sequences of characters to search for patterns in text (regex) – to help spot copy that didn’t match parts of the style guide. He’d begun work on them about a year before, and had written a script to apply them to copy as it appeared on our website.

A rule management service, to store the list of rules and manage it as it changes over time.

A rule application service, to check documents against that list of rules and return matched text.

A client to provide a UI in the browser and interact with the rule application.

A telemetry service, to let us know how the application is performing, from both a system and a user perspective.

Continue reading…
Source: Guardian