An expert system for document retrieval