<commit_before># PicoJSON - a C++ JSON parser / serializer

- Copyright 2009-2010 Cybozu Labs, Inc.
- Copyright 2011 <NAME>

## Introduction

PicoJSON is a tiny JSON parser / serializer for C++ with following properties:

- header-file only
- no external dependencies (only uses standard C++ libraries)
- STL-frendly (arrays are represented by using std::vector, objects are std::map)
- provides both pull interface and streaming (event-based) interface
- licensed under the new BSD License

## Reading JSON using the pull interface

There are two ways to use the pull (DOM-like) interface of picojson.  One is to use operator&lt;&lt;, and the other is by specifying a set of iterators specifying the range from where the JSON stream should be read.

<pre>
picojson::value v;
std::cin &gt;&gt; v;
std::string err = picojson::get_last_error();
if (! err.empty()) {
  std::cerr &lt;&lt; err &lt;&lt; std::endl;
}
</pre>

<pre><commit_msg>more doc<commit_after># PicoJSON - a C++ JSON parser / serializer

Copyright &copy; 2009-2010 Cybozu Labs, Inc.
Copyright &copy; 2011 <NAME>

## Introduction

PicoJSON is a tiny JSON parser / serializer for C++ with following properties:

- header-file only
- no external dependencies (only uses standard C++ libraries)
- STL-frendly (arrays are represented by using std::vector, objects are std::map)
- provides both pull interface and streaming (event-based) interface
- licensed under the new BSD License

## Reading JSON using the pull interface

There are two ways to use the pull (DOM-like) interface of picojson.  One is to use operator&lt;&lt;, and the other is by specifying a set of iterators specifying the range from where the JSON stream should be read.

<pre>
picojson::value v;
std::cin &gt;&gt; v;
std::string err = picojson::get_last_error();
if (! err.empty()) {
  std::cerr &lt;&lt; err &lt;&lt; std::endl;
}
</pre>

<pre>
{'fraction_non_alphanumeric': 0.10761854022376133, 'fraction_numerical': 0.012786361214704315, 'mean_word_length': 4.523529411764706, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, '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': '1240877', 'n_tokens_mistral': 589, 'n_tokens_neox': 556, 'n_words': 250}