Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Pluralize to give correct pluralization in many GAP library methods #4050

Merged
merged 1 commit into from
Jul 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/ref/algebra.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ gap> m:= [ [ 0, 2, 3 ], [ 0, 0, 4 ], [ 0, 0, 0] ];;
gap> A:= AlgebraWithOne( Rationals, [ m ] );;
gap> I:= Ideal( A, [ m ] ); # the two-sided ideal of `A' generated by `m'
<two-sided ideal in <algebra-with-one of dimension 3 over Rationals>,
(1 generators)>
(1 generator)>
gap> Dimension( I );
2
gap> GeneratorsOfIdeal( I );
Expand All @@ -121,7 +121,7 @@ gap> BasisVectors( Basis( I ) );
gap> A:= FullMatrixAlgebra( Rationals, 4 );;
gap> m:= NullMat( 4, 4 );; m[1][4]:=1;;
gap> I:= LeftIdeal( A, [ m ] );
<left ideal in ( Rationals^[ 4, 4 ] ), (1 generators)>
<left ideal in ( Rationals^[ 4, 4 ] ), (1 generator)>
gap> Dimension( I );
4
gap> GeneratorsOfLeftIdeal( I );
Expand Down
2 changes: 1 addition & 1 deletion doc/ref/arith.xml
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ hence the generic methods for such domains will have a chance to succeed.
gap> a:= MyObject( Z(7) );
<Z(7)>
gap> m:= Magma( a );
<magma with 1 generators>
<magma with 1 generator>
gap> e:= MultiplicativeNeutralElement( m );
<Z(7)^2>
gap> elms:= AsList( m );
Expand Down
2 changes: 1 addition & 1 deletion doc/ref/fldabnum.xml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ over a non-cyclotomic field.
<P/>
<Example><![CDATA[
gap> g:= GaloisGroup( AsField( Field( [ Sqrt(5) ] ), CF(5) ) );
<group of size 2 with 1 generators>
<group of size 2 with 1 generator>
gap> gens:= GeneratorsOfGroup( g );
[ ANFAutomorphism( AsField( NF(5,[ 1, 4 ]), CF(5) ), 4 ) ]
gap> x:= last[1];; x^2;
Expand Down
2 changes: 1 addition & 1 deletion doc/ref/methsel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ gap> InstallMethod(XCons, [IsGroup, IsInt], function(t,x) return CyclicGroup(x);
gap> InstallMethod(XCons, [IsPermGroup, IsInt], function(t,x) return SymmetricGroup(x); end);
gap> InstallMethod(XCons, [IsSemigroup, IsInt], function(t,x) return FullTransformationMonoid(x); end);
gap> XCons(IsGroup,3);
<pc group of size 3 with 1 generators>
<pc group of size 3 with 1 generator>
gap> XCons(IsPermGroup,3);
Sym( [ 1 .. 3 ] )
gap> XCons(IsSemigroup,4);
Expand Down
4 changes: 2 additions & 2 deletions doc/ref/reesmat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ gap> mat:=[[(), 0, 0], [0, (), 0], [0, 0, ()],
> [(), (), ()], [0, 0, ()]];;
gap> R:=ReesZeroMatrixSemigroup(G, mat);
<Rees 0-matrix semigroup 3x5 over
<permutation group of size 1007 with 1 generators>>
<permutation group of size 1007 with 1 generator>>
gap> ReesZeroMatrixSubsemigroup(R, [1,3], G, [1..5]);
<Rees 0-matrix semigroup 2x5 over
<permutation group of size 1007 with 1 generators>>
<permutation group of size 1007 with 1 generator>>
]]></Example>
</Description>
</ManSection>
Expand Down
4 changes: 2 additions & 2 deletions doc/tut/algvspc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -420,12 +420,12 @@ of an algebra by an ideal is naturally an algebra itself.
gap> m:= [ [ 1, 2, 3 ], [ 0, 1, 6 ], [ 0, 0, 1 ] ];;
gap> A:= Algebra( Rationals, [ m ] );;
gap> subA:= Subalgebra( A, [ m-m^2 ] );
<algebra over Rationals, with 1 generators>
<algebra over Rationals, with 1 generator>
gap> Dimension( subA );
2
gap> idA:= Ideal( A, [ m-m^3 ] );
<two-sided ideal in <algebra of dimension 3 over Rationals>,
(1 generators)>
(1 generator)>
gap> Dimension( idA );
2
gap> B:= A/idA;
Expand Down
4 changes: 2 additions & 2 deletions grp/basic.gd
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,11 @@ DeclareConstructor( "CyclicGroupCons", [ IsGroup, IsInt ] );
## gap> CyclicGroup(IsPermGroup,12);
## Group([ (1,2,3,4,5,6,7,8,9,10,11,12) ])
## gap> matgrp1:= CyclicGroup( IsMatrixGroup, 12 );
## <matrix group of size 12 with 1 generators>
## <matrix group of size 12 with 1 generator>
## gap> FieldOfMatrixGroup( matgrp1 );
## Rationals
## gap> matgrp2:= CyclicGroup( IsMatrixGroup, GF(2), 12 );
## <matrix group of size 12 with 1 generators>
## <matrix group of size 12 with 1 generator>
## gap> FieldOfMatrixGroup( matgrp2 );
## GF(2)
## ]]></Example>
Expand Down
19 changes: 11 additions & 8 deletions lib/addmagma.gi
Original file line number Diff line number Diff line change
Expand Up @@ -68,33 +68,36 @@ InstallMethod( ViewObj,
"for an add. magma with generators",
[ IsAdditiveMagma and HasGeneratorsOfAdditiveMagma ],
function( A )
Print( "<additive magma with ",
Length( GeneratorsOfAdditiveMagma( A ) ), " generators>" );
local nrgens;
nrgens := Length( GeneratorsOfAdditiveMagma( A ) );
Print( "<additive magma with ", Pluralize( nrgens, "generator" ), ">" );
end );

InstallMethod( ViewObj,
"for an add. magma-with-zero with generators",
[ IsAdditiveMagmaWithZero and HasGeneratorsOfAdditiveMagmaWithZero ],
function( A )
if IsEmpty( GeneratorsOfAdditiveMagmaWithZero( A ) ) then
local nrgens;
nrgens := GeneratorsOfAdditiveMagmaWithZero( A );
if nrgens = 0 then
Print( "<trivial additive magma-with-zero>" );
else
Print( "<additive magma-with-zero with ",
Length( GeneratorsOfAdditiveMagmaWithZero( A ) ),
" generators>" );
Pluralize( nrgens, "generator" ), ">" );
fi;
end );

