modify util_learnText.py, stable version, can be run from raw .text materials