// String is an implementation of String() method for JSONTrDict pointer.
// It returns a pretty formatted string.
String is an implementation of String() method for JSONTrDict pointer.
It returns a pretty formatted string.
// String is an implementation of String () method for JSONTrDict pointer . // It returns a pretty formatted string .
func (jstrd *JSONTrDict) String() string {
	var (
		result, arResult []string
		txtResult        string
	)
	tabSym := fmt.Sprintf("%v  ", strSep)
	result = make([]string, len(jstrd.Def))
	for i, def := range jstrd.Def {
		ts := ""
		if def.Ts != "" {
			ts = fmt.Sprintf(" [%v] ", def.Ts)
		}
		txtResult = fmt.Sprintf("%v%v", def.Text, ts)
		if def.Pos != "" {
			txtResult += fmt.Sprintf("(%v)", def.Pos)
		}
		arResult = make([]string, len(def.Tr))
		for j, tr := range def.Tr {
			arResult[j] = fmt.Sprintf("%v (%v)", tr.Text, tr.Pos)
		}
		result[i] = fmt.Sprintf("%v%v%v", txtResult, strSep, strings.Join(arResult, tabSym))
	}
	return strings.Join(result, strSep)
}
func ( jstrd * JSONTrDict ) String ( ) string { var ( result , arResult [ ] string txtResult string ) tabSym := fmt . Sprintf ( " " , strSep ) result = make ( [ ] string , len ( jstrd . Def ) ) for i , def := range jstrd . Def { ts := " " if def . Ts != " " { ts = fmt . Sprintf ( " " , def . Ts ) } txtResult = fmt . Sprintf ( " " , def . Text , ts ) if def . Pos != " " { txtResult += fmt . Sprintf ( " " , def . Pos ) } arResult = make ( [ ] string , len ( def . Tr ) ) for j , tr := range def . Tr { arResult [ j ] = fmt . Sprintf ( " " , tr . Text , tr . Pos ) } result [ i ] = fmt . Sprintf ( " " , txtResult , strSep , strings . Join ( arResult , tabSym ) ) } return strings . Join ( result , strSep ) }
String is an implementation of String() method for JSONTrDict pointer.
String is an implementation of String () method for JSONTrDict pointer .