InstallMethod( ViewObj,
"for an add. magma-with-inverses with generators",
[ IsAdditiveGroup and HasGeneratorsOfAdditiveGroup ],
function( A )
if IsEmpty( GeneratorsOfAdditiveGroup( A ) ) then
local nrgens;
nrgens := GeneratorsOfAdditiveGroup( A );
if nrgens = 0 then
Print( "<trivial additive magma-with-inverses>" );
else
Print( "<additive magma-with-inverses with ",
Length( GeneratorsOfAdditiveGroup( A ) ),
" generators>" );
Pluralize( nrgens, "generator" ), ">" );
fi;
end );

Expand Down
40 changes: 20 additions & 20 deletions lib/algebra.gd
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ DeclareAttribute( "GeneratorsOfLeftOperatorRingWithOne",
## <Example><![CDATA[
## gap> m:= [ [ 0, 1, 2 ], [ 0, 0, 3 ], [ 0, 0, 0 ] ];;
## gap> A:= AlgebraWithOne( Rationals, [ m ] );
## <algebra-with-one over Rationals, with 1 generators>
## <algebra-with-one over Rationals, with 1 generator>
## gap> GeneratorsOfAlgebra( A );
## [ [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ],
## [ [ 0, 1, 2 ], [ 0, 0, 3 ], [ 0, 0, 0 ] ] ]
Expand Down Expand Up @@ -287,7 +287,7 @@ DeclareSynonymAttr( "GeneratorsOfFLMLOR", GeneratorsOfLeftOperatorRing );
## <Example><![CDATA[
## gap> m:= [ [ 0, 1, 2 ], [ 0, 0, 3 ], [ 0, 0, 0 ] ];;
## gap> A:= AlgebraWithOne( Rationals, [ m ] );
## <algebra-with-one over Rationals, with 1 generators>
## <algebra-with-one over Rationals, with 1 generator>
## gap> GeneratorsOfAlgebraWithOne( A );
## [ [ [ 0, 1, 2 ], [ 0, 0, 3 ], [ 0, 0, 0 ] ] ]
## ]]></Example>
Expand Down Expand Up @@ -408,7 +408,7 @@ DeclareAttribute( "IndicesOfAdjointBasis", IsBasis );
## <Example><![CDATA[
## gap> m:= [ [ 0, 1, 2 ], [ 0, 0, 3 ], [ 0, 0, 0 ] ];;
## gap> A:= AlgebraWithOneByGenerators( Rationals, [ m ] );
## <algebra-with-one over Rationals, with 1 generators>
## <algebra-with-one over Rationals, with 1 generator>
## gap> RadicalOfAlgebra( A );
## <algebra of dimension 2 over Rationals>
## ]]></Example>
Expand Down Expand Up @@ -439,19 +439,19 @@ DeclareAttribute( "RadicalOfAlgebra", IsAlgebra );
## gap> dd:= DirectSumDecomposition( A );
## [ <two-sided ideal in
## <algebra-with-one of dimension 24 over Rationals>,
## (1 generators)>,
## (1 generator)>,
## <two-sided ideal in
## <algebra-with-one of dimension 24 over Rationals>,
## (1 generators)>,
## (1 generator)>,
## <two-sided ideal in
## <algebra-with-one of dimension 24 over Rationals>,
## (1 generators)>,
## (1 generator)>,
## <two-sided ideal in
## <algebra-with-one of dimension 24 over Rationals>,
## (1 generators)>,
## (1 generator)>,
## <two-sided ideal in
## <algebra-with-one of dimension 24 over Rationals>,
## (1 generators)> ]
## (1 generator)> ]
## gap> List( dd, Dimension );
## [ 1, 1, 4, 9, 9 ]
## ]]></Example>
Expand Down Expand Up @@ -543,7 +543,7 @@ DeclareAttribute( "NullAlgebra", IsRing );
## gap> A:= QuaternionAlgebra( Rationals );;
## gap> b:= BasisVectors( Basis( A ) );;
## gap> B:= Subalgebra( A, [ b[4] ] );
## <algebra over Rationals, with 1 generators>
## <algebra over Rationals, with 1 generator>
## gap> ProductSpace( A, B );
## <vector space of dimension 4 over Rationals>
## ]]></Example>
Expand Down Expand Up @@ -662,7 +662,7 @@ DeclareSynonym( "AsAlgebra", AsFLMLOR );
## gap> V:= VectorSpace( Rationals, [ IdentityMat( 2 ) ] );;
## gap> A:= AsAlgebra( Rationals, V );;
## gap> AsAlgebraWithOne( Rationals, A );
## <algebra-with-one over Rationals, with 1 generators>
## <algebra-with-one over Rationals, with 1 generator>
## ]]></Example>
## </Description>
## </ManSection>
Expand Down Expand Up @@ -721,7 +721,7 @@ DeclareSynonym( "AsSubalgebra", AsSubFLMLOR );
## gap> B:= AsAlgebra( Rationals, V );;
## gap> C:= AsAlgebraWithOne( Rationals, B );;
## gap> AC:= AsSubalgebraWithOne( A, C );
## <algebra-with-one over Rationals, with 1 generators>
## <algebra-with-one over Rationals, with 1 generator>
## ]]></Example>
## </Description>
## </ManSection>
Expand Down Expand Up @@ -1133,7 +1133,7 @@ DeclareGlobalFunction( "MutableBasisOfNonassociativeAlgebra" );
## gap> basA:= BasisVectors( Basis( A ) );;
## gap> B:= MutableBasisOfIdealInNonassociativeAlgebra( Rationals, basA,
## > [ mats[2] ], 0*mats[1], "both", infinity );
## <mutable basis over Rationals, 1 vectors>
## <mutable basis over Rationals, 1 vector>
## gap> BasisVectors( B );
## [ [ [ 0, 1 ], [ 0, 0 ] ] ]
## ]]></Example>
Expand Down Expand Up @@ -1189,7 +1189,7 @@ DeclareSynonym( "AlgebraByGenerators", FLMLORByGenerators );
## <Example><![CDATA[
## gap> m:= [ [ 0, 1, 2 ], [ 0, 0, 3], [ 0, 0, 0 ] ];;
## gap> A:= Algebra( Rationals, [ m ] );
## <algebra over Rationals, with 1 generators>
## <algebra over Rationals, with 1 generator>
## gap> Dimension( A );
## 2
## ]]></Example>
Expand Down Expand Up @@ -1226,9 +1226,9 @@ DeclareSynonym( "Algebra", FLMLOR );
## <Example><![CDATA[
## gap> m:= [ [ 0, 1, 2 ], [ 0, 0, 3], [ 0, 0, 0 ] ];;
## gap> A:= Algebra( Rationals, [ m ] );
## <algebra over Rationals, with 1 generators>
## <algebra over Rationals, with 1 generator>
## gap> B:= Subalgebra( A, [ m^2 ] );
## <algebra over Rationals, with 1 generators>
## <algebra over Rationals, with 1 generator>
## ]]></Example>
## </Description>
## </ManSection>
Expand All @@ -1254,7 +1254,7 @@ DeclareSynonym( "Subalgebra", SubFLMLOR );
## <Example><![CDATA[
## gap> m:= RandomMat( 3, 3 );;
## gap> A:= Algebra( Rationals, [ m ] );
## <algebra over Rationals, with 1 generators>
## <algebra over Rationals, with 1 generator>
## gap> SubalgebraNC( A, [ IdentityMat( 3, 3 ) ], "basis" );
## <algebra of dimension 1 over Rationals>
## ]]></Example>
Expand Down Expand Up @@ -1308,7 +1308,7 @@ DeclareSynonym( "AlgebraWithOneByGenerators", FLMLORWithOneByGenerators );
## <Example><![CDATA[
## gap> m:= [ [ 0, 1, 2 ], [ 0, 0, 3], [ 0, 0, 0 ] ];;
## gap> A:= AlgebraWithOne( Rationals, [ m ] );
## <algebra-with-one over Rationals, with 1 generators>
## <algebra-with-one over Rationals, with 1 generator>
## gap> Dimension( A );
## 3
## gap> One(A);
Expand Down Expand Up @@ -1342,7 +1342,7 @@ DeclareSynonym( "AlgebraWithOne", FLMLORWithOne );
## <Example><![CDATA[
## gap> m:= [ [ 0, 1, 2 ], [ 0, 0, 3], [ 0, 0, 0 ] ];;
## gap> A:= AlgebraWithOne( Rationals, [ m ] );
## <algebra-with-one over Rationals, with 1 generators>
## <algebra-with-one over Rationals, with 1 generator>
## gap> B1:= SubalgebraWithOne( A, [ m ] );;
## gap> B2:= Subalgebra( A, [ m ] );;
## gap> Dimension( B1 );
Expand Down Expand Up @@ -1374,7 +1374,7 @@ DeclareSynonym( "SubalgebraWithOne", SubFLMLORWithOne );
## <Example><![CDATA[
## gap> m:= RandomMat( 3, 3 );; A:= Algebra( Rationals, [ m ] );;
## gap> SubalgebraWithOneNC( A, [ m ] );
## <algebra-with-one over Rationals, with 1 generators>
## <algebra-with-one over Rationals, with 1 generator>
## ]]></Example>
## </Description>
## </ManSection>
Expand Down Expand Up @@ -2168,7 +2168,7 @@ DeclareSynonym( "IsLieNilpotentElement", IsNilpotentElement);
## rec( hom_components := function( d ) ... end, max_degree := 9,
## min_degree := 1, source := Integers )
## gap> g.hom_components( 3 );
## <vector space over GF(3), with 1 generators>
## <vector space over GF(3), with 1 generator>
## gap> g.hom_components( 14 );
## <vector space of dimension 0 over GF(3)>
## ]]></Example>
Expand Down
15 changes: 9 additions & 6 deletions lib/algebra.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1889,7 +1889,7 @@ InstallMethod( ViewObj,
function( A )
Print( "<free left module over ", LeftActingDomain( A ),
", and ring, with ",
Length( GeneratorsOfFLMLOR( A ) ), " generators>" );
Pluralize( Length( GeneratorsOfFLMLOR( A ) ), "generator" ), ">" );
end );


