all: correct comment typos

Change-Id: I1e31e93937e960fc7fcc4672208dae067e1f33e7
GitHub-Last-Rev: 9cdbf6ffdf7640755b32c9f965e6b7321bea5eb3
GitHub-Pull-Request: golang/text#42
Reviewed-on: https://go-review.googlesource.com/c/text/+/465655
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
diff --git a/collate/build/builder.go b/collate/build/builder.go
index 3efb738..e37b410 100644
--- a/collate/build/builder.go
+++ b/collate/build/builder.go
@@ -240,7 +240,7 @@
 //	t.SetAnchor("u")
 //	t.Insert(colltab.Secondary, "ü", "e")
 //
-// Order "q" afer "ab" at the secondary level and "Q" after "q"
+// Order "q" after "ab" at the secondary level and "Q" after "q"
 // at the tertiary level:
 //
 //	t.SetAnchor("ab")
diff --git a/collate/build/order.go b/collate/build/order.go
index 23fcf67..21d4bee 100644
--- a/collate/build/order.go
+++ b/collate/build/order.go
@@ -308,7 +308,7 @@
 	return o
 }
 
-// patchForInsert eleminates entries from the list with more than one collation element.
+// patchForInsert eliminates entries from the list with more than one collation element.
 // The next and prev fields of the eliminated entries still point to appropriate
 // values in the newly created list.
 // It requires that sort has been called.
diff --git a/collate/build/order_test.go b/collate/build/order_test.go
index 0e174bf..38c499e 100644
--- a/collate/build/order_test.go
+++ b/collate/build/order_test.go
@@ -92,7 +92,7 @@
 
 // nextPerm generates the next permutation of the array.  The starting
 // permutation is assumed to be a list of integers sorted in increasing order.
-// It returns false if there are no more permuations left.
+// It returns false if there are no more permutations left.
 func nextPerm(a []int) bool {
 	i := len(a) - 2
 	for ; i >= 0; i-- {
diff --git a/collate/tools/colcmp/col.go b/collate/tools/colcmp/col.go
index dc22d2e..e972c50 100644
--- a/collate/tools/colcmp/col.go
+++ b/collate/tools/colcmp/col.go
@@ -73,7 +73,7 @@
 	return nil
 }
 
-// goCollator is an implemention of Collator using go's own collator.
+// goCollator is an implementation of Collator using go's own collator.
 type goCollator struct {
 	c   *collate.Collator
 	buf collate.Buffer
diff --git a/encoding/ianaindex/ianaindex_test.go b/encoding/ianaindex/ianaindex_test.go
index d545fcf..5bcc449 100644
--- a/encoding/ianaindex/ianaindex_test.go
+++ b/encoding/ianaindex/ianaindex_test.go
@@ -49,9 +49,9 @@
 		}
 	}
 
-	// Many encodings in the IANA index will likely not be suppored by the
+	// Many encodings in the IANA index will likely not be supported by the
 	// Go encodings. That is fine.
-	// TODO: consider wheter we should add this test.
+	// TODO: consider whether we should add this test.
 	// for code, mib := range ianaToMIB {
 	// 	t.Run(fmt.Sprint("IANA:", mib), func(t *testing.T) {
 	// 		if !mibs[mib] {
diff --git a/encoding/internal/internal.go b/encoding/internal/internal.go
index 75a5fd1..413e6fc 100644
--- a/encoding/internal/internal.go
+++ b/encoding/internal/internal.go
@@ -64,7 +64,7 @@
 // byte.
 type RepertoireError byte
 
-// Error implements the error interrface.
+// Error implements the error interface.
 func (r RepertoireError) Error() string {
 	return "encoding: rune not supported by encoding."
 }
diff --git a/internal/export/idna/idna9.0.0.go b/internal/export/idna/idna9.0.0.go
index 4979fdc..96424a0 100644
--- a/internal/export/idna/idna9.0.0.go
+++ b/internal/export/idna/idna9.0.0.go
@@ -121,7 +121,7 @@
 	}
 }
 
-// StrictDomainName limits the set of permissable ASCII characters to those
+// StrictDomainName limits the set of permissible ASCII characters to those
 // allowed in domain names as defined in RFC 1034 (A-Z, a-z, 0-9 and the
 // hyphen). This is set by default for MapForLookup and ValidateForRegistration,
 // but is only useful if ValidateLabels is set.
