Language Identification through a Graph-based Approach