Dirty implementation for didatic reasons of [SPIMI](http://nlp.stanford.edu/IR-book/html/htmledition/single-pass-in-memory-indexin)g-1.html