<commit_before># go-senml

A go library to parse SenML records. It currently supports only JSON and XML, but more formats like CBOR are planned.

This currently implements 'draft-ietf-core-senml-08' (https://tools.ietf.org/html/draft-ietf-core-senml-08)

## Install
```sh
go get github.com/nkristek/go-seml
```

## Import
```go
import(
	"github.com/nkristek/go-seml"
)
```

## Use
```go
// parse using the encoding format
message, err := senml.ParseBytes(payload, senml.JSON)
if err != nil {
	// process error
}

// resolve the message (resolve base attributes, convert relative to absolute time etc.)
resolvedMessage, err := senml.Resolve(message)
if err != nil {
	// process error
}

// encode a new message
encodedMessage, err := senml.EncodeToBytes(message, senml.JSON)
if err != nil {
	// process error
}
```

For further documentation, visit http://godoc.org/github.com/nkristek/go-senml

<commit_msg>Improve the usage documentation<commit_after># go-senml

A go library to parse SenML records. It currently supports only JSON and XML, but more formats like CBOR are planned.

This currently implements 'draft-ietf-core-senml-08' (https://tools.ietf.org/html/draft-ietf-core-senml-08)

## Install
```sh
go get github.com/nkristek/go-seml
```

## Import
```go
import(
	"github.com/nkristek/go-seml"
)
```

## Use
```go
// parse using the encoding format
message, err := senml.ParseBytes(payload, senml.JSON)
if err != nil {
	// process error
}

// resolve the message (resolve base attributes, convert relative to absolute time etc.)
resolvedMessage, err := senml.Resolve(message)
if err != nil {
	// process error
}

// encode a new message
encodedMessage, err := message.EncodeToBytes(senml.JSON)
if err != nil {
	// process error
}
```

For further documentation, visit http://godoc.org/github.com/nkristek/go-senml


{'fraction_non_alphanumeric': 0.13424657534246576, 'fraction_numerical': 0.004383561643835616, 'mean_word_length': 4.03030303030303, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3559346', 'n_tokens_mistral': 619, 'n_tokens_neox': 594, 'n_words': 184}