fix handling of word boundaries in allomorph environments in HC

Change-Id: If8f1522506b15d8979b63471a05c01d01290ccd4