added flexgram computation support to patternmodeller