Learning Lambek grammars from proof frames