<commit_before># Descriptions for Personality Insights Traits
![last-release](https://img.shields.io/github/tag/personality-insights/trait-descriptions.svg)
[![npm-version](https://img.shields.io/npm/v/personality-trait-descriptions.svg)](https://www.npmjs.com/package/personality-trait-descriptions)
[![npm-license](https://img.shields.io/npm/l/personality-trait-descriptions.svg)](https://www.npmjs.com/package/personality-trait-descriptions)
[![Build Status](https://travis-ci.org/personality-insights/trait-descriptions.svg?branch=master)](https://travis-ci.org/personality-insights/trait-descriptions)
[![codecov.io](https://codecov.io/github/personality-insights/trait-descriptions/coverage.svg?branch=master)](https://codecov.io/github/personality-insights/trait-descriptions?branch=master)
[![npm-downloads](https://img.shields.io/npm/dm/personality-trait-descriptions.svg)](https://www.npmjs.com/package/personality-trait-descriptions)

Obtain descriptions for Personality Insights' traits.

## Getting Started

1. Require and instance `personality-trait-descriptions` component

  ```JavaScript
  const PersonalityTraitDescriptions = require('personality-trait-descriptions');
  const traitDescriptions = new PersonalityTraitDescriptions({ locale: 'es' });
  ```

2. Get your description

  ```JavaScript
  const opennessDescription  = traitDescriptions.description('big5.openness');
  const structureDescription = traitDescriptions.description('needs.structure');
  const hedonismDescription  = traitDescriptions.description('values.hedonism');
  ```

3. Render behaviors somewhere! Try rendering them as cards!

See the complete [example code][example_code] or [try it live][live_example]

## More Features

There are more features available such as:

- Including the component as a browser script. Component will be exported as the
global variable `PersonalityTraitDescriptions`.

- Formatting descriptions in html or markdown optionally!
```JavaScript
const traitDescriptions   = new PersonalityTraitDescriptions({ format:'html' });
const hedonismDescription = traitDescriptions.description('values.hedonism');
```

## API Methods

The available methods are the following ones:
  - `constructor :: (Options) -> PersonalityTraitDescriptions` - Obtain an instance of `PersonalityTraitDescriptions`.
  - `description :: (TraitID) -> String` - Obtain description for the given `TraitID`.

Definitions:
 - `TraitID` is an ID from IBM Watson Personality Insights traits.
 - `Options` are options for the behaviors component. Available options are:
   - `locale` - A `String` with the locale used to generate the labels.
   - `format` - A `String` with format. Available formats are `["plain", "html", "markdown"]`.

 [example_code]: https://github.com/personality-insights/trait-descriptions/blob/master/examples/example.html
 [live_example]: https://rawgit.com/personality-insights/trait-descriptions/master/examples/example.html<commit_msg>Improved readme<commit_after># Descriptions for Personality Insights Traits
![last-release](https://img.shields.io/github/tag/personality-insights/trait-descriptions.svg)
[![npm-version](https://img.shields.io/npm/v/personality-trait-descriptions.svg)](https://www.npmjs.com/package/personality-trait-descriptions)
[![npm-license](https://img.shields.io/npm/l/personality-trait-descriptions.svg)](https://www.npmjs.com/package/personality-trait-descriptions)
[![Build Status](https://travis-ci.org/personality-insights/trait-descriptions.svg?branch=master)](https://travis-ci.org/personality-insights/trait-descriptions)
[![codecov.io](https://codecov.io/github/personality-insights/trait-descriptions/coverage.svg?branch=master)](https://codecov.io/github/personality-insights/trait-descriptions?branch=master)
[![npm-downloads](https://img.shields.io/npm/dm/personality-trait-descriptions.svg)](https://www.npmjs.com/package/personality-trait-descriptions)

Obtain descriptions for Personality Insights' traits.

## Getting Started

1. Require and instance `personality-trait-descriptions` component

  ```JavaScript
  const PersonalityTraitDescriptions = require('personality-trait-descriptions');
  const traitDescriptions = new PersonalityTraitDescriptions({ locale: 'es' });
  ```

2. Get your description

  ```JavaScript
  const opennessDescription  = traitDescriptions.description('big5.openness');
  const structureDescription = traitDescriptions.description('needs.structure');
  const hedonismDescription  = traitDescriptions.description('values.hedonism');
  ```

3. Render behaviors somewhere! Try rendering them as cards!

See the complete [example code][example_code] or [try it live][live_example]

## More Features

There are more features available such as:

- Including the component as a browser script. Component will be exported as the
global variable `PersonalityTraitDescriptions`.

- Formatting descriptions in html or markdown optionally!
```JavaScript
const traitDescriptions   = new PersonalityTraitDescriptions({ format:'html' });
const hedonismDescription = traitDescriptions.description('values.hedonism');
```

## API Methods

The available methods are the following ones:
  - `constructor :: (Options) -> PersonalityTraitDescriptions` - Obtain an instance of `PersonalityTraitDescriptions`.
  - `description :: (TraitID) -> String` - Obtain description for the given `TraitID`.

Definitions:
 -  `TraitID` is an ID (`String`) from IBM Watson Personality Insights traits, including category ID and parent trait IDs with pattern `(big5|needs|values)[.<parent-id>]*.<id>`. Spaces are replaced with underscores. e.g. `big5.neuroticism`, `big5.openness.artistic_interests`, `big5.conscientiousness.self-efficacy`.
 - `Options` are options for the behaviors component. Available options are:
   - `locale` - A `String` with the locale used to generate the labels.
   - `format` - A `String` with format. Available formats are `["plain", "html", "markdown"]`.

 [example_code]: https://github.com/personality-insights/trait-descriptions/blob/master/examples/example.html
 [live_example]: https://rawgit.com/personality-insights/trait-descriptions/master/examples/example.html
{'fraction_non_alphanumeric': 0.12987646293888166, 'fraction_numerical': 0.0019505851755526658, 'mean_word_length': 5.836666666666667, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 26, 'lorem ipsum': 0, 'www.': 6, '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': '1902576', 'n_tokens_mistral': 1814, 'n_tokens_neox': 1767, 'n_words': 386}