Documentation
¶
Overview ¶
Package initialism provides a list of alternative spellings, acronyms and initialisms for the named releasers.
Alternative spellings are the same name but with different casing, spelling or punctuation (e.g. Coca-Cola, Coke).
An acronym is an abbreviation formed from the initial letters of other words and pronounced as a word (e.g. NATO).
An initialism is an abbreviation consisting of the initial letters pronounced invidivually (e.g. USA).
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Initialism ¶
Initialism returns the alternative spellings, acronyms and initialisms for the URL path. Or an empty slice if the URL path has no initialism.
Example:
Initialism("the-firm") = []string{"FiRM, FRM"} Initialism("defacto2") = []string{"DF2"}
Example ¶
package main import ( "fmt" "github.com/Defacto2/releaser/initialism" ) func main() { fmt.Println(initialism.Initialism("defacto2")) }
Output: [DF2 DF]
func IsInitialism ¶
IsInitialism returns true if the URL path has an initialism.
Example:
IsInitialism("the-firm") = true IsInitialism("defacto2") = true IsInitialism("some-random-bbs") = false
Example ¶
package main import ( "fmt" "github.com/Defacto2/releaser/initialism" ) func main() { fmt.Println(initialism.IsInitialism("defacto2")) }
Output: true
func Join ¶
Join returns the alternative spellings, acronyms and initialisms for the URL path as a comma separated string. Or an empty string if the URL path has no initialism.
Example:
Join("the-firm") = "FiRM, FRM" Join("defacto2") = "DF2"
Example ¶
package main import ( "fmt" "github.com/Defacto2/releaser/initialism" ) func main() { fmt.Println(initialism.Join("the-firm")) // FiRM, FRM fmt.Println(initialism.Join("united-software-association*fairlight")) // USA }
Output: FiRM, FRM USA/Fairlight, USA/FLT, USA
Types ¶
type List ¶
List is a map of initialisms to releasers.
func Initialisms ¶
func Initialisms() *List
Initialisms returns the list of initialisms.
All initialisms should be in their stylized form and can include initialisms, acronyms, alternative spellings.
- Any casing and formatting should *not* be done here, those go in the releaser/name package.
- This is a public repo so commonsense problematic named groups or initialisms should not be listed.
- In Go, the order of the List map keys is randomized and has no performance impact.
Example ¶
package main import ( "fmt" "slices" "github.com/Defacto2/releaser/initialism" ) func main() { const find = "USA" for key, isms := range *initialism.Initialisms() { if slices.Contains(isms, find) { fmt.Printf("Found %v in %v\n", find, key) } } }
Output: Found USA in united-software-association*fairlight