<commit_before># Hf Builder (hfb)

[![Build Status](https://travis-ci.org/smizell/hfb.svg)](https://travis-ci.org/smizell/hfb)

Functions for building [Hf representations](https://github.com/smizell/hf).

<!-- TOC depth:6 withLinks:1 updateOnSave:1 orderedList:0 -->

- [Hf Builder (hfb)](#hf-builder-hfb)
	- [Install](#install)
	- [Usage](#usage)
		- [`hfb.addAttributes`](#hfbaddattributes)
		- [`hfb.addTransition`](#hfbaddtransition)
		- [`hfb.addMetaAttributes`](#hfbaddmetaattributes)
		- [`hfb.addMetaLink`](#hfbaddmetalink)
	- [Developing and Contributing](#developing-and-contributing)
	- [License](#license)
<!-- /TOC -->

## Install

```sh
npm install hfb --save
```

## Usage

### `hfb.attributes`

Takes an Hf object and an attributes object. If `attributes` does not exist, it adds it to the Hf object. It then returns the `attributes` property.

```js
var attributes = hfb.attributes({}); // now {attributes: {}}
```

### `hfb.addAttributes`

Takes an Hf object and an attributes object. If `attributes` does not exist, it adds it to the Hf object. If the `attributes` exist, it does a merge of the given attributes.

```js
var hfObj = hfb.addAttributes({}, {foo: 'bar'});
```

The `hfObj` variable now has:

```js
{<commit_msg>Fix README<commit_after># Hf Builder (hfb)

[![Build Status](https://travis-ci.org/smizell/hfb.svg)](https://travis-ci.org/smizell/hfb)

Functions for building [Hf representations](https://github.com/smizell/hf).

- [Hf Builder (hfb)](#hf-builder-hfb)
	- [Install](#install)
	- [Usage](#usage)
		- [`hfb.addAttributes`](#hfbaddattributes)
		- [`hfb.addTransition`](#hfbaddtransition)
		- [`hfb.addMetaAttributes`](#hfbaddmetaattributes)
		- [`hfb.addMetaLink`](#hfbaddmetalink)
	- [Developing and Contributing](#developing-and-contributing)
	- [License](#license)

## Install

```sh
npm install hfb --save
```

## Usage

### `hfb.attributes`

Takes an Hf object and an attributes object. If `attributes` does not exist, it adds it to the Hf object. It then returns the `attributes` property.

```js
var attributes = hfb.attributes({}); // now {attributes: {}}
```

### `hfb.addAttributes`

Takes an Hf object and an attributes object. If `attributes` does not exist, it adds it to the Hf object. If the `attributes` exist, it does a merge of the given attributes.

```js
var hfObj = hfb.addAttributes({}, {foo: 'bar'});
```

The `hfObj` variable now has:

```js
{
{'fraction_non_alphanumeric': 0.1741479634247714, 'fraction_numerical': 0.0016625103906899418, 'mean_word_length': 4.5717592592592595, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6827704', 'n_tokens_mistral': 879, 'n_tokens_neox': 834, 'n_words': 225}