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"}
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
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() {
s := initialism.Join("the-firm")
fmt.Println(s) // FiRM, FRM
s = initialism.Join("united-software-association")
fmt.Println(s) // USA
}
Output: FiRM, FRM USA
Types ¶
type List ¶
List is a map of initialisms to releasers.
func Initialisms ¶
func Initialisms() List
Initialisms returns the list of initialisms.
Example ¶
package main
import (
"fmt"
"github.com/Defacto2/releaser/initialism"
)
func main() {
const find = "USA"
for k, v := range initialism.Initialisms() {
for _, x := range v {
if x == find {
fmt.Printf("Found %v in %v\n", find, k)
return
}
}
}
}
Output: Found USA in united-software-association