Skip to content

igor-siciliani/charnet

 
 

Repository files navigation

charnet - character networks

This project performed studies using complex networks in some books. We considered characters as nodes and characters encounters as edges. The project has a GitHub page and a manuscript.

Directories content

Prerequisites

  • Python and the packages:

Structure

The structure of the project follows, mainly, the Composite design pattern where Book is the Component, Books class is the Composite, and the books like "acts of the apostles" (Acts) and the biography of J. R. R. Tolkien (Tolkien) are Leafs.

UML class diagram

  • Book: methods declared here are inherited by Leaf books, and the main method is read() that returns a Graph containing characters' encounters as edges.

  • Acts: is an example of concrete Leaf classes, like Acts that represents the book "acts of apostles", were coded inside inside the file books.py.

  • Books: is the Composite class, read() method has a different behavior iterating over all Leafs to execute their read() method.

  • Formatting: is responsible to write LaTeX-formatted output to append in the paper.

  • Graphs: process graphs to obtain measures used in the analisys like average degree, betweenness, closeness and lobby.

  • Graph: is an instance from Graph from NetworkX library.

  • Plot: plot the curves from data generated from graphs.

  • Draw: draw graphs using graphviz python library.

  • lobby(): function to calculate the lobby index.

  • Charnet: helper to handle configuration specific to books gathered in this project.

  • SGB: helper to handle configuration specific to books gathered in Stanford GraphBase project.

  • Project: template (interface) for project properties.

  • __main__: client to execute the operations.

Running

To generate all results and plots, just run:

$ make

To select a specific target, see the help:

$ make help

To clean the output generated:

$ make clean

Feedback

Please, open an issue for any feeback.

Packages

No packages published

Languages

  • Python 98.7%
  • Makefile 1.3%