Skip to content

Commit

Permalink
Correctly pluralize 'patch', 'match', etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Oct 4, 2023
1 parent b0c592c commit 89a9594
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/PrintHelper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions test/PrintHelper-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 89a9594

Please sign in to comment.