The theory and implementation of a bidirectional question answering system