Expand Down Expand Up @@ -1945,8 +1945,8 @@ InstallMethod( ViewObj,
function( A )
Print( "<free left module over ", LeftActingDomain( A ),
", and ring-with-one, with ",
Length( GeneratorsOfAlgebraWithOne( A ) ), " generators>" );

Pluralize( Length( GeneratorsOfAlgebraWithOne( A ) ), "generator" ),
">" );
end );


Expand Down Expand Up @@ -2001,7 +2001,7 @@ InstallMethod( ViewObj,
[ IsAlgebra and HasGeneratorsOfAlgebra ],
function( A )
Print( "<algebra over ", LeftActingDomain( A ), ", with ",
Length( GeneratorsOfAlgebra( A ) ), " generators>" );
Pluralize( Length( GeneratorsOfAlgebra( A ) ), "generator" ), ">" );
end );


Expand Down Expand Up @@ -2056,8 +2056,10 @@ InstallMethod( ViewObj,
"for an algebra-with-one with known generators",
[ IsAlgebraWithOne and HasGeneratorsOfAlgebraWithOne ],
function( A )
local nrgens;
Print( "<algebra-with-one over ", LeftActingDomain( A ), ", with ",
Length( GeneratorsOfAlgebraWithOne( A ) ), " generators>" );
Pluralize( Length( GeneratorsOfAlgebraWithOne( A ) ), "generator" ),
">" );
end );


