Documentation
¶
Overview ¶
Package releaser provides string functions for cleaning and reformatting the names of release groups and partial URL paths.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cell ¶ added in v1.0.3
Cell formats the string to be used as a cell in a database table. This includes the removal of duplicate spaces and the stripping of incompatible characters. The removal of excess whitespace and if found "The " prefix from BBS and FTP named sites.
Example:
Cell(" Defacto2 demo group.") = "DEFACTO2 DEMO GROUP"
Cell("the x bbs") = "X BBS"
Cell("defacto2.net") = "DEFACTO2NET"
Example ¶
package main
import (
"fmt"
"github.com/Defacto2/releaser"
)
func main() {
s := " Defacto2 demo group."
fmt.Println(releaser.Cell(s))
}
Output: DEFACTO2 DEMO GROUP
func Clean ¶
Clean fixes the malformed string. This includes the removal of duplicate spaces and the stripping of incompatible characters. The removal of excess whitespace and if found "The " prefix from BBS and FTP named sites.
Example:
Clean(" Defacto2 demo group.") = "Defacto2 Demo Group"
Clean("the x bbs") = "X BBS"
Clean("The X Ftp") = "X FTP"
Example ¶
package main
import (
"fmt"
"github.com/Defacto2/releaser"
)
func main() {
s := " Defacto2 demo group."
fmt.Println(releaser.Clean(s))
}
Output: Defacto2 Demo Group
func Humanize ¶
Humanize deobfuscates the URL path and returns the formatted, human-readable group name. The path is expected to be in the format of a URL path without the scheme or domain. If the URL path contains invalid characters then an empty string is returned.
Example:
Humanize("defacto2") = "Defacto2"
Humanize("razor-1911-demo") = "Razor 1911 Demo"
Humanize("razor-1911-demo-ampersand-skillion") = "Razor 1911 Demo & Skillion"
Humanize("north-american-pirate_phreak-association") = "North American Pirate-Phreak Association"
Humanize("razor-1911-demo*trsi") = "Razor 1911 Demo, TRSi"
Humanize("razor-1911-demo#trsi") = "" // invalid # character
Example ¶
package main
import (
"fmt"
"github.com/Defacto2/releaser"
)
func main() {
path := "razor-1911-demo"
fmt.Println(releaser.Humanize(path))
}
Output: Razor 1911 Demo
func Link ¶
Humanize deobfuscates the URL path and applies releaser.Humanize. In addition, the humanized name is formatted to be used as a link description. If the URL path contains invalid characters then an empty string is returned.
Example ¶
package main
import (
"fmt"
"github.com/Defacto2/releaser"
)
func main() {
path := "class*paradigm*razor-1911-demo"
fmt.Println(releaser.Link(path))
}
Output: Class + Paradigm + Razor 1911 Demo
func Obfuscate ¶ added in v1.0.0
Obfuscate formats the string to be used as a URL path.
Example:
Obfuscate("ACiD Productions") = "acid-productions"
Obfuscate("Razor 1911 Demo & Skillion") = "razor-1911-demo-ampersand-skillion"
Obfuscate("TDU-Jam!") = "tdu_jam"
Example ¶
package main
import (
"fmt"
"github.com/Defacto2/releaser"
)
func main() {
s := "Defacto2 Demo Group."
fmt.Println(releaser.Obfuscate(s))
}
Output: defacto2-demo-group
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package fix provides functions for cleaning and formatting strings of known words and group names.
|
Package fix provides functions for cleaning and formatting strings of known words and group names. |
|
Package initialism provides a list of alternative spellings, acronyms and initialisms for the named releasers.
|
Package initialism provides a list of alternative spellings, acronyms and initialisms for the named releasers. |
|
Package name provides functionality for handling the URL path of a releaser.
|
Package name provides functionality for handling the URL path of a releaser. |