add function to  make sentiment lexicon file I/O robust