From 89a9594bfc1420ebc827215a03cd228cdcea41b8 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 4 Oct 2023 22:57:22 +0200 Subject: [PATCH] Correctly pluralize 'patch', 'match', etc. --- src/PrintHelper.jl | 3 +++ test/PrintHelper-test.jl | 1 + 2 files changed, 4 insertions(+) diff --git a/src/PrintHelper.jl b/src/PrintHelper.jl index 96d7277b03..5dc3daf9d8 100644 --- a/src/PrintHelper.jl +++ b/src/PrintHelper.jl @@ -35,6 +35,9 @@ function pluralize(noun::String) # maximum -> maxima endswith(noun, "um") && return noun[1:end-2] * "a" + # patch -> patches + endswith(noun, "tch") && return noun * "es" + # family -> families # variety -> varieties endswith(noun, "y") && !(noun[end-1] in "aeiouy") && return noun[1:end-1] * "ies" diff --git a/test/PrintHelper-test.jl b/test/PrintHelper-test.jl index a95111db8d..d3ea885806 100644 --- a/test/PrintHelper-test.jl +++ b/test/PrintHelper-test.jl @@ -5,6 +5,7 @@ @test pluralize("indeterminate") == "indeterminates" @test pluralize("matrix") == "matrices" @test pluralize("maximum") == "maxima" + @test pluralize("patch") == "patches" @test pluralize("polyhedron") == "polyhedra" @test pluralize("tetrahedron") == "tetrahedra" @test pluralize("variable") == "variables"