Packge to transform authors of papers and books in ABNT (Brazilian Association of Technical Standards) format.
go get -u github.com/Darklabel91/ABNT_AuthorNormalizer
Return data can be: bool
, string
, int
or ABNTData
, the last
type ABNTData struct {
AuthorName string `json:"AuthorName,omitempty"`
ABNT string `json:"abnt,omitempty"`
ABNTShort string `json:"abnt_short,omitempty"`
FirstLetters string `json:"abnt_firstLetters,omitempty"`
FirstLettersButCompanySig string `json:"abnt_firstLettersButCompanySig,omitempty"`
}
- AuthorName: name to be normalized
- TextABNTLong: name in ABNT format
- ABNTShort: name on simple ABNT format
- FirstLetters: only the initials of a name regardless of company names
- FirstLettersButCompanySig: only the initials without company names
package main
import (
"fmt"
"github.com/Darklabel91/ABNT_AuthorNormalizer/Abnt"
"github.com/Darklabel91/ABNT_AuthorNormalizer/AbntCSV"
)
func main() {
//Single use
authorName := "Otavio Luiz Rodrigues Júnior"
test, err := Abnt.TransformABNT(authorName)
if err != nil {
fmt.Println(err)
}
fmt.Println(test.AuthorName)
fmt.Println(test.ABNT)
fmt.Println(test.ABNTShort)
//CSV use
//path := "/Users/Desktop/Authors.csv"
path := "/Users/danielfillol/Documents/GitHub/LegalDoc_Classifier/ABNT_AuthorNormalizer/CSV/authors.csv"
separator := ','
nameResultFolder := "test"
err = AbntCSV.TransformABNTCSV(path, separator, nameResultFolder)
if err != nil {
fmt.Println(err)
}
}
Return
Otavio Luiz Rodrigues Júnior
RODRIGUES JÚNIOR, Otavio Luiz
RODRIGUES JÚNIOR, O. L.
O. L. R. J.
Files created
Main Function:
- TransformABNT(authorName string) -> return ABNTData for a given name.
- TransformABNTCSV(rawFilePath string, separator rune, nameResultFolder string) -> return CSV to the given folder on param resultFolder. The .csv file given on param rawFilePath must contain only a single columm with names.a