diff --git a/internal/number/decimal.go b/internal/number/decimal.go
index 37e0c4b..e128cf3 100644
--- a/internal/number/decimal.go
+++ b/internal/number/decimal.go
@@ -419,7 +419,7 @@
 		}
 	} else {
 		// TODO: At this point strconv's rounding is imprecise to the point that
-		// it is not useable for this purpose.
+		// it is not usable for this purpose.
 		// See https://github.com/golang/go/issues/21714
 		// If rounding is requested, we ask for a large number of digits and
 		// round from there to simulate rounding only once.
diff --git a/language/match_test.go b/language/match_test.go
index 313580b..17afc32 100644
--- a/language/match_test.go
+++ b/language/match_test.go
@@ -99,7 +99,7 @@
 func TestMatchStrings(t *testing.T) {
 	testCases := []struct {
 		supported string
-		desired   string // strings separted by |
+		desired   string // strings separated by |
 		tag       string
 		index     int
 	}{{
diff --git a/message/pipeline/pipeline.go b/message/pipeline/pipeline.go
index cafd6f2..34f15f8 100644
--- a/message/pipeline/pipeline.go
+++ b/message/pipeline/pipeline.go
@@ -90,7 +90,7 @@
 	// file. If not specified it is relative to the current directory.
 	GenPackage string
 
-	// DeclareVar defines a variable to which to assing the generated Catalog.
+	// DeclareVar defines a variable to which to assign the generated Catalog.
 	DeclareVar string
 
 	// SetDefault determines whether to assign the generated Catalog to
diff --git a/number/option.go b/number/option.go
index de96f8e..eab1e3b 100644
--- a/number/option.go
+++ b/number/option.go
@@ -172,6 +172,6 @@
 // - FormatPosition (using type aliasing?)
 // - Multiplier: find a better way to represent and figure out what to do
 //   with clashes with percent/permille.
-// - NumberingSystem(nu string): not accessable in number.Info now. Also, should
+// - NumberingSystem(nu string): not accessible in number.Info now. Also, should
 //      this be keyed by language or generic?
 // - SymbolOverrides(symbols map[string]map[number.SymbolType]string) Option
diff --git a/secure/precis/class_test.go b/secure/precis/class_test.go
index fbaf645..aa66c55 100644
--- a/secure/precis/class_test.go
+++ b/secure/precis/class_test.go
@@ -13,7 +13,7 @@
 // Compile-time regression test to ensure that Class is a Set
 var _ runes.Set = (*class)(nil)
 
-// Ensure that certain characters are (or are not) in the identifer class.
+// Ensure that certain characters are (or are not) in the identifier class.
 func TestClassContains(t *testing.T) {
 	tests := []struct {
 		name       string
diff --git a/unicode/cldr/decode.go b/unicode/cldr/decode.go
index 1abcb9e..7a8fb5a 100644
--- a/unicode/cldr/decode.go
+++ b/unicode/cldr/decode.go
@@ -32,7 +32,7 @@
 	// TODO: automatically set dir filter
 }
 
-// SetDirFilter limits the loading of LDML XML files of the specied directories.
+// SetDirFilter limits the loading of LDML XML files of the specified directories.
 // Note that sections may be split across directories differently for different CLDR versions.
 // For more robust code, use SetSectionFilter.
 func (d *Decoder) SetDirFilter(dir ...string) {
diff --git a/unicode/norm/forminfo.go b/unicode/norm/forminfo.go
index d69ccb4..487335d 100644
--- a/unicode/norm/forminfo.go
+++ b/unicode/norm/forminfo.go
@@ -13,7 +13,7 @@
 // a rune to a uint16. The values take two forms.  For v >= 0x8000:
 //   bits
 //   15:    1 (inverse of NFD_QC bit of qcInfo)
-//   13..7: qcInfo (see below). isYesD is always true (no decompostion).
+//   13..7: qcInfo (see below). isYesD is always true (no decomposition).
 //    6..0: ccc (compressed CCC value).
 // For v < 0x8000, the respective rune has a decomposition and v is an index
 // into a byte array of UTF-8 decomposition sequences and additional info and