Expand Down Expand Up @@ -2111,8 +2113,9 @@ InstallMethod( ViewObj,
"for a Lie algebra with known generators",
[ IsLieAlgebra and HasGeneratorsOfAlgebra ],
function( A )
local nrgens;
Print( "<Lie algebra over ", LeftActingDomain( A ), ", with ",
Length( GeneratorsOfAlgebra( A ) ), " generators>" );
Pluralize( Length( GeneratorsOfAlgebra( A ) ), "generator" ), ">" );
end );


Expand Down
4 changes: 2 additions & 2 deletions lib/alglie.gd
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ DeclareOperation( "PthPowerImage", [ IsJacobianElement, IsInt ] );
## gap> L := JenningsLieAlgebra(SmallGroup(4,1)); # group C_4
## <Lie algebra of dimension 2 over GF(2)>
## gap> L0 := Subalgebra(L,GeneratorsOfAlgebra(L){[1]});
## <Lie algebra over GF(2), with 1 generators>
## <Lie algebra over GF(2), with 1 generator>
## gap> Dimension(L0);
## 1
## gap> PClosureSubalgebra(L0); last=L;
Expand Down Expand Up @@ -1468,7 +1468,7 @@ DeclareAttribute( "JenningsLieAlgebra", IsGroup );
## gap> List( [1,2,3], g.hom_components );
## [ <vector space over GF(3), with 3 generators>,
## <vector space over GF(3), with 2 generators>,
## <vector space over GF(3), with 1 generators> ]
## <vector space over GF(3), with 1 generator> ]
## ]]></Example>
## </Description>
## </ManSection>
Expand Down
4 changes: 2 additions & 2 deletions lib/algrep.gd
Original file line number Diff line number Diff line change
Expand Up @@ -677,9 +677,9 @@ DeclareAttribute( "FaithfulModule", IsAlgebra );
## gap> A:= Rationals^[3,3];;
## gap> V:= LeftAlgebraModuleByGenerators( A, \*, [ [ 1, 0, 0 ] ] );;
## gap> B:= Subalgebra( A, [ Basis(A)[1] ] );
## <algebra over Rationals, with 1 generators>
## <algebra over Rationals, with 1 generator>
## gap> W:= ModuleByRestriction( V, B );
## <left-module over <algebra over Rationals, with 1 generators>>
## <left-module over <algebra over Rationals, with 1 generator>>
## ]]></Example>
## </Description>
## </ManSection>
Expand Down
6 changes: 4 additions & 2 deletions lib/basismut.gi
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ InstallMethod( ViewObj,
function( MB )
Print( "<mutable basis over " );
View( MB!.leftActingDomain );
Print( ", ", NrBasisVectors( MB ), " vectors>" );
Print( ", ", Pluralize( NrBasisVectors( MB ), "vector" ), ">" );
end );


Expand Down Expand Up @@ -332,7 +332,9 @@ InstallMethod( ViewObj,
Print( "<mutable basis over " );
View( LeftActingDomain( MB!.leftModule ) );
if IsBound( MB!.niceMutableBasis ) then
Print( ", ", NrBasisVectors( MB!.niceMutableBasis ), " vectors>" );
Print( ", ",
Pluralize( NrBasisVectors( MB!.niceMutableBasis ), "vector" ),
">" );
else
Print( ", 0 vectors>" );
fi;
Expand Down
2 changes: 1 addition & 1 deletion lib/gprd.gd
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ DeclareGlobalFunction("SubdirectDiagonalPerms");
## gap> au:=AutomorphismGroup(n);;
## gap> au:=First(AsSet(au),i->Order(i)=3);;
## gap> au:=Group(au);
## <group with 1 generators>
## <group with 1 generator>
## gap> IsGroupOfAutomorphisms(au);
## true
## gap> SemidirectProduct(au,n);
Expand Down
Loading