<commit_before>The goal of this project is to provide some useful Ruby functions to manipulate
graph files.

GDF Module
----------

The GDF module is used to parse GDF files using the unique method
`GDF.parse(filename)`. It returns a `GDF::Graph` object, which provide two
attributes: `nodes` and `edges`.<commit_msg>Example added to README<commit_after>The goal of this project is to provide some useful Ruby functions to manipulate
graph files.

GDF Module
==========

The GDF module is used to parse
[GDF](http://guess.wikispot.org/The_GUESS_.gdf_format) files using the unique method
`GDF.parse(filename)`. It returns a `GDF::Graph` object, which provide two
attributes: `nodes` and `edges`

Example
-------

Imagine we have a file as below:

     $ cat trips.gdf
     nodedef> name VARCHAR,country VARCHAR
     Foo,england
     Bar,india
     edgedef> node1,node2,day INT,duration INT
     Bar,Foo,62,14
     Foo,Bar,154,7

Then, using `irb`, we use the `GDF` module:

     $ irb
     irb> require './gdf'
     => true
     irb> g = GDF::parse 'trips.gdf'
     […]

We can now access nodes

     irb> g.nodes
     => [{'name'=>'Foo', 'country'=>'england'}, {'name'=>'Bar'}]
     
and edges

     irb> g.edges
     => [{'node1'=>'Bar', 'node2'=>'Foo', 'day'=>'62', 'duration'=>'14'},
         {'node1'=>'Foo', 'node2'=>'Bar', 'day'=>'154', 'duration'=>'7'}]

Note that the GDF module does not yet support value types (all values are strings).
{'fraction_non_alphanumeric': 0.15145228215767634, 'fraction_numerical': 0.015214384508990318, 'mean_word_length': 3.5077881619937696, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, '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': '6764627', 'n_tokens_mistral': 481, 'n_tokens_neox': 467, 'n_words': 167}